-
BM=c       s     d  Z  # % h  d d <d d <d d <d d <d	 d
 <d d <d d <d d <Z 6 y 7 e d i d  d Z Wn 8 9 d Z n XC d k l Z I d f  d     YZ f d f  d     YZ  d e f d     YZ d S(   s/  Base class for docstring converters.

    A docstring converter is responsible for translating the docstring
    markup syntax to the output formatter syntax.  Docstring
    converters should be as generic as possible, but by their nature
    will have a close relationship with a happyformatter type.

s   $RCSfile: happydocstring.py,v $s   module_namesC   $Id: happydocstring.py,v 1.3 2002/08/04 10:47:30 doughellmann Exp $s   rcs_ids(   Doug Hellmann <DougHellmann@bigfoot.com>s   creators   UNSPECIFIEDs   projects   Wed, 26-Sep-2001 09:41:36 EDTs   createds   $Author: doughellmann $s   authors   $Revision: 1.3 $s   versions   $Date: 2002/08/04 10:47:30 $s   dates    i   s   0.0(   s   StreamFlushTests   ExternalDocumentationFileBasec      sJ   I d  Z  J L e Z N e d  Z X d   Z \ d   Z ` d   Z RS(   s+   Formatted documentation in an outside file.c    s[   N O | |  _  Q d |  _ R | o S | |  _ n U t | d  i   |  _ V d  Sd  S(   Ns    s   rt(   s   filenames   selfs	   _oneliners   bodys   _file_contentss   opens   read(   s   selfs   filenames   body(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   __init__N s   
c    s   X Y Z |  i Sd S(   s/   Returns the one line description from the file.N(   s   selfs	   _oneliner(   s   self(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   oneLinerX s   c    s   \ ] ^ t  |  i  Sd S(   s   String representation of file.N(   s   strs   selfs   _file_contents(   s   self(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   __str__\ s   c    s   ` a b |  i Sd S(   s   Input type of file contents.N(   s   selfs   _input_type(   s   self(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   getInputType` s   (   s   __doc__s   Nones   _input_types   __init__s   oneLiners   __str__s   getInputType(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   ExternalDocumentationFileBaseI s   		
s   HappyDocStringConverterBasec      sG   f d  Z  g i e Z k d   Z } d   Z  d   Z  d   Z RS(   s$   Base class for docstring converters.c    sO   k s w x8 | i   Dw ]' \ } } x d | | |  i i f GHq Wz d Sd S(   s   Initialize the docstring converter.

        Parameters:

          'extraNamedParameters' -- Parameters specified by name which
          were not interpreted by a subclass initialization.

        sD   WARNING: Parameter "%s" (%s) unrecognized by docstring converter %s.N(   s   extraNamedParameterss   itemss   extra_params   extra_values   selfs	   __class__s   __name__(   s   selfs   extraNamedParameterss   extra_params   extra_value(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   __init__k s
    c    s#   }   t  d |  i i   d S(   s  Returns the 'inputText' data translated into the 'outputFormat'.

        Parameters:

          'inputText' -- String or other sequence of characters to be
          converted.  This string should be in the format advertised
          by the docstring converter.

          'outputFormat' -- String defined by the docstring converter
          class to represent a supported output scheme.  This value is
          converter-specific, and not all converters will support the
          same output formats.

          '*args' -- Additional, converter-specific, positional arguments.

          '**namedArgs' -- Additional, converter-specific, named arguments.
        s   %s does not implement convertN(   s
   ValueErrors   selfs	   __class__s   __name__(   s   selfs	   inputTexts   outputFormats   argss	   namedArgs(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   convert} s   c    s#      t  d |  i i   d S(   s  Returns the 'inputText' quoted in a way that special characters are escaped.

        Parameters:

          'inputText' -- String or other sequence of characters to be
          converted.  This string should be in the format advertised
          by the docstring converter.

          'outputFormat' -- String defined by the docstring converter
          class to represent a supported output scheme.  This value is
          converter-specific, and not all converters will support the
          same output formats.

          '*args' -- Additional, converter-specific, positional arguments.

          '**namedArgs' -- Additional, converter-specific, named arguments.
          
        s   %s does not implement quoteN(   s
   ValueErrors   selfs	   __class__s   __name__(   s   selfs	   inputTexts   outputFormats   argss	   namedArgs(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   quote s   c    sL      y  |  i |  } Wn  t j
 o  t } n X | Sd S(   sD  Returns the 'inputText' quoted in a way that special characters are escaped.

        Parameters:

          'filename' -- Name of the file to retrieve.
          
          '*args' -- Additional, converter-specific, positional arguments.

          '**namedArgs' -- Additional, converter-specific, named arguments.
        N(   s   selfs   externalDocumentFactorys   filenames   files   IOErrors   None(   s   selfs   filenames   argss	   namedArgss   file(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   getExternalDocumentationFile s   
(   s   __doc__s   ExternalDocumentationFileBases   externalDocumentFactorys   __init__s   converts   quotes   getExternalDocumentationFile(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   HappyDocStringConverterBasef s   		s   DocStringConverterTestc      s/     d d  Z   d d  Z  d   Z RS(   Ns    c    s?     t  i |  | |   d  k }  | i |  _  d  Sd  S(   N(	   s   StreamFlushTests   __init__s   selfs
   methodNames	   outputDirs   happydoclib.docstrings   happydoclibs	   docstrings   _hddocstring(   s   selfs
   methodNames	   outputDirs   happydoclib(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   __init__ s   i    c 
   s     |  i i |  }  |   }  | i | |  }	  | o  d |	 GHn  |	 | j o(  d | GH d | GH d |	 GHn  t o$ |	 | j p t d | | |	 f   d  Sd  S(   Ns   
[[%s]]s   [INPUT[%s]INPUT]s   [EXPECTED[%s]EXPECTED]s   [CONVERTED[%s]CONVERTED]s   %s ("%s", "%s") (   s   selfs   _hddocstrings   getConverterFactorys   inputFormats   converter_factorys	   converters   converts	   inputTexts   outputFormats   converted_texts   debugs   expectedTexts	   __debug__s   AssertionErrors   errorMessage(
   s   selfs	   inputTexts   inputFormats   outputFormats   expectedTexts   errorMessages   debugs	   converters   converter_factorys   converted_text(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   _testConversion s   
.c 	   se     |  i i |  }  |   }  | i | d  }  t	 o | | j p
 t |   d  Sd  S(   Ns   html(   s   selfs   _hddocstrings   getConverterFactorys   inputFormats   converter_factorys	   converters   quotes	   inputTexts   quoted_texts	   __debug__s   expectedTexts   AssertionErrors   errorMessage(	   s   selfs	   inputTexts   inputFormats   outputFormats   expectedTexts   errorMessages	   converters   quoted_texts   converter_factory(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys
   _testQuote s
   !(   s   __init__s   _testConversions
   _testQuote(    (    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   DocStringConverterTest s   N(   s   __doc__s   __rcs_info__s   splits   __version__s   StreamFlushTests   ExternalDocumentationFileBases   HappyDocStringConverterBases   DocStringConverterTest(   s   StreamFlushTests   HappyDocStringConverterBases   DocStringConverterTests   __version__s   ExternalDocumentationFileBases   __rcs_info__(    (    sX   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/happydocstring.pys   ?# s   Q
S