Update app.py
Browse files
app.py
CHANGED
@@ -1287,6 +1287,7 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1287 |
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()
|
1288 |
if "/" in target_space_name:
|
1289 |
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()
|
|
|
1290 |
|
1291 |
|
1292 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
@@ -1309,7 +1310,6 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1309 |
|
1310 |
if err_list:
|
1311 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
1312 |
-
global parsed_code_blocks_state_cache
|
1313 |
parsed_code_blocks_state_cache = []
|
1314 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1315 |
_iframe_html_update = gr.update(value=None, visible=False)
|
@@ -1321,7 +1321,6 @@ def handle_manual_duplicate_space(hf_api_key_ui, source_owner, source_space_name
|
|
1321 |
is_binary = lang == "binary" or (err_get is not None)
|
1322 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1323 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
1324 |
-
global parsed_code_blocks_state_cache
|
1325 |
parsed_code_blocks_state_cache = loaded_files
|
1326 |
|
1327 |
_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)
|
|
|
1287 |
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()
|
1288 |
if "/" in target_space_name:
|
1289 |
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()
|
1290 |
+
global parsed_code_blocks_state_cache
|
1291 |
|
1292 |
|
1293 |
source_repo_id = f"{source_owner}/{source_space_name}"
|
|
|
1310 |
|
1311 |
if err_list:
|
1312 |
reload_error = f"Error reloading file list after duplication: {err_list}"
|
|
|
1313 |
parsed_code_blocks_state_cache = []
|
1314 |
_file_browser_update = gr.update(visible=False, choices=[], value=None)
|
1315 |
_iframe_html_update = gr.update(value=None, visible=False)
|
|
|
1321 |
is_binary = lang == "binary" or (err_get is not None)
|
1322 |
code = f"[Error loading content: {err_get}]" if err_get else (content or "")
|
1323 |
loaded_files.append({"filename": file_path, "code": code, "language": lang, "is_binary": is_binary, "is_structure_block": False})
|
|
|
1324 |
parsed_code_blocks_state_cache = loaded_files
|
1325 |
|
1326 |
_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)
|