Table of Contents

Class: ClassInfo HappyDoc-r0_7_1/parseinfo.py

Gather information about a Python class from its parse tree.

Base Classes   
SuiteInfoBase
Methods   
__init__
_extractBaseClasses
_extractClassMembers
getBaseClassNames
getExceptionNames
getMethodInfo
getMethodNames
  __init__ 
__init__ (
        self,
        parent=None,
        tree=None,
        commentInfo={},
        )

Initialize the info extractor.

Parameters:

parent

parent object for this class (e.g. Module)

tree

parse tree from which to extract information

commentInfo

comments extracted from the source file for this class

  _extractBaseClasses 
_extractBaseClasses ( self,  tree )

Returns a list of all base classes from which this class is derived.

print pprint.pprint(tree) pprint.pprint(subtree) pprint.pprint(vars) base_class_names.append(vars['name'])

  _extractClassMembers 
_extractClassMembers ( self,  tree )

Returns a list of all variable assignments in the class member context.

print 'CLASS_MEMBER_STMT_PATTERN: ', pprint.pprint(CLASS_MEMBER_STMT_PATTERN) print print 'TREE: ', pprint.pprint(tree) print

Find the suite defining the class

print 'SUBTREE: ', pprint.pprint(subtree) print

  getBaseClassNames 
getBaseClassNames ( self )

Returns a list of the names of the base classes for this class.

  getExceptionNames 
getExceptionNames ( self )

Returns a list of the names of all exceptions raised by this class.

  getMethodInfo 
getMethodInfo ( self,  name )

Returns a FunctionInfo object for the method name, if it exists.

  getMethodNames 
getMethodNames ( self )

Returns a list of the names of methods defined for this class.


Table of Contents

This document was automatically generated on Sat Sep 9 20:27:32 2000 by HappyDoc version r0_7_1