just saw your project on reddit. looks really nice. i needed to make a
similar
framework which involved nodes and connecting them. i found this
little trick
to register nodes. maybe you can use it in your project.
cheers gregor
class Node(object):
pass
class Mix(Node):
pass
class Simplex(Node):
pass
def node_registry():
nodes = {}
for n in Node.__subclasses__():
nodes[n.__name__] = n
return nodes
if __name__ == "__main__":
print node_registry()
That's a nice idea, I'll probably use it, thanks! :)