Skip to content
Snippets Groups Projects
Commit f503a51e authored by Karim Ahmed's avatar Karim Ahmed
Browse files

testing del unrelated folders

parent b06d2d82
No related branches found
No related tags found
2 merge requests!298Feat/dss cimprove master rebasing,!265keep, rename and move temp folder with report
......@@ -3,7 +3,7 @@ from importlib.machinery import SourceFileLoader
from os import chdir, listdir, makedirs, path, remove, stat
from os.path import isdir, isfile, splitext
import re
from shutil import copy, copytree, move
from shutil import copy, copytree, move, rmtree
from subprocess import CalledProcessError, check_call, check_output
from textwrap import dedent
from time import sleep
......@@ -273,10 +273,17 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
return
print("Moving report to final location: {}".format(out_path))
copy('{}/_build/latex/{}.pdf'.format(run_path, report_name), out_path)
temp_dirs = glob(f'{tmp_path}/*/')
# Remove folders with figures and sphinx files.
print(f"Removing directories [{temp_dirs}] in temp folder: {tmp_path}")
[rmtree(f'{dtmp}/') for dtmp in temp_dirs]
# Moving temporary files to out-folder after successful execution
# This helps in keeping elements needed for reproducability.
print(f"Moving temporary files to final location"
f": {out_path}/temp_{time_now}")
f": {out_path}/{os.path.basename(tmp_path)}")
move(tmp_path, f"{out_path}/{os.path.basename(tmp_path)}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment