Update nodes.py
allow custom_nodes to set a styles directory for css
This commit is contained in:
parent
a667638442
commit
f23bd87e47
6
nodes.py
6
nodes.py
|
@ -1779,6 +1779,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
|||
}
|
||||
|
||||
EXTENSION_WEB_DIRS = {}
|
||||
EXTENSION_STYLE_DIRS = {}
|
||||
|
||||
def load_custom_node(module_path, ignore=set()):
|
||||
module_name = os.path.basename(module_path)
|
||||
|
@ -1797,6 +1798,11 @@ def load_custom_node(module_path, ignore=set()):
|
|||
sys.modules[module_name] = module
|
||||
module_spec.loader.exec_module(module)
|
||||
|
||||
if hasattr(module, "STYLE_DIRECTORY") and getattr(module, "STYLE_DIRECTORY") is not None:
|
||||
style_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "STYLE_DIRECTORY")))
|
||||
if os.path.isdir(style_dir):
|
||||
EXTENSION_STYLE_DIRS[module_name] = style_dir
|
||||
|
||||
if hasattr(module, "WEB_DIRECTORY") and getattr(module, "WEB_DIRECTORY") is not None:
|
||||
web_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "WEB_DIRECTORY")))
|
||||
if os.path.isdir(web_dir):
|
||||
|
|
Loading…
Reference in New Issue