*
;c       sa    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 rO 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 rZ j e i e i i e d   Z k e e i i e  Z l x? e d l r2 Z m e d  Z n e o p e i e  n qNWq e i e i i e d   Z  r e e i i e   Z! s x? e! d s r2 Z u e d  Z w e o x e i e  n qWq Wz d  d! d" d# f Z" { x# e" d { r 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.3 2001/11/11 18:47:51 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.3 $s   versions   $Date: 2001/11/11 18:47:51 $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_0/happydoclib/happyformatter.pys   writeW s   (   s   __doc__s   write(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   DevNullQ s   	s   python%d.%di    s   site-packagess   *.pyi   s   *.sos   regexs   syss   threads	   threadings   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 %d   Z )d   Z -d   Z 1d   Z 5d   Z 9d   Z =d   Z Ad   Z Ed d d   Z Td!   Z  ]d"   Z! gd#   Z" rd$   Z# x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 |  _
  xB | i   d  r/ \ } }  | i d | | |  i i f  qc 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.

        i    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_0/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_0/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_0/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_0/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_0/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_0/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_0/happydoclib/happyformatter.pys
   fileFooter s   c    sv      t  i |  }  xM  | 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    i   s   "s   'N(   s   strings   strips   str(   s   selfs   str(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   _unquoteString s    7i   c    s6      |  i |  }  |  i | |   d Sd S(   s)   Write the text to the output destination.N(   s   selfs   _unquoteStrings   texts   writeRaws   output(   s   selfs   texts   outputs   quote(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/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_0/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_0/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_0/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_0/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_0/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_0/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_0/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_0/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_0/happydoclib/happyformatter.pys
   listFooters   c    s   !"|  i d  #d  Sd  S(   Ns   descriptiveListHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   title(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   descriptiveListHeader!s   c    s   %&|  i d  'd  Sd  S(   Ns   descriptiveListItem(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   items   description(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   descriptiveListItem%s   c    s   )*|  i d  +d  Sd  S(   Ns   descriptiveListFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   descriptiveListFooter)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_0/happydoclib/happyformatter.pys   sectionHeader-s   c    s   12|  i d  3d  Sd  S(   Ns   sectionFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   sectionFooter1s   c    s   56|  i d  7d  Sd  S(   Ns
   itemHeader(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   title(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys
   itemHeader5s   c    s   9:|  i d  ;d  Sd  S(   Ns
   itemFooter(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys
   itemFooter9s   c    s   =>|  i d  ?d  Sd  S(   Ns   pushSectionLevel(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   pushSectionLevel=s   c    s   AB|  i d  Cd  Sd  S(   Ns   popSectionLevel(   s   selfs   _requiredOfSubclass(   s   selfs   output(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   popSectionLevelAs   s   -iP   c    s!   EPQ|  i d  R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_0/happydoclib/happyformatter.pys   dividingLineEs   c    s!   TUV|  i d  W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_0/happydoclib/happyformatter.pys   commentTs   c    s   ]^_t  |  t i j o `t i i | i  } nB at  |  t i j o bt i i |  } n d| i	   } e| 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_0/happydoclib/happyformatter.pys   getNameForInfoSource]s   c    s!   gno|  i d  p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_0/happydoclib/happyformatter.pys   getOutputNameForObjectgs   c    s   ruv| 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_0/happydoclib/happyformatter.pys   fixUpOutputFilenamers   c    s!   x~|  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_0/happydoclib/happyformatter.pys   getOutputNameForFilex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_0/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_0/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_0/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_0/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_0/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_0/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   __rcs_info__s   happydoclibs   module_file_namess   oss   __version__s   DevNulls   times   _sys_moduless   version_dirs   tokens   _well_known_namess   _names   _sysdirss   StringIOs   names
   path_partss   module_lists   typess   paths   globs   shared_lib_file_namess   shared_lib_lists   syss   HappyFormatterBases   parsers   symbols   string(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_0/happydoclib/happyformatter.pys   ? s`   Z	! 		 	! 	
! 	
 	