Preload some generate() variables
This commit is contained in:
parent
d1af841b41
commit
fc037bd105
11
latty.py
11
latty.py
|
@ -16,6 +16,11 @@ def get_datetime():
|
|||
now = datetime.now()
|
||||
return now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
root_dir = os.path.dirname(os.getcwd())
|
||||
proj_dir = root_dir + '/undercover/'
|
||||
output_dir = proj_dir + 'outputs/'
|
||||
base_tex_text = open(proj_dir + "/writing_templates/base.tex", "r").read()
|
||||
|
||||
@dataclass
|
||||
class CLData():
|
||||
username: str
|
||||
|
@ -40,15 +45,11 @@ class CLData():
|
|||
def generate_pdf(self):
|
||||
import threading
|
||||
unique_id = get_unique()
|
||||
root_dir = os.path.dirname(os.getcwd())
|
||||
proj_dir = root_dir + '/undercover/'
|
||||
output_dir = proj_dir + 'outputs/'
|
||||
|
||||
unique_file = output_dir + unique_id + ".tex"
|
||||
f = open(unique_file, "w")
|
||||
for pair in self.get_pairs():
|
||||
f.write("\\def \\" + pair[0] + "{" + pair[1] + "}\n")
|
||||
f.write(open(proj_dir + "/writing_templates/base.tex", "r").read())
|
||||
f.write(base_tex_text)
|
||||
f.close()
|
||||
|
||||
output_arg="-jobname=outputs/" + unique_id + " " + unique_file
|
||||
|
|
Loading…
Reference in New Issue