Table of Contents

HappyDoc Source Documentation: happydoclib.parseinfo  

Extract information from a Python code parse tree.

This module is based on the Demos/parser/example.py module distributed with the Python source distribution.

File-specific Parser Configuration Values

Parameters to the HappyDoc Parser can also be embedded within the first comment block of the module. The parameter values recognized and their meanings are listed below.

To provide file-specific parser configuration settings, any Python code can be embedded in the comments of the file. For example:

      #!/usr/bin/env python
      #
      # HappyDoc:# These variables should be discovered.
      # HappyDoc:TestInt=1
      # HappyDoc:TestString="String"
      # HappyDoc:TestStringModule=string.strip(' this has spaces in front and back ')
      # HappyDoc:url=urlencode({'a':'A', 'b':'B'})
      # HappyDoc:docStringFormat='StructuredText'

All lines beginning with the pattern "'# HappyDoc:'" will be concatenated (separated by newlines) and execed. The local namespace resulting from the execution of the code will be examined for variables of interest to the parser. The incoming global namespace for the configuration code will have a few pre-populated names for convenience.

Pre-defined Globals

Name

Description

string

The string module.

urlquote

Same as urllib.quote function.

urlencode

Same as urllib.urlencode function.

Recognized Parser Configuration Variables

Parameter

Description

docStringFormat

The name of the format for the __doc__ strings in the module. This value is used to determine the docstring converter which will know how to translate the docstrings in the module.

Modules and Packages   

HappyDoc-r2_1/happydoclib/parseinfo/

parseinfo

Extract information from a Python code parse tree.

classinfo

Gather information about a Python class from its parse tree.

functioninfo

Gather information about a function or method definition.

imports

Collects info about imports for a module.

moduleinfo

Information gatherer for source code modules.

suite

Base class for information gathering classes.

utils

Utility functions for parseinfo package.


Table of Contents

This document was automatically generated on Sat Aug 24 16:57:40 2002 by HappyDoc version 2.1