Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -122,8 +122,11 @@ def get_file(temp_dir, file_path):
|
|
122 |
|
123 |
def process_directory(directory):
|
124 |
code_partial_paths = ['kadi_apy/lib/resources/']
|
|
|
|
|
|
|
125 |
|
126 |
-
|
127 |
print(zip_file_path)
|
128 |
# with tempfile.TemporaryDirectory() as tmpdirname:
|
129 |
# Unzip the file into the temporary directory
|
@@ -137,9 +140,7 @@ def process_directory(directory, partial_paths=None, file_paths=None):
|
|
137 |
all_texts = []
|
138 |
file_references = []
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
if not zip_files:
|
145 |
print("No zip file found in the directory.")
|
|
|
122 |
|
123 |
def process_directory(directory):
|
124 |
code_partial_paths = ['kadi_apy/lib/resources/']
|
125 |
+
|
126 |
+
|
127 |
+
zip_file_path = next((file for file in os.listdir(directory) if file.endswith('.zip')), None)
|
128 |
|
129 |
+
# zip_file_path = os.listdir(directory) if file.endswith('.zip')
|
130 |
print(zip_file_path)
|
131 |
# with tempfile.TemporaryDirectory() as tmpdirname:
|
132 |
# Unzip the file into the temporary directory
|
|
|
140 |
all_texts = []
|
141 |
file_references = []
|
142 |
|
143 |
+
zip_files = [file for file in os.listdir(directory) if file.endswith('.zip')]
|
|
|
|
|
144 |
|
145 |
if not zip_files:
|
146 |
print("No zip file found in the directory.")
|