Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,10 @@ import io
|
|
4 |
import re
|
5 |
import traceback
|
6 |
|
7 |
-
def process_files(phase,
|
8 |
try:
|
9 |
# Read and process the 'objecten.txt' file
|
10 |
-
content =
|
11 |
t = content.strip().split('\n\n')
|
12 |
phases = ["iFAT", "(i)SAT"]
|
13 |
objs = {p: [] for p in phases}
|
@@ -31,7 +31,7 @@ def process_files(phase, objecten_file_dict, templates_zip_file_dict):
|
|
31 |
objs[k] = [re.search(regObject, o).group(0) for o in objs[k] if re.search(regObject, o)]
|
32 |
|
33 |
# Read template files from the uploaded ZIP file
|
34 |
-
templates_zip_data =
|
35 |
with zipfile.ZipFile(io.BytesIO(templates_zip_data), 'r') as zip_ref:
|
36 |
template_files = {info.filename: zip_ref.read(info.filename) for info in zip_ref.infolist()}
|
37 |
|
|
|
4 |
import re
|
5 |
import traceback
|
6 |
|
7 |
+
def process_files(phase, objecten_file_data, templates_zip_file_data):
|
8 |
try:
|
9 |
# Read and process the 'objecten.txt' file
|
10 |
+
content = objecten_file_data.decode('utf-8')
|
11 |
t = content.strip().split('\n\n')
|
12 |
phases = ["iFAT", "(i)SAT"]
|
13 |
objs = {p: [] for p in phases}
|
|
|
31 |
objs[k] = [re.search(regObject, o).group(0) for o in objs[k] if re.search(regObject, o)]
|
32 |
|
33 |
# Read template files from the uploaded ZIP file
|
34 |
+
templates_zip_data = templates_zip_file_data
|
35 |
with zipfile.ZipFile(io.BytesIO(templates_zip_data), 'r') as zip_ref:
|
36 |
template_files = {info.filename: zip_ref.read(info.filename) for info in zip_ref.infolist()}
|
37 |
|