Omnibus commited on
Commit
00407fd
·
1 Parent(s): e96fea7

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +3 -3
dl.py CHANGED
@@ -33,7 +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
- #f_ist = []
37
  if not os.path.exists(name):
38
  os.makedirs(name)
39
 
@@ -50,13 +50,13 @@ def show_f(repo,name,token):
50
  file.writelines(r.text)
51
  file.close()
52
  file_list.append(Path(f'{name}/{f_name}'))
53
- #f_ist.append(Path(f'{name}/{f_name}'))
54
  with ZipFile(f"{name}.zip", "w") as zipObj:
55
  for idx, file in enumerate(f_ist):
 
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 f_ist]), file_list)
60
 
61
  def show_all(author,token):
62
  spaces=[]
 
33
  f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space"))
34
  print (f_ist)
35
  file_list = []
36
+ f_out = []
37
  if not os.path.exists(name):
38
  os.makedirs(name)
39
 
 
50
  file.writelines(r.text)
51
  file.close()
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
+ f_out.append(Path(f'{name}/{f_name}'))
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 f_out]), file_list)
60
 
61
  def show_all(author,token):
62
  spaces=[]