Spaces:
Running
Running
Update dl.py
Browse files
dl.py
CHANGED
@@ -97,6 +97,7 @@ def show_all(author,token):
|
|
97 |
pass
|
98 |
|
99 |
file_list.append(f'{space_ea}.zip')
|
|
|
100 |
with ZipFile(f"{author}.zip", "w") as zipObj:
|
101 |
for idx, file in enumerate(file_list):
|
102 |
try:
|
@@ -104,7 +105,7 @@ def show_all(author,token):
|
|
104 |
except Exception:
|
105 |
pass
|
106 |
file_list.append(f'{author}.zip')
|
107 |
-
|
108 |
|
109 |
def show_all_z(author,token):
|
110 |
spaces=[]
|
@@ -158,7 +159,10 @@ with gr.Blocks() as build:
|
|
158 |
with gr.Row():
|
159 |
s_btn = gr.Button("Show")
|
160 |
l_btn = gr.Button("Load")
|
161 |
-
|
|
|
|
|
|
|
162 |
gr.Column(scale=1)
|
163 |
files=gr.File(file_count="directory")
|
164 |
with gr.Row():
|
@@ -166,7 +170,8 @@ with gr.Blocks() as build:
|
|
166 |
m_t=gr.Textbox(max_lines=100)
|
167 |
uu=gr.Textbox(visible=False)
|
168 |
|
169 |
-
|
|
|
170 |
|
171 |
s_btn.click(show_s,[r_name,token],s_name)
|
172 |
s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|
|
|
97 |
pass
|
98 |
|
99 |
file_list.append(f'{space_ea}.zip')
|
100 |
+
yield file_list
|
101 |
with ZipFile(f"{author}.zip", "w") as zipObj:
|
102 |
for idx, file in enumerate(file_list):
|
103 |
try:
|
|
|
105 |
except Exception:
|
106 |
pass
|
107 |
file_list.append(f'{author}.zip')
|
108 |
+
yield file_list
|
109 |
|
110 |
def show_all_z(author,token):
|
111 |
spaces=[]
|
|
|
159 |
with gr.Row():
|
160 |
s_btn = gr.Button("Show")
|
161 |
l_btn = gr.Button("Load")
|
162 |
+
with gr.Column():
|
163 |
+
show_all_btn1 = gr.Button("Load All 1")
|
164 |
+
show_all_btn2 = gr.Button("Load All 2")
|
165 |
+
|
166 |
gr.Column(scale=1)
|
167 |
files=gr.File(file_count="directory")
|
168 |
with gr.Row():
|
|
|
170 |
m_t=gr.Textbox(max_lines=100)
|
171 |
uu=gr.Textbox(visible=False)
|
172 |
|
173 |
+
show_all_btn1.click(show_all,[r_name,token],files)
|
174 |
+
show_all_btn2.click(show_all_z,[r_name,token],files)
|
175 |
|
176 |
s_btn.click(show_s,[r_name,token],s_name)
|
177 |
s_name.change(show_f,[r_name,s_name,token],[d_app,files])
|