From f199d0e893e5a2d016a59f61e3ce8deaca147512 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Sat, 28 Dec 2024 12:07:06 -0800 Subject: [PATCH] Fix web directory. --- hooks/post_gen_project.py | 2 +- {{cookiecutter.project_name}}/__init__.py | 4 ++-- .../src/{{cookiecutter.project_slug}}/nodes.py | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 0617bb6..4007b8a 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -28,7 +28,7 @@ def init_git(): Pth("LICENSE").unlink() if "{{cookiecutter.__include_web}}" == "False": - shutil.rmtree("src/{{cookiecutter.project_slug}}/web") + shutil.rmtree("web") if init_git(): print("✓ Git repository initialized and remote configured") diff --git a/{{cookiecutter.project_name}}/__init__.py b/{{cookiecutter.project_name}}/__init__.py index 3592fee..8f11523 100644 --- a/{{cookiecutter.project_name}}/__init__.py +++ b/{{cookiecutter.project_name}}/__init__.py @@ -12,8 +12,8 @@ __email__ = "{{cookiecutter.email}}" __version__ = "{{cookiecutter.version}}" -from .src.nodes import NODE_CLASS_MAPPINGS -from .src.nodes import NODE_DISPLAY_NAME_MAPPINGS +from .src.{{cookiecutter.project_slug}}.nodes import NODE_CLASS_MAPPINGS +from .src.{{cookiecutter.project_slug}}.nodes import NODE_DISPLAY_NAME_MAPPINGS {% if cookiecutter.__include_web -%} WEB_DIRECTORY = "./web" diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.project_slug}}/nodes.py b/{{cookiecutter.project_name}}/src/{{cookiecutter.project_slug}}/nodes.py index 17b120a..427d9c0 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.project_slug}}/nodes.py +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.project_slug}}/nodes.py @@ -103,8 +103,6 @@ def test(self, image, string_field, int_field, float_field, print_to_screen): #def IS_CHANGED(s, image, string_field, int_field, float_field, print_to_screen): # return "" -# Set the web directory, any .js file in that directory will be loaded by the frontend as a frontend extension -# WEB_DIRECTORY = "./somejs" # A dictionary that contains all nodes you want to export with their names # NOTE: names should be globally unique