-
a<c       s     d  Z    d k Z  d k Z  h  d d <d d <d d <d d	 <d
 d <d d <d d <Z # d e i i i f d     YZ d S(   se   Contains abstract class for formatters which can output XML.

It is created for structured docsets.

Ns!   $RCSfile: xmlformatterbase.py,v $s   module_names   wrobell <wrobell@ite.pl>s   creators   HappyDocs   projects
   24-08-2001s   createds   $Author: wrobell $s   authors   $Revision: 1.3 $s   versions   $Date: 2002/02/07 01:19:11 $s   dates   XMLFormatterc      ss  # d  Z  % ' d d d d  Z L d   Z S d   Z \ d   Z c d   Z o h  d	  Z  h  d
  Z  d   Z  d   Z	  d   Z
  e d d  Z  d   Z  d   Z d   Z d   Z d   Z .d   Z :d   Z Fd   Z Rd   Z ^d   Z ld   Z zd   Z d   Z d   Z d   Z d   Z d    Z RS(!   s=   Base abstract class for formatters which can output XML.
    s
   iso-8859-1s   indexs   xmlc    s   ' 9 ; d |  _ < d |  _ = d |  _ ? | |  _ @ | |  _ A | |  _ C |  i |  _ D |  i	 |  _
 G t t i i i i H |  | f I |  d S(   s  Initialize the XMLStructFormatter.

        Arguments

            'docset' -- the DocSet instance containing global cross-reference
                      information

             'encoding' -- documentation file encoding (default 'iso-8859-1')

             'index_file_name' -- package index filename (default 'index')

             'file_name_ext' -- documentation filename extension (default 'xml')
            
            '**conf' -- additional, optional configuration values

        i   i    s     N(   s   selfs   debugs   indent_levels
   indent_strs   file_name_exts   index_file_names   encodings   getIndexFileNames   getRootNodeNames   getFileNameExtensions   getFilenameExtensions   applys   happydoclibs	   formatters   fileformatterbases   FileBasedFormatters   __init__s   docsets   conf(   s   selfs   docsets   encodings   index_file_names   file_name_exts   conf(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   __init__' s   c    s   L O P |  i Sd S(   so   Returns XML file encoding. File encoding can be specified with
        'encoding' formatter parameter.
        N(   s   selfs   encoding(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   getEncodingL s   c    s"   S X Y |  i d |  i   Sd S(   s  Returns package index file name. This file should contain
        all documentation files in current directory. Default filename
        extension is appended to the end of the name. The base name
        can be specified with 'index_name' formatter parameter.
        s   .N(   s   selfs   index_file_names   getFileNameExtension(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   getIndexFileNameS s   c    s   \ _ ` |  i Sd S(   sj   Returns filename extension. It can be specified with 'file_name_ext'
        formatter parameter.
        N(   s   selfs   file_name_ext(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   getFileNameExtension\ s   c    s2   c k l |  i o l |  i d | |  n d S(   s   Outputs comment to the output file.
        
        Arguments
        
            'text' -- comment text

            'output' -- output file object    
        s   <!-- %s -->
N(   s   selfs   debugs   writeRaws   texts   output(   s   selfs   texts   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   commentc s    c    s   o z { |  i |  } | | o3 } |  i d |  i   | |  i |  f |  n$  |  i d |  i   | f |   |  i   d S(   s>  This method outputs opening tag with attributes. Method 'endTag' should
        be used to close the tag.

        Arguments

            'name' -- tag name

            'output' -- output file object
            
            'attrs' -- tag attributes; every item { key: 'value' } is rendered as 'key="value"'
        s
   %s<%s %s>
s   %s<%s>
N(	   s   selfs   getAttrss   attrss   attr_strs   writeRaws	   getIndents   names   outputs	   incIndent(   s   selfs   names   outputs   attrss   attr_str(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   tago s   
3#c    ss      |  i |  }  | o*  |  i d |  i   | | f |  n$  |  i d |  i   | f |  d S(   s   Outputs empty tag.

        Arguments

            'name' -- tag name

            'output' -- output file object
            
            'attrs' -- tag attributes; every item { key: 'value' } is rendered as 'key="value"'
        s   %s<%s %s/>
s   %s<%s/>
N(   s   selfs   getAttrss   attrss   attr_strs   writeRaws	   getIndents   names   output(   s   selfs   names   outputs   attrss   attr_str(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   emptyTag s
   

*c    s:      |  i    |  i d |  i   | f |  d S(   s   Outputs closing tag. Method 'tag' should be used to open the tag.

        Arguments

            'name' -- tag name

            'output' -- output file object
        s   %s</%s>
N(   s   selfs	   decIndents   writeRaws	   getIndents   names   output(   s   selfs   names   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   endTag s   c    sC      |  i | |   |  i | |   |  i | |  d S(   s;  Outputs text between opening and closing XML tags. For example

            self.writeTaggedText('tag', 'text', output)

        outputs

            <tag>text</tag>

        Arguments

            'tag' -- tag name
            
            'text' -- tagged text

            'output' -- output file object
        N(   s   selfs   tags   outputs	   writeTexts   texts   endTag(   s   selfs   tags   texts   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   writeTaggedText s   c    s,      t  i t d   | i     Sd S(   s  Converts Python dictionary into XML attributes string.
        For example

            {
                'attr1': 'val1',
                'attr2': 'val2',
                'attr3': 'val3',
            }

        is converted to the following string

            attr1="val1" attr2="val2" attr3="val3"

        Arguments
            
            'attrs' -- dictionary with XML attributes

        Returns attributes string.
        c    s    d |  S(   Ns   %s="%s"(   s	   attr_item(   s	   attr_item(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   <lambda> s    N(   s   strings   joins   maps   attrss   items(   s   selfs   attrs(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   getAttrs s   i   c    s+      |  i |  i   | d |  d S(   s  Outputs text to XML file.

        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.
            
        s   
N(   s   selfs   writeRaws	   getIndents   texts   output(   s   selfs   texts   outputs
   textFormats   quote(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys	   writeText s   c    s      |  i d  d S(   sO  Method invoked by docset, when new file is opened. This method
        can be used to output XML declaration, DTD, etc.

        Arguments

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)

            'rtype' -- file type (index, module or class file)
        s   processRootN(   s   selfs   _requiredOfSubclass(   s   selfs   outputs   stages   rtype(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processRoot s   c    s      |  i d  d S(   s   Method invoked by docset, when package is being processed.

        Arguments

            'info' -- package info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processPackageN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processPackage s   
c    s   |  i d  d S(   s   Method invoked by docset, when module is being processed.

        Arguments

            'info' -- module info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processModuleN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processModules   
c    s   |  i d  d S(   s'  Method invoked by docset, when docstring is being processed.

        Arguments

            'info' -- docstring owner (module, class, function, etc.) info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processDocStringN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processDocStrings   
c    s   *+|  i d  d S(   sa  Method invoked by docset, when import statement is being processed.

        Arguments

            'iinfo' -- imported module info object

            'minfo' -- info object of module, where import statement is declared

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processImportN(   s   selfs   _requiredOfSubclass(   s   selfs   iinfos   minfos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processImports   c    s   .67|  i d  d S(   s  Method invoked by docset, when import symbol is being processed.

            'info' -- info object of imported symbol or string with symbol name

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processImportSymbolN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processImportSymbol.s   c    s   :BC|  i d  d S(   s   Method invoked by docset, when class is being processed.

            'info' -- class info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processClassN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processClass:s   c    s   FNO|  i d  d S(   s  Method invoked by docset, when exception is being processed.

            'info' -- exception info object or string with exception name

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processExceptionN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processExceptionFs   c    s   RZ[|  i d  d S(   s  Method invoked by docset, when function or class method is being processed.

            'info' -- function or class method info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processFunctionN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processFunctionRs   c    s   ^hi|  i d  d S(   s1  Method invoked by docset, when inherited class info of derived class is being processed.

            'info' -- base class info object

            'cinfo' -- derived class

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processClassBaseN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   cinfos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processClassBase^s   
c    s   lvw|  i d  d S(   s3  Method invoked by docset, when function or class method parameter is being processed.

        Arguments

            'info' -- function or class method parameter info object

            'output' -- output file object

            'stage' -- processing stage (one of: PRE, START, END, POST values)
        s   processParamN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   outputs   stage(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   processParamls   
c    s   z|  i d  d S(   s   Method invoked by docset to process class index item.

        Arguments

            'info' -- class info object

            'output' -- output file object
        s
   classIndexN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys
   classIndexzs   c    s   |  i d  d S(   s   Method invoked by docset to process module index item.

        Arguments

            'info' -- module info object

            'output' -- output file object
        s   moduleIndexN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   moduleIndexs   c    s   |  i d  d S(   s   Method invoked by docset to process package index item.

        Arguments

            'info' -- package info object

            'output' -- output file object
        s   packageIndexN(   s   selfs   _requiredOfSubclass(   s   selfs   infos   output(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   packageIndexs   c    s:   t  o |  i d j p t  |  i d 7_ d  S(   Ni    i   (   s	   __debug__s   selfs   indent_levels   AssertionError(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys	   incIndents   !c    s:   |  i d 8_ t o |  i d j p t  d  S(   Ni   i    (   s   selfs   indent_levels	   __debug__s   AssertionError(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys	   decIndents   c    sJ   t  o |  i d j p t  t  o |  i p t  d Sd  S(   Ni    s    (   s	   __debug__s   selfs   indent_levels   AssertionErrors
   indent_str(   s   self(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys	   getIndents   !(   s   __doc__s   __init__s   getEncodings   getIndexFileNames   getFileNameExtensions   comments   tags   emptyTags   endTags   writeTaggedTexts   getAttrss   Nones	   writeTexts   processRoots   processPackages   processModules   processDocStrings   processImports   processImportSymbols   processClasss   processExceptions   processFunctions   processClassBases   processParams
   classIndexs   moduleIndexs   packageIndexs	   incIndents	   decIndents	   getIndent(    (    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   XMLFormatter# s:   	%	(	   s   __doc__s   strings'   happydoclib.formatter.fileformatterbases   happydoclibs   __rcs_info__s	   formatters   fileformatterbases   FileBasedFormatters   XMLFormatter(   s   XMLFormatters   strings   happydoclibs   __rcs_info__(    (    sd   /home/dhellmann/Personal/Devel/HappyDoc/dist/HappyDoc-r2_1/happydoclib/formatter/xmlformatterbase.pys   ? s   H