-
<c       s    d  Z  @ B h  d d <d d <d d <d d <d	 d
 <d d <d d <d d <Z S y T e d i d  d Z Wn U V d Z n X[ d k Z \ d k Z ] d k Z b d k Z h e a	 i d   Z
 o d e i i f d     YZ  d   Z  d   Z d S(   s;  Python docstring converter plugins.

    *How does an author write documentation so that it will be marked
    up and look fancy?* This is a perennial question for
    "Python":http://www.python.org users, and seems to have introduced
    a roadblock into the development of more robust and useful
    documentation tools.  HappyDoc stands firmly on the fence and does
    not attempt to resolve the issue.

    By separating the docstring converter and formatter classes from
    the docset classes, HappyDoc allows a user to create their own
    converter and formatter to interpret comments in any way they see
    fit.

    The docstring converter plugins are responsible for translating
    text from the input markup syntax to the output format.  This
    translation is formatter independent, so that the same HTML
    conversion might be used by mutliple HTML formatters.  It is,
    however, *format* dependent, so that HTML output should not be
    used by a plain text formatter.

    The default for the 'HTMLTableFormatter' (the default formatter
    for HappyDoc) is to treat '__doc__' strings as
    "StructuredTextNG":http://www.zope.org//Members/jim/StructuredTextWiki/StructuredTextNGRules.
    This is the "Next Generation" version of the original
    "StructuredText":http://www.python.org/sigs/doc-sig/stext.html
    markup syntax.  See also the 'StructuredText' package for a
    description of the rules for using StructuredText.

    *Don't like StructuredText?* Write your own docstring converter
    that uses something different and drop it into place.  Refer to
    the 'happydocstring.py' module for the base class and APIs
    required of a docstring converter.  If a defacto (or otherwise)
    standard structured markup for Python '__doc__' strings emerges,
    HappyDoc will be updated to use that format by default.

s   $RCSfile: __init__.py,v $s   module_names=   $Id: __init__.py,v 1.4 2001/12/09 15:35:26 doughellmann Exp $s   rcs_ids(   Doug Hellmann <DougHellmann@bigfoot.com>s   creators   HappyDocs   projects   Wed, 26-Sep-2001 09:31:19 EDTs   createds   $Author: doughellmann $s   authors   $Revision: 1.4 $s   versions   $Date: 2001/12/09 15:35:26 $s   dates    i   s   0.0Nc      s,   i j k t  o l t   a  n m t  Sd  S(   N(   s   _plugin_loaders   DocStringLoaderSingleton(    (    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   DocStringLoaderi s   s   DocStringLoaderSingletonc      s5   o d  Z  p r d   Z x d   Z  d d  Z RS(   s$   Load pluggable docstring converters.c    s@   r s g  |  _ t t i i i |  t t d u d  v d  Sd  S(   Ni    s   happydoclib(   s   selfs   _filename_patternss   happydoclibs   pluginloaders   PluginLoaders   __init__s   __name__s   __path__(   s   self(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   __init__r s   
c    s   x y } | d } ~ | d }  | d }  x | D ]~ }  y  t i |  } WnC   t i	 i
 d   t i    t i	 i
 d   q7 n X |  i i | | f  q7 W | |  | < d Sd S(   s:   Add the information about a converter to our lookup table.s   names   factorys   filenamePatternLists   
--- Plugin Module Error ---
s   ---------------------------

N(   s   infoDicts   names   factorys   pattern_lists   patterns   res   compiles   regexs   syss   stderrs   writes	   tracebacks	   print_excs   selfs   _filename_patternss   append(   s   selfs   infoDicts   regexs   pattern_lists   names   patterns   factory(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   addEntryPointx s    
 	
s	   PlainTextc    se      | o  | Sn  x8 |  i D ]* \ } }  | i |  o  | Sn q) W | Sd S(   sB   Return the name of the docstring converter for the file specified.N(   s   filenames   defaults   selfs   _filename_patternss   regexs   plugin_names   search(   s   selfs   filenames   defaults   regexs   plugin_name(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   getConverterNameForFile s    (   s   __doc__s   __init__s   addEntryPoints   getConverterNameForFile(    (    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   DocStringLoaderSingletono s   	c    sr      t    }  |  | i   j o;  d |  GH d t | i    GH t d |    n  | |  Sd S(   s*  Returns the factory for a docstring converter for 'formatType' text.

    Parameters:

      'formatType' -- A string representing the name of the input text
      type.  If this string does not match a registered docstring
      converter input format, a ValueError exception will be raised.

    s   Wanted: "%s"s
   Have  : %ss'   Unrecognized docstring format type "%s"N(   s   DocStringLoaders   pluginss
   formatTypes   keyss   strs
   ValueError(   s
   formatTypes   plugins(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   getConverterFactory s   	c    s5      t    }  | i |   }  t |  Sd S(   s   Returns the  factory for a docstring converter for an external file.

    Parameters:

      'filename' -- The name of the external file to be examined.
    
    N(   s   DocStringLoaders   pluginss   getConverterNameForFiles   filenames   converter_names   getConverterFactory(   s   filenames   converter_names   plugins(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   getConverterFactoryForFile s   (   s   __doc__s   __rcs_info__s   splits   __version__s   syss   res	   tracebacks   happydoclibs   Nones   _plugin_loaders   DocStringLoaders   pluginloaders   PluginLoaders   DocStringLoaderSingletons   getConverterFactorys   getConverterFactoryForFile(
   s   DocStringLoaders   DocStringLoaderSingletons   getConverterFactorys	   tracebacks   syss   res   getConverterFactoryForFiles   __version__s   happydoclibs   __rcs_info__(    (    s\   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/docstring/__init__.pys   ?@ s   Q	: