Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def process_files(phase, objecten_file_data, templates_zip_file_data):
|
|
18 |
|
19 |
regObject = r"\d{4}[a-zA-Z]{2}"
|
20 |
for g in t:
|
21 |
-
ls = g.strip().split('\n')
|
22 |
k = ls[0].strip()
|
23 |
if k in objs:
|
24 |
objs[k] = ls[1:]
|
@@ -67,7 +67,8 @@ def process_files(phase, objecten_file_data, templates_zip_file_data):
|
|
67 |
file_path = folder_path + adjusted_filename
|
68 |
zf.writestr(file_path, file_content)
|
69 |
output_zip_buffer.seek(0)
|
70 |
-
|
|
|
71 |
except Exception as e:
|
72 |
# Capture the full traceback
|
73 |
error_msg = traceback.format_exc()
|
|
|
18 |
|
19 |
regObject = r"\d{4}[a-zA-Z]{2}"
|
20 |
for g in t:
|
21 |
+
ls = [line.strip() for line in g.strip().split('\n') if line.strip()]
|
22 |
k = ls[0].strip()
|
23 |
if k in objs:
|
24 |
objs[k] = ls[1:]
|
|
|
67 |
file_path = folder_path + adjusted_filename
|
68 |
zf.writestr(file_path, file_content)
|
69 |
output_zip_buffer.seek(0)
|
70 |
+
# Return a dictionary with 'name' and 'data'
|
71 |
+
return {'name': 'output.zip', 'data': output_zip_buffer.getvalue()}, None
|
72 |
except Exception as e:
|
73 |
# Capture the full traceback
|
74 |
error_msg = traceback.format_exc()
|