Spaces:
Paused
Paused
Update dl.py
Browse files
dl.py
CHANGED
|
@@ -33,6 +33,7 @@ def show_f(repo,name,token):
|
|
| 33 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
| 34 |
print (f_ist)
|
| 35 |
file_list = []
|
|
|
|
| 36 |
if not os.path.exists(name):
|
| 37 |
os.makedirs(name)
|
| 38 |
|
|
@@ -51,10 +52,11 @@ def show_f(repo,name,token):
|
|
| 51 |
file_list.append(Path(f'{name}/{f_name}'))
|
| 52 |
with ZipFile(f"{name}.zip", "w") as zipObj:
|
| 53 |
for idx, file in enumerate(f_ist):
|
|
|
|
| 54 |
zipObj.write(f'{name}/{file}')
|
| 55 |
file_list.append(f'{name}.zip')
|
| 56 |
|
| 57 |
-
return(gr.Dropdown.update(label="Files", choices=[f for f in
|
| 58 |
|
| 59 |
def show_all(author,token):
|
| 60 |
spaces=[]
|
|
|
|
| 33 |
f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
|
| 34 |
print (f_ist)
|
| 35 |
file_list = []
|
| 36 |
+
file_out = []
|
| 37 |
if not os.path.exists(name):
|
| 38 |
os.makedirs(name)
|
| 39 |
|
|
|
|
| 52 |
file_list.append(Path(f'{name}/{f_name}'))
|
| 53 |
with ZipFile(f"{name}.zip", "w") as zipObj:
|
| 54 |
for idx, file in enumerate(f_ist):
|
| 55 |
+
file_out.append(file)
|
| 56 |
zipObj.write(f'{name}/{file}')
|
| 57 |
file_list.append(f'{name}.zip')
|
| 58 |
|
| 59 |
+
return(gr.Dropdown.update(label="Files", choices=[f for f in file_out]), file_list)
|
| 60 |
|
| 61 |
def show_all(author,token):
|
| 62 |
spaces=[]
|