Last active
October 5, 2017 20:50
-
-
Save AndresMWeber/1c8959efa5cdb480208f0b5b01574d85 to your computer and use it in GitHub Desktop.
node registration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from joint import Joint | |
from transform import Transform | |
from unicode_delegate import UnicodeDelegate | |
from dag_node import DagNode | |
from curve import Curve | |
REGISTERED_NODES = {} | |
def register_node(node_class): | |
#setattr(sys.modules[__name__], node_class.__name__, node_class) | |
REGISTERED_NODES[node_class.__name__] = node_class | |
return node_class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
class TestNodeTypes(unittest.TestCase): | |
def test_imported_nodes(self): | |
import node_types | |
for registered_node_name in REGISTERED_NODES.keys(): | |
self.assertTrue(hasattr(node_types, registered_node_name)) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment