Skip to content
Snippets Groups Projects
Commit 18bb8eda authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

small refactoring

parent a4e1e525
No related branches found
No related tags found
1 merge request!68Add title page. Modify conf.py.
from collections import OrderedDict
import glob
from importlib.machinery import SourceFileLoader
import os import os
from os.path import isfile, isdir, splitext from os.path import isfile, isdir, splitext
from time import sleep
from subprocess import check_output, check_call, CalledProcessError
from shutil import copy, move, rmtree, copytree
from queue import Queue from queue import Queue
from collections import OrderedDict from shutil import copy, move, rmtree, copytree
import glob from subprocess import check_output, check_call, CalledProcessError
from jinja2 import Template
import textwrap import textwrap
from time import sleep
from jinja2 import Template
import tabulate import tabulate
from importlib.machinery import SourceFileLoader
from xfel_calibrate import settings from xfel_calibrate import settings
def atoi(text): def atoi(text):
...@@ -220,7 +222,6 @@ def make_report(run_path, tmp_path, out_path, project, author, version, ...@@ -220,7 +222,6 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
tmpl = '{} = {}\n' tmpl = '{} = {}\n'
v = getattr(conf, var, None) v = getattr(conf, var, None)
if isinstance(v, str): if isinstance(v, str):
print(var, v)
tmpl = '{} = "{}"\n' tmpl = '{} = "{}"\n'
mf.write(tmpl.format(var, v)) mf.write(tmpl.format(var, v))
...@@ -262,7 +263,6 @@ def make_report(run_path, tmp_path, out_path, project, author, version, ...@@ -262,7 +263,6 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
return return
print("Moving report to final location: {}".format(out_path)) print("Moving report to final location: {}".format(out_path))
for f in glob.glob(r'{}/_build/latex/*.pdf'.format(run_path)): for f in glob.glob(r'{}/_build/latex/*.pdf'.format(run_path)):
print(f)
copy(f, out_path) copy(f, out_path)
print("Removing temporary files at: {}".format(tmp_path)) print("Removing temporary files at: {}".format(tmp_path))
rmtree(tmp_path) rmtree(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