-
g]<c       sX    d  Z   ! h  d d <d d <d d <d d <d	 d
 <d d <d d <d d <d d <Z 3 y 4 e d i d  d Z Wn 5 6 d Z n X; d k Z < d k Z = d k Z > d k Z d k Z ? d k	 Z	 @ d k
 Z
 A d k Z B d k Z C y D d k l Z Wn E F d k l Z n XK d k Z Q d f  d     YZ a g  Z b d e i d e i d f Z c x] e i Dc ]O Z d e
 i e e i  Z e e e j o
 d e j o g e i e  n qWh g  Z i xe Di ] Z j e i e i i e d   Z k e e i i e  Z l x< e Dl ]1 Z m e d  Z n e o p e i e  n qHWq e i e i i e d   Z  r e e i i e   Z! s x< e! Ds ]1 Z u e d  Z w e o x e i e  n qWqWz d  d! d" d# d$ f Z" { x! e" D{ ] Z# | e i e#  q!W d% f  d&     YZ$ d S('   s  Base class for formatting info generated by parseinfo classes.

  This class can be subclassed for easily changing the output format,
  or more drastically a new class which supports a write() method with
  the same interface can completely replace this class.

s   $RCSfile: happyformatter.py,v $s   module_namesC   $Id: happyformatter.py,v 1.5 2002/02/03 21:49:27 doughellmann Exp $s   rcs_ids    Doug Hellmann <doug@hellfly.net>s   creators   HappyDocs   projects   Thu, 09-Mar-2000 13:41:44 ESTs   createds   $Author: doughellmann $s   authors   $Revision: 1.5 $s   versions   $Date: 2002/02/03 21:49:27 $s   dates   $Locker:  $s   lockers    i   s   0.0N(   s   StringIOs   DevNullc      s   Q d  Z  V W d   Z RS(   sn   Null output class.

    This class simulates the UNIX /dev/null device file
    by discarding its inputs.
    c    s   W X Y d Sd S(   s   Value is discarded.N(    (   s   selfs   str(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   writeW s   (   s   __doc__s   write(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   DevNullQ s   	s   python%d.%di    s   site-packagess   *.pyis   *.sos   regexs   syss   threads	   threadings   news   HappyFormatterBasec      s   d  Z    e Z  d d  Z  d   Z  d   Z  e d  Z  e e d  Z  d   Z	  d   Z
  d	   Z  d
 d  Z  d   Z  d   Z  d   Z d   Z d   Z d   Z #d
 d  Z 'd   Z +d   Z /d   Z 3d   Z 7d   Z ;d   Z ?d   Z Cd   Z Gd   Z Kd   Z Od   Z Sd d d   Z bd!   Z  kd"   Z! ud#   Z" d$   Z# d%   Z$ d&   Z% e d'  Z& d(   Z' d)   Z( d*   Z) RS(+   s#   Base class for HappyDoc formatters.s%   http://www.python.org/doc/current/libc    s      | |  _  | |  _  t i t i    |  _  t |  _	  t |  _
  x@ | i   D ]/ \ } }  | i d | | |  i i f  qa W d Sd S(   s  Initialize the output formatter.

        Parameters:

            'docSet' -- documentation set controlling this formatter

            'pythonLibDoc' -- Base of URL for Python library
            documentation.  Defaults to
            'http://www.python.org/doc/current/lib'.
            
            'extraNamedParameters' -- Parameters specified by name
            which were not interpreted by a subclass initialization.

        s:   WARNING: Parameter "%s" (%s) unrecognized by formatter %s.N(   s   docSets   selfs   _docsets   pythonLibDocs   _python_lib_docs   times   ctimes   _update_times   Nones   list_contexts   current_list_contexts   extraNamedParameterss   itemss   extra_params   extra_values   statusMessages	   __class__s   __name__(   s   selfs   docSets   pythonLibDocs   extraNamedParameterss   extra_params   extra_value(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   __init__ s    'c    s!      |  i d   d Sd S(   s6   Returns a dictionary of option names and descriptions.s   supportedOptionsN(   s   selfs   _requiredOfSubclass(   s   self(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   supportedOptions s   c    s)      t  d |  |  i i   d S(   s/   Convenient way to raise a consistent exception.s%   %s is not implemented for this class.N(   s   AttributeErrors   names   selfs	   __class__s   __name__(   s   selfs   name(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   _requiredOfSubclass s   c    s!      |  i d   d Sd S(   s@   Open the named output destination and give a title and subtitle.s
   openOutputN(   s   selfs   _requiredOfSubclass(   s   selfs   names   title1s   title2(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   openOutput s   c    s!      |  i d   d Sd S(   s4   Write the title and subtitle header to an open file.s
   fileHeaderN(   s   selfs   _requiredOfSubclass(   s   selfs   title1s   title2s   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   fileHeader s   c    s!      |  i d   d Sd S(   s   Close the output handle.s   closeOutputN(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   closeOutput s   c    s!      |  i d   d Sd S(   s+   Write the file footer to the output stream.s
   fileFooterN(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   fileFooter s   c    st      t  i |  }  xK  | o) | d | d j o | d d d f j o  | d d !} q W | Sd S(   s(   Remove surrounding quotes from a string.i    is   "s   'i   N(   s   strings   strips   str(   s   selfs   str(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   _unquoteString s    6i   c    s6      |  i |  }  |  i | |   d Sd S(   s  Write the text to the output destination.

        Arguments

            'text' -- text to output

            'output' -- output file object

            'textFormat' -- String identifying the format of 'text' so
            the formatter can use a docstring converter to convert the
            body of 'text' to the appropriate output format.

            'quote=1' -- Boolean option to control whether the text
            should be quoted to escape special characters.
        N(   s   selfs   _unquoteStrings   texts   writeRaws   output(   s   selfs   texts   outputs
   textFormats   quote(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys	   writeText s   c    s!      | i |   d Sd S(   s3   Write the unaltered text to the output destination.N(   s   outputs   writes   text(   s   selfs   texts   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   writeRaw s   c    s!      |  i d   d Sd S(   s7   Format 'text' as source code and return the new string.s
   formatCodeN(   s   selfs   _requiredOfSubclass(   s   selfs   texts
   textFormat(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   formatCode s   c    s!      |  i d  d Sd S(   s5   Format 'text' as a keyword and return the new string.s   formatKeywordN(   s   selfs   _requiredOfSubclass(   s   selfs   text(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   formatKeyword s   c    se   y |  i | |  } Wn" d |  i i GH	  n X
|  i | |  d Sd S(   s6   Write the text to the output formatted as source code.s   FAILURE: %sN(	   s   selfs
   formatCodes   texts
   textFormats   formatted_texts	   __class__s   __name__s   writeRaws   output(   s   selfs   texts
   textFormats   outputs   formatted_text(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys	   writeCodes   
c    sS   g  |  i f |  _ | o |  i d |  _ n t |  _ d Sd S(   s)   Add to the list context for nested lists.i    N(   s   selfs   list_contexts   resetCurrentContexts   current_list_contexts   None(   s   selfs   resetCurrentContext(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   _pushListContexts   
c    sT   |  i d |  _ |  i o |  i d |  _ n  t |  _ !d Sd S(   s+   Remove context from the list context stack.i   i    N(   s   selfs   list_contexts   list_current_contexts   None(   s   self(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   _popListContexts   c    s   #$|  i d  %d  Sd  S(   Ns
   listHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   titles   allowMultiColumn(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   listHeader#s   c    s   '(|  i d  )d  Sd  S(   Ns   listItem(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   text(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   listItem's   c    s   +,|  i d  -d  Sd  S(   Ns
   listFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   listFooter+s   c    s   /0|  i d  1d  Sd  S(   Ns   descriptiveListHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   title(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   descriptiveListHeader/s   c    s   34|  i d  5d  Sd  S(   Ns   descriptiveListItem(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   items   description(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   descriptiveListItem3s   c    s   78|  i d  9d  Sd  S(   Ns   descriptiveListFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   descriptiveListFooter7s   c    s   ;<|  i d  =d  Sd  S(   Ns   sectionHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   title(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   sectionHeader;s   c    s   ?@|  i d  Ad  Sd  S(   Ns   sectionFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   sectionFooter?s   c    s   CD|  i d  Ed  Sd  S(   Ns
   itemHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   title(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   itemHeaderCs   c    s   GH|  i d  Id  Sd  S(   Ns
   itemFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys
   itemFooterGs   c    s   KL|  i d  Md  Sd  S(   Ns   pushSectionLevel(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   pushSectionLevelKs   c    s   OP|  i d  Qd  Sd  S(   Ns   popSectionLevel(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   popSectionLevelOs   s   -iP   c    s!   S^_|  i d  `d Sd S(   s   Output a sectional dividing line.

        Parameters:

            output -- destination for written output

            fill="-" -- character to use to draw the line

            span=80 -- horizontal width of line to draw
            
        s   dividingLineN(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   fills   span(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   dividingLineSs   c    s!   bcd|  i d  ed Sd S(   sA   Output text as a comment, if the output format supports comments.s   commentN(   s   selfs   _requiredOfSubclass(   s   selfs   texts   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   commentbs   c    s   klmt  |  t i j o nt i i | i  } nB ot  |  t i j o pt i i |  } n r| i	   } s| Sd S(   s"   Return the name for an infoSource.N(
   s   types
   infoSources   typess   FileTypes   happydoclibs   paths   basenames   names
   StringTypes   getReferenceTargetName(   s   selfs
   infoSources   name(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getNameForInfoSourceks   c    s!   u|}|  i d  ~d Sd S(   s0  
        Return the base name of the thing to which output should be written
        for an info source.  This is usually a file name, but could
        be anything understood by the formatter as a name.  If
        infoObject is None, return the name for a root node for this
        formatter.
        s   getOutputNameForObjectN(   s   selfs   _requiredOfSubclass(   s   selfs
   infoObject(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getOutputNameForObjectus   c    s   | Sd S(   sv   Tweak the filename to meet formatter-specific requirements.

        The default behavior is to return the same value.N(   s   filename(   s   selfs   filename(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   fixUpOutputFilenames   c    s!   |  i d  d Sd S(   s   
        Return the base name of the thing to which output should be
        written for a file.  This is usually a file name, but could be
        anything understood by the formatter as a name.  If infoObject
        is None, return the name for a root node for this formatter.
        s   getOutputNameForFileN(   s   selfs   _requiredOfSubclass(   s   selfs   filename(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getOutputNameForFiles   c    s!   |  i d  d Sd S(   s>   Get the full name, including path, to the object being output.s   getFullOutputNameForObjectN(   s   selfs   _requiredOfSubclass(   s   selfs
   infoObject(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getFullOutputNameForObjects   c    s!   |  i d  d Sd S(   s7  Return a reference from relativeSource to infoSource.

        Return a string containing a reference which points to the
        documentation for an object from the node located at
        relativeSource.  The relativeSource parameter is a string
        naming a node from which the reference should work.

        Parameters

          infoSource -- Documentation, target of reference.

          relativeSource -- Start point of reference

          name=None -- Name to use in the reference, if supported and
                       supplied.
          
        s   getReferenceN(   s   selfs   _requiredOfSubclass(   s   selfs
   infoSources   relativeSources   name(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getReferences   c    s!   |  i d  d Sd S(   sJ  Return a reference from relativeSource to name within infoSource.

        Return a string containing a reference which points to the
        documentation for 'name' from the node located at
        'relativeSource'.  The 'relativeSource' parameter is a string
        naming a node from which the reference should work.
        s   getNamedReferenceN(   s   selfs   _requiredOfSubclass(   s   selfs
   infoSources   names   relativeSource(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getNamedReferences   c    s!   |  i d  d Sd S(   s   Return a reference to infoSource within an open documentation node.

        Return a string containing a reference which points to the
        documentation for an object from the current node.
        s   getInternalReferenceN(   s   selfs   _requiredOfSubclass(   s   selfs
   infoSource(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getInternalReferences   c    s!   |  i d  d Sd S(   s   Return a reference pointing to Python.org.

        Return a reference to the standard documentation for a
        standard Python library module on http://www.python.org.
        s   getPythonReferenceN(   s   selfs   _requiredOfSubclass(   s   selfs
   moduleName(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   getPythonReferences   (*   s   __doc__s   _sys_moduless   sys_moduless   __init__s   supportedOptionss   _requiredOfSubclasss   Nones
   openOutputs
   fileHeaders   closeOutputs
   fileFooters   _unquoteStrings	   writeTexts   writeRaws
   formatCodes   formatKeywords	   writeCodes   _pushListContexts   _popListContexts
   listHeaders   listItems
   listFooters   descriptiveListHeaders   descriptiveListItems   descriptiveListFooters   sectionHeaders   sectionFooters
   itemHeaders
   itemFooters   pushSectionLevels   popSectionLevels   dividingLines   comments   getNameForInfoSources   getOutputNameForObjects   fixUpOutputFilenames   getOutputNameForFiles   getFullOutputNameForObjects   getReferences   getNamedReferences   getInternalReferences   getPythonReference(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   HappyFormatterBase sP   		$

			

	(%   s   __doc__s   __rcs_info__s   splits   __version__s   oss   syss   parsers   tokens   symbols   typess   strings   times   globs	   cStringIOs   StringIOs   happydoclib.paths   happydoclibs   DevNulls   _sysdirss   version_infos   version_dirs   paths   seps
   path_partss   appends   _sys_moduless   joins   module_lists   maps   basenames   module_file_namess   names   shared_lib_lists   shared_lib_file_namess   _well_known_namess   _names   HappyFormatterBase(   s   module_lists   _well_known_namess   strings   globs   symbols   parsers   HappyFormatterBases   syss   shared_lib_lists   paths   typess   _sys_moduless   shared_lib_file_namess
   path_partss   names   StringIOs   _sysdirss   _names   tokens   version_dirs   times   DevNulls   __version__s   oss   module_file_namess   happydoclibs   __rcs_info__(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happyformatter.pys   ? s`   Z	! 		
 	!
 	
!
 	

 	