Table of Contents

Class: SuiteInfoBase HappyDoc-r0_7_1/parseinfo.py

Base class for information gathering classes.

Default implementation assumes that the user is interested in learning about functions and classes defined within the parse tree used for initialization. This makes implementation of MethodInfo easy. Other derived classes add behavior to find other information.

Methods   
__getitem__
__init__
_extractInfo
_extractSummary
getClassInfo
getClassNames
getDocString
getFullyQualifiedName
getName
getQualifiedName
getSummary
  __getitem__ 
__getitem__ ( self,  itemName )

Exceptions   
KeyError( 'Unrecognized name: "%s"' % itemName, itemName )

  __init__ 
__init__ (
        self,
        name='',
        parent=None,
        tree=None,
        commentInfo={},
        )

Initialize the info extractor.

Parameters:

name

name of this object

parent

parent object (e.g. Module for Class)

tree

parse tree from which to extract information

commentInfo

comments extracted from source file where this object was found

  _extractInfo 
_extractInfo ( self,  tree )

Pull information out of the parse tree.

extract docstring discover inner definitions pprint.pprint(cstmt)

  _extractSummary 
_extractSummary ( self,  text )

Extract a summary text from a larger body.

  getClassInfo 
getClassInfo ( self,  name )

Return a ClassInfo object for the class by name.

  getClassNames 
getClassNames ( self )

Return the names of classes defined within the module.

  getDocString 
getDocString ( self )

Return any __doc__ string value found for the object.

print 'DOC STRING for %s is ' % self._name, dstring

  getFullyQualifiedName 
getFullyQualifiedName ( self )

Return a complete, unique, name representing this object.

print %s (%s) has a parent % (self.getName(), self.__class__.__name__) print parent=, self._parent.getFullyQualifiedName()

  getName 
getName ( self )

Return the name of the object.

  getQualifiedName 
getQualifiedName ( self,  transTable=string.maketrans( '/', '_' ) )

print getQualifiedName(%s) % self.getName() name = string.translate(name, transTable)

  getSummary 
getSummary ( self )

Return a summary of the __doc__ string for this object.


Table of Contents

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