@@ -24,26 +24,14 @@ def load_node_mappings(repo_path: str) -> Dict[str, Type]:
24
24
"""
25
25
init_path = os .path .join (repo_path , "__init__.py" )
26
26
27
- print (f"Debug: Loading from init_path: { init_path } " )
28
- print (f"Debug: Repository path: { repo_path } " )
29
-
30
27
if not os .path .exists (init_path ):
31
28
raise FileNotFoundError (f"Could not find __init__.py in { repo_path } " )
32
29
33
30
# Add the repo path itself to system path (not its parent)
34
31
sys .path .insert (0 , repo_path )
35
- print (f"Debug: Python path after insert: { sys .path [0 ]} " )
36
- print (f"Debug: Full sys.path: { sys .path } " )
37
-
38
32
try :
39
33
# Generate a unique module name based on the path
40
34
module_name = f"custom_nodes_{ Path (repo_path ).name } "
41
- print (f"Debug: Generated module name: { module_name } " )
42
-
43
- # List directory contents
44
- print (f"Debug: Directory contents of { repo_path } :" )
45
- for item in os .listdir (repo_path ):
46
- print (f" - { item } " )
47
35
48
36
# Load the module
49
37
spec = importlib .util .spec_from_file_location (module_name , init_path )
@@ -53,22 +41,17 @@ def load_node_mappings(repo_path: str) -> Dict[str, Type]:
53
41
module = importlib .util .module_from_spec (spec )
54
42
# Register the module in sys.modules
55
43
sys .modules [module_name ] = module
56
- print (f"Debug: Created module object: { module } " )
57
44
58
45
spec .loader .exec_module (module )
59
- print ("Debug: Successfully executed module" )
60
46
61
47
# Get NODE_CLASS_MAPPINGS
62
48
mappings = getattr (module , "NODE_CLASS_MAPPINGS" , {})
63
- print (f"Debug: Found mappings: { bool (mappings )} " )
64
49
65
50
if not mappings :
66
51
raise AttributeError ("NODE_CLASS_MAPPINGS not found in __init__.py" )
67
52
68
53
return mappings
69
54
except Exception as e :
70
- print (f"Debug: Exception occurred: { str (e )} " )
71
- print (f"Debug: Exception type: { type (e )} " )
72
55
raise
73
56
finally :
74
57
# Remove the temporary path and cleanup sys.modules
0 commit comments