Skip to content
Snippets Groups Projects

Feat: Remove extra information from report

Merged Mikhail Karnevskiy requested to merge feat/report_cleaning into master
All threads resolved!
@@ -15,10 +15,29 @@ import time
from uuid import uuid4
def atoi(text):
'''
Convert string to integer is possible
:param text: string to be converted
:return: integer value or input string
'''
return int(text) if text.isdigit() else text
def natural_keys(text):
'''
Decompose string to list of integers and sub-strings
'''
return [ atoi(c) for c in re.split(r'(\d+)', text) ]
def combine_report(run_path, calibration):
sphinx_path = "{}/sphinx_rep".format(os.path.abspath(run_path))
os.makedirs(sphinx_path)
direntries = os.listdir(run_path)
direntries.sort(key=natural_keys)
for entry in direntries:
@@ -126,6 +145,10 @@ def make_report(run_path, tmp_path, out_path, project, author, version, report_t
line = line.replace("Documentation", "Calibration")
if ":caption." in line:
continue
if "Contents:" in line:
continue
+3
if line == 'Indices and tables\n':
break
mf.write(line)
cdir = os.getcwd()
Loading