2012-03-02 02:55:32 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2013-12-23 15:01:20 +00:00
|
|
|
from ...pgcollections import OrderedDict
|
2012-03-02 02:55:32 +00:00
|
|
|
import os, types
|
2013-12-23 15:01:20 +00:00
|
|
|
from ...debug import printExc
|
2013-12-16 04:50:11 +00:00
|
|
|
from ..NodeLibrary import NodeLibrary, isNodeClass
|
2013-12-23 15:01:20 +00:00
|
|
|
from ... import reload as reload
|
2012-03-02 02:55:32 +00:00
|
|
|
|
|
|
|
|
2013-12-16 04:50:11 +00:00
|
|
|
# Build default library
|
|
|
|
LIBRARY = NodeLibrary()
|
2012-03-02 02:55:32 +00:00
|
|
|
|
2013-12-16 04:50:11 +00:00
|
|
|
# For backward compatibility, expose the default library's properties here:
|
|
|
|
NODE_LIST = LIBRARY.nodeList
|
|
|
|
NODE_TREE = LIBRARY.nodeTree
|
|
|
|
registerNodeType = LIBRARY.addNodeType
|
|
|
|
getNodeTree = LIBRARY.getNodeTree
|
|
|
|
getNodeType = LIBRARY.getNodeType
|
2012-03-02 02:55:32 +00:00
|
|
|
|
2013-12-16 04:50:11 +00:00
|
|
|
# Add all nodes to the default library
|
2013-12-22 04:41:37 +00:00
|
|
|
from . import Data, Display, Filters, Operators
|
|
|
|
for mod in [Data, Display, Filters, Operators]:
|
2013-12-16 04:50:11 +00:00
|
|
|
nodes = [getattr(mod, name) for name in dir(mod) if isNodeClass(getattr(mod, name))]
|
|
|
|
for node in nodes:
|
2013-12-22 04:41:37 +00:00
|
|
|
LIBRARY.addNodeType(node, [(mod.__name__.split('.')[-1],)])
|
2013-12-16 04:50:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|