bupa1018 commited on
Commit
59d802c
·
1 Parent(s): 8c87ee7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -120,7 +120,7 @@ def get_file(temp_dir, file_path):
120
 
121
 
122
 
123
- def process_directory(directory):
124
  code_partial_paths = ['kadi_apy/lib/resources/']
125
 
126
 
@@ -128,6 +128,18 @@ def process_directory(directory):
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
133
  # with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
 
120
 
121
 
122
 
123
+ def process_directory5(directory):
124
  code_partial_paths = ['kadi_apy/lib/resources/']
125
 
126
 
 
128
 
129
  # zip_file_path = os.listdir(directory) if file.endswith('.zip')
130
  print(zip_file_path)
131
+
132
+
133
+ with tempfile.TemporaryDirectory() as tmpdirname:
134
+ # Unzip the file into the temporary directory
135
+ with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
136
+ zip_ref.extractall(tmpdirname)
137
+
138
+ files = []
139
+ print("tmpdirname: " , tmpdirname)
140
+ unzipped_root = os.listdir(tmpdirname)
141
+ print("unzipped_root ", unzipped_root)
142
+
143
  # with tempfile.TemporaryDirectory() as tmpdirname:
144
  # Unzip the file into the temporary directory
145
  # with zipfile.ZipFile(zip_file_path, 'r') as zip_ref: