File size: 870 Bytes
68fb5e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import re

with open("modules/research_tab.py", "r", encoding="utf-8") as f:
    lines = f.readlines()

new_lines = []
for line in lines:
    if 'stats_html\n' in line and '""' in line:
        line = line.replace('stats_html\n', 'stats_html, ""\n')
    elif 'stats_html\n' in line and 'ref_md' in line:
        line = line.replace('stats_html\n', 'stats_html, ""\n')
    elif 'stats_html' in line and ')' in line and 'yield' not in line:
        if '_build_section_cards_html({})' in line or 'Detenido' in line:
            line = line.replace('stats_html', 'stats_html, ""')
        elif 'sections_map' in line or 'accumulated_report' in line or 'empty_df' in line:
            line = line.replace('stats_html', 'stats_html, accumulated_report')
    new_lines.append(line)

with open("modules/research_tab.py", "w", encoding="utf-8") as f:
    f.writelines(new_lines)