Update app.py
Browse files
app.py
CHANGED
@@ -1283,7 +1283,7 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1283 |
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()
|
1284 |
if "/" in target_space_name:
|
1285 |
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()
|
1286 |
-
|
1287 |
|
1288 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
1289 |
target_repo_id = f"{target_owner}/{target_space_name}"
|
@@ -1306,7 +1306,7 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1306 |
|
1307 |
if err_list:
|
1308 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
1309 |
-
|
1310 |
parsed_code_blocks_state_cache = []
|
1311 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1312 |
_iframe_html_update = gr.update(value=None, visible=False)
|
@@ -1318,7 +1318,6 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1318 |
is_binary = lang == "binary" or (err_get is not None)
|
1319 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1320 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
1321 |
-
global parsed_code_blocks_state_cache
|
1322 |
parsed_code_blocks_state_cache = loaded_files
|
1323 |
|
1324 |
_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)
|
|
|
1283 |
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()
|
1284 |
if "/" in target_space_name:
|
1285 |
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()
|
1286 |
+
global parsed_code_blocks_state_cache
|
1287 |
|
1288 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
1289 |
target_repo_id = f"{target_owner}/{target_space_name}"
|
|
|
1306 |
|
1307 |
if err_list:
|
1308 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
1309 |
+
|
1310 |
parsed_code_blocks_state_cache = []
|
1311 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1312 |
_iframe_html_update = gr.update(value=None, visible=False)
|
|
|
1318 |
is_binary = lang == "binary" or (err_get is not None)
|
1319 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1320 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
|
|
1321 |
parsed_code_blocks_state_cache = loaded_files
|
1322 |
|
1323 |
_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)
|