dunlp commited on
Commit
e7f75f3
1 Parent(s): 8bcf8dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- return output_zip_buffer, None
 
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()