(self, callback, start_node=None)
Traversal the tree, this method will call the
      user-defined callback function for each node on the tree

      :param callback: a function
      :param start_node: the start node to begin the traversal
Traversal the tree, this method will call the
      user-defined callback function for each node on the tree
Traversal the tree this method will call the user - defined callback function for each node on the tree
def traversal(self, callback, start_node=None):
      """ Traversal the tree, this method will call the
      user-defined callback function for each node on the tree

      :param callback: a function
      :param start_node: the start node to begin the traversal
      """
      if not inspect.isfunction(callback):
         Util.raiseException("The callback for the tree traversal must be a function", TypeError)

      if start_node is None:
         start_node = self.getRoot()
         callback(start_node)
      for child_node in start_node.getChilds():
         callback(child_node)
         self.traversal(callback, child_node)
def traversal ( self , callback , start_node = None ) : if not inspect . isfunction ( callback ) : Util . raiseException ( "The callback for the tree traversal must be a function" , TypeError ) if start_node is None : start_node = self . getRoot ( ) callback ( start_node ) for child_node in start_node . getChilds ( ) : callback ( child_node ) self . traversal ( callback , child_node )