From ac58fbb15c38d4397a93dc0a0fc6963ef21aadaf Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Tue, 18 Feb 2025 09:42:39 -0800 Subject: [PATCH] feat: Add chartsheet warnings to error log for file processing --- src/streamlit_app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 069ae8f..1cc58f7 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -374,7 +374,9 @@ if input_method == "Upload Files" and uploaded_files and st.button("Process File # Pass original filename to copy_excel_file chartsheet_warning = copy_excel_file(temp_input_path, temp_output_path, passwords, original_filename=uploaded_file.name) if chartsheet_warning: - st.warning(f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly.") + warning_msg = f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly." + st.warning(warning_msg) + st.session_state.error_log[uploaded_file.name] = warning_msg else: # Word remove_all_protection_tags(temp_input_path, temp_output_path) @@ -460,7 +462,9 @@ elif input_method == "Select Directory" and source_dir and dest_dir and st.butto if file_type == "Excel": chartsheet_warning = copy_excel_file(source_path, dest_path, passwords) if chartsheet_warning: - st.warning(f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly.") + warning_msg = f"⚠️ {chartsheet_warning} Please check the processed file against the original to ensure data was copied correctly." + st.warning(warning_msg) + st.session_state.error_log[relative_path] = warning_msg else: # Word remove_all_protection_tags(source_path, dest_path)