27 lines
880 B
Python
27 lines
880 B
Python
import importlib.util
|
|
import glob
|
|
import os
|
|
import sys
|
|
from .lam import init, get_ext_dir
|
|
|
|
repo_dir = os.path.dirname(os.path.realpath(__file__))
|
|
sys.path.insert(0, repo_dir)
|
|
original_modules = sys.modules.copy()
|
|
|
|
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
if init():
|
|
py = get_ext_dir("py")
|
|
files = os.listdir(py)
|
|
for file in files:
|
|
if not file.endswith(".py"):
|
|
continue
|
|
name = os.path.splitext(file)[0]
|
|
imported_module = importlib.import_module(".py.{}".format(name), __name__)
|
|
NODE_CLASS_MAPPINGS = {**NODE_CLASS_MAPPINGS, **imported_module.NODE_CLASS_MAPPINGS}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {**NODE_DISPLAY_NAME_MAPPINGS, **imported_module.NODE_DISPLAY_NAME_MAPPINGS}
|
|
|
|
WEB_DIRECTORY = "./js"
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS","WEB_DIRECTORY"]
|