jaifar530 commited on
Commit
6b0535c
·
unverified ·
1 Parent(s): a295ebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -163,12 +163,12 @@ def check_and_download_files():
163
  missing_files.append(file_name)
164
 
165
  if missing_files:
166
- print("The following files are missing:")
167
  for file_name in missing_files:
168
- print(file_name)
169
 
170
  if not has_internet_connection():
171
- print("No internet connection. Cannot download missing files.")
172
  return
173
 
174
  try:
@@ -183,7 +183,7 @@ def check_and_download_files():
183
  zip_file.write(response.content)
184
 
185
  if not is_zip_file('content.zip'):
186
- print("Downloaded content is not a ZIP file.")
187
  return
188
 
189
  with zipfile.ZipFile('content.zip', 'r') as zip_ref:
@@ -191,14 +191,14 @@ def check_and_download_files():
191
 
192
  extracted_files = os.listdir()
193
  if not are_files_extracted(extracted_files, missing_files):
194
- print("Not all missing files were extracted.")
195
  return
196
 
197
- print("content.zip downloaded and extracted successfully.")
198
  except Exception as e:
199
- print(f"Error downloading or extracting content.zip: {e}")
200
  else:
201
- print("All files exist.")
202
 
203
  check_and_download_files()
204
 
 
163
  missing_files.append(file_name)
164
 
165
  if missing_files:
166
+ st.write("The following files are missing:")
167
  for file_name in missing_files:
168
+ st.write(file_name)
169
 
170
  if not has_internet_connection():
171
+ st.write("No internet connection. Cannot download missing files.")
172
  return
173
 
174
  try:
 
183
  zip_file.write(response.content)
184
 
185
  if not is_zip_file('content.zip'):
186
+ st.write("Downloaded content is not a ZIP file.")
187
  return
188
 
189
  with zipfile.ZipFile('content.zip', 'r') as zip_ref:
 
191
 
192
  extracted_files = os.listdir()
193
  if not are_files_extracted(extracted_files, missing_files):
194
+ st.write("Not all missing files were extracted.")
195
  return
196
 
197
+ st.write("content.zip downloaded and extracted successfully.")
198
  except Exception as e:
199
+ st.write(f"Error downloading or extracting content.zip: {e}")
200
  else:
201
+ st.write("All files exist.")
202
 
203
  check_and_download_files()
204