Module Expr Str ImportFrom alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr BinOpAdd Call NameLoad ListComp Call AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Num orelse Assign AttributeStore NameLoad attr Num Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad NameLoad decorator_list Assign NameStore ListLoad Expr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr ListLoad ListLoad If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr ListLoad NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body TryExcept body Assign NameStore AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr handlers ExceptHandler type NameLoad body Raise NameLoad BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse If NameLoad body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd NameLoad Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr While CompareLtE Call NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A This module generates the class hierarchy for any given Python
modules.  This can be used (among other things) to generate the
traitified VTK classes in the correct order.

 __future__ division N/A __builtin__ TreeNode N/A object N/A N/A Represents a node in the class tree.

    Stores information on the sub and super classes of a particular
    class.  It also stores the inheritance level of the class inside
    the inheritance tree (essentially how many levels of inheritance
    are there below this class).  This inheritance level is computed
    when the `get_level` method is called.  The `get_level` method
    works only when the parent information is complete.
    
     __init__ N/A N/A self klass N/A N/A N/A Given a class, create a node in the tree.

        Parameters
        ----------
        - klass : `class`

          The class which is represented as a node in the tree.

         N/A N/A self klass klass N/A N/A self name N/A klass __name__ N/A N/A self children N/A N/A N/A self parents N/A N/A N/A self level None N/A add_parent N/A N/A self parent N/A N/A N/A Add a parent node. N/A N/A isinstance parent TreeNode N/A N/A parent N/A self parents N/A N/A N/A N/A N/A self parents append parent N/A add_child N/A N/A self child N/A N/A N/A Add a child node.  N/A N/A isinstance child TreeNode N/A N/A child N/A self children N/A N/A N/A N/A N/A self children append child N/A get_level N/A N/A self N/A N/A N/A Returns the inheritance level of the node (an int).  If the
        level has not been set, the method computes it.  Note however,
        that this computation will fail if the parent information is
        incorrect.

         N/A N/A N/A self level N/A N/A N/A self parents N/A N/A N/A self level N/A N/A max N/A N/A N/A x get_level N/A x N/A self parents 1 N/A N/A N/A self level 0 N/A N/A self level N/A get_ancestors N/A N/A self N/A N/A N/A Returns a list of ancestor nodes from which this class has
        descended.

         _get_ancestors N/A N/A node ancestors N/A N/A N/A N/A N/A ancestors extend N/A node parents N/A p N/A node parents N/A N/A N/A _get_ancestors p ancestors N/A N/A ancestors N/A N/A N/A _get_ancestors self ancestors N/A ancestors N/A N/A ClassTree N/A object N/A N/A Contains and generates all the class tree information.

    On initialization of the instance, nothing is done.  The classes
    are obtained using the list of modules (or a single module) that
    is used to initialize the instance.  One must then call the
    `create` method to generate the tree structure.  The instance of
    the class also can be treated as an iterator which iterates over
    the nodes of the tree.

    There are two ways in which the tree hierarchy is stored.  A
    dictionary mapping class names to the tree node and a tree
    represented as a list of lists containing the nodes.  The tree is
    organized based on a concept of an inheritance level.  A class
    that has no parent classes (no base classes) is said to be at
    level zero.  If a class inherits successively from 7 classes, it
    is at level 6.  An example of inheritance for a vtkFoo class is
    given below:

      vtkFoo -> vtkBar -> vtkObject -> vtkObjectBase

    Here, vtkObjectBase has an inheritance level of 0 and vtkFoo a
    level of 3.  One can traverse the tree by using the level as an
    index and find all the classes at a particular level.

    Here is some example usage of this class::

        >>> import vtk
        >>> t = ClassTree(vtk)
        >>> t.create()
        >>> print t.get_node('vtkObject').name
        vtkObject
        >>> print t.get_node('vtkObject').parents[0].name
        vtkObjectBase
        >>> print len(t.tree[0])
        1
        >>> t.tree[0][0].name
        vtkObjectBase
    
     __init__ N/A N/A self modules N/A N/A N/A Initialize the instance with the given modules.

        Parameters
        ----------

        - modules : `sequence` of modules or a module

          This is either a single module or a sequence of modules.
          The instance uses these list of modules to generate the
          class tree.
          
         N/A N/A self nodes N/A N/A N/A self tree N/A N/A N/A N/A N/A hasattr modules __iter__ N/A N/A N/A self modules N/A modules N/A N/A N/A self modules modules N/A __iter__ N/A N/A self N/A N/A N/A N/A iter N/A N/A N/A self nodes values N/A _generate_hierarchy N/A N/A self klass N/A N/A N/A Does the hard work of generating the class hierarchy. N/A node N/A N/A self get_node N/A klass __name__ create 1 N/A base N/A klass __bases__ N/A N/A base_node N/A N/A self get_node_from_class base create 1 N/A N/A N/A node add_parent base_node N/A N/A N/A base_node add_child node N/A N/A N/A self _generate_hierarchy base N/A get_class N/A N/A self name N/A N/A N/A Given a class name in the given modules returns the class. N/A klass None N/A m N/A self modules N/A N/A N/A hasattr m name N/A N/A N/A getattr m name N/A N/A hasattr __builtin__ name N/A N/A klass N/A getattr __builtin__ name N/A N/A klass N/A N/A N/A N/A klass N/A N/A N/A self nodes N/A name klass N/A N/A N/A KeyError N/A N/A KeyError N/A Cannot find class of name %s name N/A klass N/A add_node N/A N/A self klass N/A N/A N/A Create a node for the given class. N/A name N/A klass __name__ N/A N/A N/A N/A N/A self nodes has_key name N/A N/A node N/A TreeNode klass N/A N/A N/A self nodes N/A name node N/A node N/A get_node N/A N/A self name create N/A 0 N/A N/A Get a node of the given name.

        Parameters
        ----------

        - name : `str`

          Name of the node to get.

        - create : `boolean`

          If True, a new node will be added if no node of the given
          name is available.  Defaults to False.

        Returns
        -------

        - `TreeNode`

         N/A N/A N/A N/A self nodes has_key name N/A N/A N/A N/A self nodes N/A name N/A N/A create N/A N/A N/A N/A self add_node N/A N/A self get_class name N/A get_node_from_class N/A N/A self cls create N/A 0 N/A N/A Get a node of the given class.

        Parameters
        ----------

        - cls : `class`

          Class of the node to get.

        - create : `boolean`

          If True, a new node will be added if no node of the given
          name is available.  Defaults to False.

        Returns
        -------

        - `TreeNode`

         N/A name N/A cls __name__ N/A N/A N/A N/A self nodes has_key name N/A N/A N/A N/A self nodes N/A name N/A N/A create N/A N/A N/A N/A self add_node cls N/A create N/A N/A self class_names N/A None N/A N/A This method generates the class tree given an optional list
        of class names.

        Parameters
        ----------

        - class_names - `list` of `str`

          An optional list of names of the classes to generate the
          tree for.  Defaults to None where the class list is computed
          from the modules.        

         N/A N/A class_names None N/A N/A class_names N/A N/A m N/A self modules N/A N/A N/A N/A class_names extend N/A dir m N/A name class_names N/A N/A klass N/A N/A self get_class name N/A N/A klass N/A hasattr klass __bases__ N/A N/A N/A N/A self _generate_hierarchy klass N/A node self N/A N/A d N/A N/A node get_level N/A N/A N/A len N/A self tree d N/A N/A N/A N/A N/A self tree append N/A N/A N/A N/A N/A N/A self tree N/A d append node _comp N/A N/A x y N/A N/A N/A N/A cmp N/A x name N/A y name N/A N/A nodes N/A self tree N/A N/A N/A N/A nodes sort _comp N/A N/A