Accept workflows from the command line

This commit is contained in:
Benjamin Berman
2025-05-07 14:53:39 -07:00
parent da2cbf7c91
commit b6d3f1fb08
35 changed files with 459 additions and 319 deletions
+9 -9
View File
@@ -30,7 +30,7 @@ def _vanilla_load_importing_execute_prestartup_script(node_paths: Iterable[str])
spec.loader.exec_module(module)
return True
except Exception as e:
print(f"Failed to execute startup-script: {script_path} / {e}")
print(f"Failed to execute startup-script: {script_path} / {e}", file=sys.stderr)
return False
node_prestartup_times = []
@@ -52,14 +52,14 @@ def _vanilla_load_importing_execute_prestartup_script(node_paths: Iterable[str])
success = execute_script(script_path)
node_prestartup_times.append((time.perf_counter() - time_before, module_path, success))
if len(node_prestartup_times) > 0:
print("\nPrestartup times for custom nodes:")
print("\nPrestartup times for custom nodes:", file=sys.stderr)
for n in sorted(node_prestartup_times):
if n[2]:
import_message = ""
else:
import_message = " (PRESTARTUP FAILED)"
print("{:6.1f} seconds{}:".format(n[0], import_message), n[1])
print()
print("{:6.1f} seconds{}:".format(n[0], import_message), n[1], file=sys.stderr)
print("\n", file=sys.stderr)
@contextmanager
@@ -118,12 +118,12 @@ def _vanilla_load_custom_nodes_1(module_path, ignore=set()) -> ExportedNodes:
exported_nodes.NODE_DISPLAY_NAME_MAPPINGS.update(module.NODE_DISPLAY_NAME_MAPPINGS)
return exported_nodes
else:
print(f"Skip {module_path} module for custom nodes due to the lack of NODE_CLASS_MAPPINGS.")
print(f"Skip {module_path} module for custom nodes due to the lack of NODE_CLASS_MAPPINGS.", file=sys.stderr)
return exported_nodes
except Exception as e:
import traceback
print(traceback.format_exc())
print(f"Cannot import {module_path} module for custom nodes:", e)
print(f"Cannot import {module_path} module for custom nodes:", e, file=sys.stderr)
return exported_nodes
@@ -151,14 +151,14 @@ def _vanilla_load_custom_nodes_2(node_paths: Iterable[str]) -> ExportedNodes:
exported_nodes.update(possible_exported_nodes)
if len(node_import_times) > 0:
print("\nImport times for custom nodes:")
print("\nImport times for custom nodes:", file=sys.stderr)
for n in sorted(node_import_times):
if n[2]:
import_message = ""
else:
import_message = " (IMPORT FAILED)"
print("{:6.1f} seconds{}:".format(n[0], import_message), n[1])
print()
print("{:6.1f} seconds{}:".format(n[0], import_message), n[1], file=sys.stderr)
print("\n", file=sys.stderr)
return exported_nodes