forked from get-salt-AI/SaltAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
36 lines (28 loc) · 1005 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import folder_paths
from SaltAI.modules.node_importer import ModuleLoader
ROOT = os.path.abspath(os.path.dirname(__file__))
NAME = "Salt.AI"
PACKAGE = "SaltAI"
NODES_DIR = os.path.join(ROOT, 'nodes')
EXTENSION_WEB_DIRS = {}
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
# Load modules
module_timings = {}
module_loader = ModuleLoader(PACKAGE)
module_loader.load_modules(NODES_DIR)
# Mappings
# EXTENSION_WEB_DIRS = module_loader.EXTENSION_WEB_DIRS # Whenever this is a thing
NODE_CLASS_MAPPINGS = module_loader.NODE_CLASS_MAPPINGS
NODE_DISPLAY_NAME_MAPPINGS = module_loader.NODE_DISPLAY_NAME_MAPPINGS
# Timings and such
module_loader.report(NAME)
# Add .results format
folder_paths.supported_pt_extensions.add('.results')
if '.results' in folder_paths.supported_pt_extensions:
print("\nAdded LoRa extension format: .results")
else:
print("\nUnable to add LoRa extension format: .results")
# Export nodes
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']