bupa1018 commited on
Commit
6d96268
·
1 Parent(s): 60cbd15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -92,13 +92,16 @@ def download_gitlab_repo():
92
 
93
 
94
  def extract_single_zip_file(directory):
95
- zip_file = [file for file in os.listdir(directory) if file.endswith('.zip')]
96
 
97
- if not zip_file:
98
  print("No zip file found in the directory.")
 
 
 
 
99
  else:
100
- zip_filename = zip_file # Get the only zip file
101
- zip_file_path = os.path.join(directory, zip_file)
102
 
103
  # Create a temporary directory for the zip file
104
  with tempfile.TemporaryDirectory() as tmpdirname:
 
92
 
93
 
94
  def extract_single_zip_file(directory):
95
+ zip_files = [file for file in os.listdir(directory) if file.endswith('.zip')]
96
 
97
+ if not zip_files:
98
  print("No zip file found in the directory.")
99
+
100
+ if len(zip_files) > 1:
101
+ print("More than one zip file found.")
102
+ return
103
  else:
104
+ zip_file_path = os.path.join(directory, zip_file[0])
 
105
 
106
  # Create a temporary directory for the zip file
107
  with tempfile.TemporaryDirectory() as tmpdirname: