Update app.py
Browse files
app.py
CHANGED
@@ -709,7 +709,6 @@ def handle_confirm_changes(hf_api_key, owner_name, space_name, changeset):
|
|
709 |
status_message = build_logic_delete_space(hf_api_key, delete_owner, delete_space)
|
710 |
final_overall_status = status_message
|
711 |
if "Successfully" in status_message:
|
712 |
-
global parsed_code_blocks_state_cache
|
713 |
parsed_code_blocks_state_cache = []
|
714 |
_formatted, _detected, _download = _generate_ui_outputs_from_cache(None, None)
|
715 |
owner_update = gr.update(value="")
|
@@ -1291,7 +1290,7 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1291 |
return "Duplicate Error: Target Owner and Target Space Name are required.", gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update()
|
1292 |
if "/" in target_space_name:
|
1293 |
return "Duplicate Error: Target Space Name should not contain '/'. Use Target Owner field for the owner part.", gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update()
|
1294 |
-
|
1295 |
|
1296 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
1297 |
target_repo_id = f"{target_owner}/{target_space_name}"
|
@@ -1313,7 +1312,6 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1313 |
|
1314 |
if err_list:
|
1315 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
1316 |
-
global parsed_code_blocks_state_cache
|
1317 |
parsed_code_blocks_state_cache = []
|
1318 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1319 |
_iframe_html_update = gr.update(value=None, visible=False)
|
@@ -1325,7 +1323,6 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1325 |
is_binary = lang == "binary" or (err_get is not None)
|
1326 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1327 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
1328 |
-
global parsed_code_blocks_state_cache
|
1329 |
parsed_code_blocks_state_cache = loaded_files
|
1330 |
|
1331 |
_file_browser_update = gr.update(visible=True, choices=sorted([f["filename"] for f in parsed_code_blocks_state_cache if not f.get("is_structure_block")] or []), value=None)
|
|
|
709 |
status_message = build_logic_delete_space(hf_api_key, delete_owner, delete_space)
|
710 |
final_overall_status = status_message
|
711 |
if "Successfully" in status_message:
|
|
|
712 |
parsed_code_blocks_state_cache = []
|
713 |
_formatted, _detected, _download = _generate_ui_outputs_from_cache(None, None)
|
714 |
owner_update = gr.update(value="")
|
|
|
1290 |
return "Duplicate Error: Target Owner and Target Space Name are required.", gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update()
|
1291 |
if "/" in target_space_name:
|
1292 |
return "Duplicate Error: Target Space Name should not contain '/'. Use Target Owner field for the owner part.", gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update(), gr.update()
|
1293 |
+
global parsed_code_blocks_state_cache
|
1294 |
|
1295 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
1296 |
target_repo_id = f"{target_owner}/{target_space_name}"
|
|
|
1312 |
|
1313 |
if err_list:
|
1314 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
|
|
1315 |
parsed_code_blocks_state_cache = []
|
1316 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1317 |
_iframe_html_update = gr.update(value=None, visible=False)
|
|
|
1323 |
is_binary = lang == "binary" or (err_get is not None)
|
1324 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1325 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
|
|
1326 |
parsed_code_blocks_state_cache = loaded_files
|
1327 |
|
1328 |
_file_browser_update = gr.update(visible=True, choices=sorted([f["filename"] for f in parsed_code_blocks_state_cache if not f.get("is_structure_block")] or []), value=None)
|