From 9503c34d5b37b9c9e3d9d2a456052c0731660ba0 Mon Sep 17 00:00:00 2001 From: huchenlei Date: Fri, 20 Dec 2024 15:21:52 -0800 Subject: [PATCH] Mark usages: --- glob/manager_core.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glob/manager_core.py b/glob/manager_core.py index 99410e2c..b51382fb 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -806,6 +806,7 @@ class UnifiedManager: zip_url = node_info.download_url from_path = self.active_nodes[node_id][1] + # PTAL(@ltdrdata): how to redesign and drop version_spec here? target = f"{node_id}@{version_spec.replace('.', '_')}" to_path = os.path.join(get_default_custom_nodes_path(), target) @@ -873,6 +874,7 @@ class UnifiedManager: os.rmdir(x) # 5. rename dir name @ ==> @ + # PTAL(@ltdrdata): how to redesign and drop version_spec here new_install_path = os.path.join(get_default_custom_nodes_path(), f"{node_id}@{version_spec.replace('.', '_')}") print(f"'{install_path}' is moved to '{new_install_path}'") shutil.move(install_path, new_install_path) @@ -954,6 +956,7 @@ class UnifiedManager: from_path = cnr_info[version_spec] base_path = extract_base_custom_nodes_dir(from_path) + # PTAL(@ltdrdata): how to redesign and drop version_spec here to_path = os.path.join(base_path, f"{node_id}@{version_spec.replace('.', '_')}") if from_path is None or not os.path.exists(from_path): @@ -1015,6 +1018,7 @@ class UnifiedManager: return result.fail(f'Specified active node not exists: {node_id}') base_path = extract_base_custom_nodes_dir(ver_and_path[1]) + # PTAL(@ltdrdata): how to redesign and drop version_spec here to_path = os.path.join(base_path, '.disabled', f"{node_id}@{ver_and_path[0].replace('.', '_')}") shutil.move(ver_and_path[1], to_path) result.append((ver_and_path[1], to_path)) @@ -1105,6 +1109,7 @@ class UnifiedManager: os.remove(download_path) # install_path + # PTAL(@ltdrdata): how to redesign and drop version_spec here install_path = os.path.join(get_default_custom_nodes_path(), f"{node_id}@{version_spec.replace('.', '_')}") if os.path.exists(install_path): return result.fail(f'Install path already exists: {install_path}') @@ -1291,6 +1296,7 @@ class UnifiedManager: if version_spec == 'unknown': to_path = os.path.abspath(os.path.join(get_default_custom_nodes_path(), node_id)) # don't attach @unknown else: + # PTAL(@ltdrdata): how to redesign and drop version_spec here to_path = os.path.abspath(os.path.join(get_default_custom_nodes_path(), f"{node_id}@{version_spec.replace('.', '_')}")) res = self.repo_install(repo_url, to_path, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall) if res.result: