Files
RyanOnTheInside 29688cc021 Version 2
Sweeping update. New features, more maintainable.
See readme and comments for more info.
2025-01-22 11:11:19 -05:00

21 lines
636 B
Python

NODE_CONFIGS = {}
#NOTE: THIS IS LEGACY FOR BACKWARD COMPATIBILITY. REPLACED BY TOOLTIPS.
# this abstraction allows for the documentation to be both centrally managed and inherited
from abc import ABCMeta
class NodeConfigMeta(type):
def __new__(cls, name, bases, attrs):
new_class = super().__new__(cls, name, bases, attrs)
if name in NODE_CONFIGS:
for key, value in NODE_CONFIGS[name].items():
setattr(new_class, key, value)
return new_class
class CombinedMeta(NodeConfigMeta, ABCMeta):
pass
def add_node_config(node_name, config):
NODE_CONFIGS[node_name] = config