Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,7 +147,19 @@ def rem_save(space,save_state):
|
|
147 |
if not space == ea:
|
148 |
save_out.append(space)
|
149 |
return save_out, gr.update(choices=[f for f in save_out],interactive=True),save_out
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
with gr.Blocks(css=css) as build:
|
152 |
save_state=gr.State()
|
153 |
space_list=gr.State()
|
@@ -201,16 +213,7 @@ with gr.Blocks(css=css) as build:
|
|
201 |
com_on = gr.Button("Turn ON Commenting")
|
202 |
|
203 |
|
204 |
-
|
205 |
-
api = HfApi(token=token)
|
206 |
-
for ea in check_list:
|
207 |
-
|
208 |
-
api.change_discussion_status(
|
209 |
-
repo_id=f'{r_name}/{ea}'
|
210 |
-
new_status='closed',
|
211 |
-
token=token,
|
212 |
-
repo_type='space',
|
213 |
-
)
|
214 |
|
215 |
|
216 |
com_off.click(toggle_comments_off, [r_name,check_list,token])
|
|
|
147 |
if not space == ea:
|
148 |
save_out.append(space)
|
149 |
return save_out, gr.update(choices=[f for f in save_out],interactive=True),save_out
|
150 |
+
|
151 |
+
|
152 |
+
def toggle_comments_off(r_name,check_list,token):
|
153 |
+
api = HfApi(token=token)
|
154 |
+
for ea in check_list:
|
155 |
+
|
156 |
+
api.change_discussion_status(
|
157 |
+
repo_id=f'{r_name}/{ea}',
|
158 |
+
new_status='closed',
|
159 |
+
token=token,
|
160 |
+
repo_type='space',
|
161 |
+
)
|
162 |
+
|
163 |
with gr.Blocks(css=css) as build:
|
164 |
save_state=gr.State()
|
165 |
space_list=gr.State()
|
|
|
213 |
com_on = gr.Button("Turn ON Commenting")
|
214 |
|
215 |
|
216 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
|
219 |
com_off.click(toggle_comments_off, [r_name,check_list,token])
|