(node_id=None, node_str=None)
return node_id
Adds a new node type to the list of custom node types and returns the ID.
Adds a new node type to the list of custom node types and returns the ID.
Adds a new node type to the list of custom node types and returns the ID .
def new_node_type(node_id=None, node_str=None):
    """Adds a new node type to the list of custom node types and returns the ID."""
    if node_id is None:
        if len(CUSTOM_NODE_TYPES) == 0:
            node_id = ALL_TYPES[-1] + 1
        else:
            node_id = CUSTOM_NODE_TYPES[-1] + 1

    assert node_id not in ALL_TYPES
    assert node_id not in CUSTOM_NODE_TYPES
    CUSTOM_NODE_TYPES.append(node_id)
    if node_str is None:
        node_str = "Node_%d" % node_id
    __OP_STR__[node_id] = node_str
    return node_id
def new_node_type ( node_id = None , node_str = None ) : if node_id is None : if len ( CUSTOM_NODE_TYPES ) == 0 : node_id = ALL_TYPES [ - 1 ] + 1 else : node_id = CUSTOM_NODE_TYPES [ - 1 ] + 1 assert node_id not in ALL_TYPES assert node_id not in CUSTOM_NODE_TYPES CUSTOM_NODE_TYPES . append ( node_id ) if node_str is None : node_str = "Node_%d" % node_id __OP_STR__ [ node_id ] = node_str return node_id