Skip to content
Snippets Groups Projects
Node.py 499 B
Newer Older
  • Learn to ignore specific revisions
  • Lukas Kettenbach's avatar
    Lukas Kettenbach committed
    import abc
    
    
    class Node(object):
        __metaclass__ = abc.ABCMeta
    
        name = "UninitializedName"
    
        def __init__(self, node_name):
            self.name = node_name
    
        @abc.abstractmethod
        def announce_parent(self, node):
            """This method will be called by the graph-management to inform nodes
            which just became children of other nodes, so they can adapt themselves
            (e.g. their cpt)"""
            return
    
        def __str__(self):
            print self.name
            return self.name