Skip to content

Commit

Permalink
fix mistakes for md_pack
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinaProsche committed Sep 29, 2024
1 parent 1785eb6 commit 66859a3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/main/check_packs/pack_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
["spelling_check"],
["max_abstract_size_check"],
["theme_in_report_check"],
["table_share_check"],
# ["table_share_check"],
['key_words_report_check'],
["empty_task_page_check"],
["template_name"],
Expand Down
5 changes: 2 additions & 3 deletions app/main/checks/report_checks/needed_headers_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def __init__(self, file_info, main_heading_style="heading 2", headers_map=None):
super().__init__(file_info)
self.headers_page = 1
self.headers = []
self.patterns = []
self.main_heading_style = main_heading_style
if headers_map:
self.config = headers_map
else:
self.config = 'VKR_HEADERS' if (self.file_type['report_type'] == 'VKR') else 'LR_HEADERS'
# self.patterns = StyleCheckSettings.CONFIGS.get(self.config)[0]["headers"]

def late_init(self):
self.headers = self.file.make_chapters(self.file_type['report_type'])
Expand All @@ -30,8 +30,7 @@ def late_init(self):
if 'any_header' in StyleCheckSettings.CONFIGS.get(self.config):
self.headers_main = 'any_header'
self.patterns = StyleCheckSettings.CONFIGS.get(self.config)['any_header']['headers']
self.second_lvl_headers = StyleCheckSettings.CONFIGS.get(self.config).get('second_header', {}).get('second_header_check')

self.second_lvl_headers = StyleCheckSettings.CONFIGS.get(self.config).get('second_header', {}).get('second_header_check')
def find_headers_second_lvl(self, header_ind, header_text):
result_string_second_lvl = ''
final_str = ''
Expand Down
14 changes: 7 additions & 7 deletions app/main/checks/report_checks/style_check_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ class StyleCheckSettings:
{
"style": HEADER_1_STYLE,
"docx_style": ["heading 2"],
"headers": ["Поставленная цель и задачи",
"Тематика статьи",
"Методы обоснования",
"Статья",
"headers": ["поставленная цель и задачи",
"тематика статьи",
"методы обоснования",
"статья",
],
"header_for_report_section_component": "Поставленная цель и задачи",
"unify_regex": None,
Expand All @@ -182,9 +182,9 @@ class StyleCheckSettings:
{
"style": HEADER_1_STYLE,
"docx_style": ["heading 2"],
"headers": ["Характеристика используемых данных",
"Характеристика выводов",
"Статья",
"headers": ["характеристика используемых данных",
"характеристика выводов",
"статья",
],
"header_for_report_section_component": "",
"unify_regex": None,
Expand Down
5 changes: 4 additions & 1 deletion app/main/checks/report_checks/table_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def check(self):
def search_references(self):
array_of_references = set()
for i in range(0, self.last_child_number):
detected_references = re.findall(r'таблиц[аеыу][\d .]+', self.file.paragraphs[i].paragraph_text)
if isinstance(self.file.paragraphs[i], str):
detected_references = re.findall(r'таблиц[аеыу][\d .]+', self.file.paragraphs[i])
else:
detected_references = re.findall(r'таблиц[аеыу][\d .]+', self.file.paragraphs[i].paragraph_text)
if detected_references:
for reference in detected_references:
for one_part in re.split(r'таблиц[аеыу]| ', reference):
Expand Down

0 comments on commit 66859a3

Please sign in to comment.