From ecaf2bdf45ca9bb5d89ee60bd4b26cf7789b3348 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Thu, 30 Nov 2023 22:36:16 +0800 Subject: [PATCH] add comparison pdf file save and load --- crazy_functions/latex_fns/latex_actions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crazy_functions/latex_fns/latex_actions.py b/crazy_functions/latex_fns/latex_actions.py index be3d52e..113a278 100644 --- a/crazy_functions/latex_fns/latex_actions.py +++ b/crazy_functions/latex_fns/latex_actions.py @@ -416,6 +416,8 @@ def 编译Latex(chatbot, history, main_file_original, main_file_modified, work_f from .latex_toolbox import merge_pdfs concat_pdf = pj(work_folder_modified, f'comparison.pdf') merge_pdfs(origin_pdf, result_pdf, concat_pdf) + if os.path.exists(pj(work_folder, '..', 'translation')): + shutil.copyfile(concat_pdf, pj(work_folder, '..', 'translation', 'comparison.pdf')) promote_file_to_downloadzone(concat_pdf, rename_file=None, chatbot=chatbot) # promote file to web UI except Exception as e: print(e)