
R}:c       s   d  Z  d k Z d k Z d k Z d k Z d k Z d k Z e i e i g Z	 h  d  Z
 d e i f d     YZ d e i f d     YZ d d  Z d S(	   sn   A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
Nc    so   |  i d d  }  |  i d d  }  |  i d d  }  x. | i   d r \ } } |  i | |  }  qE W|  Sd S(	   s   Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as 
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    s   &s   &amp;s   <s   &lt;s   >s   &gt;i    N(   s   datas   replaces   entitiess   itemss   charss   entity(   s   datas   entitiess   charss   entitys,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   escape s      s   XMLGeneratorc      sk   e  d d  Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z	 d   Z
 d   Z RS(   Nc    so   | t j o d  k } | i } n t i i |   | |  _ h  g |  _	 |  i	 d |  _
 g  |  _ | |  _ d  S(   Ni   (   s   outs   Nones   syss   stdouts   handlers   ContentHandlers   __init__s   selfs   _outs   _ns_contextss   _current_contexts   _undeclared_ns_mapss   encodings	   _encoding(   s   selfs   outs   encodings   syss,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   __init__ s    			s
   iso-8859-1c    s   |  i i d |  i  d  S(   Ns$   <?xml version="1.0" encoding="%s"?>
(   s   selfs   _outs   writes	   _encoding(   s   selfs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startDocument* s    c    s@   |  i i |  i i    | |  i | <|  i i | | f  d  S(   N(   s   selfs   _ns_contextss   appends   _current_contexts   copys   prefixs   uris   _undeclared_ns_maps(   s   selfs   prefixs   uris,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startPrefixMapping. s    c    s    |  i d |  _ |  i d =d  S(   Ni   (   s   selfs   _ns_contextss   _current_context(   s   selfs   prefixs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   endPrefixMapping3 s    c    sg   |  i i d |  x< | i   d r, \ } } |  i i d | t |  f  q# W|  i i d  d  S(   Ns   <i    s    %s="%s"s   >(   s   selfs   _outs   writes   names   attrss   itemss   values   escape(   s   selfs   names   attrss   values,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startElement7 s
     $c    s   |  i i d |  d  S(   Ns   </%s>(   s   selfs   _outs   writes   name(   s   selfs   names,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   endElement= s    c    s   | d t j o | d } n |  i | d d | d } |  i i d |  x' |  i d r } |  i i d |  q\ Wg  |  _ xY | i	   d rI \ } } |  i | d d | d } |  i i d | t |  f  q W|  i i d  d  S(   Ni    i   s   :s   <s    xmlns:%s="%s"s    %s="%s"s   >(   s   names   Nones   selfs   _current_contexts   _outs   writes   _undeclared_ns_mapss   pairs   attrss   itemss   values   escape(   s   selfs   names   qnames   attrss   pairs   values,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startElementNS@ s     	 $c    sT   | d t j o | d } n |  i | d d | d } |  i i d |  d  S(   Ni    i   s   :s   </%s>(   s   names   Nones   selfs   _current_contexts   _outs   write(   s   selfs   names   qnames,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   endElementNSR s    c    s   |  i i t |   d  S(   N(   s   selfs   _outs   writes   escapes   content(   s   selfs   contents,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   charactersY s    c    s   |  i i |  d  S(   N(   s   selfs   _outs   writes   content(   s   selfs   contents,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   ignorableWhitespace\ s    c    s   |  i i d | | f  d  S(   Ns	   <?%s %s?>(   s   selfs   _outs   writes   targets   data(   s   selfs   targets   datas,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   processingInstruction_ s    (   s   Nones   __init__s   startDocuments   startPrefixMappings   endPrefixMappings   startElements
   endElements   startElementNSs   endElementNSs
   characterss   ignorableWhitespaces   processingInstruction(    s,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   XMLGenerator s    									s   XMLFilterBasec      s  d  Z  e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d	   Z
 d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sY  This class is designed to sit between an XMLReader and the
    client application's event handlers.  By default, it does nothing
    but pass requests up to the reader and events on to the handlers
    unmodified, but subclasses can override specific methods to modify
    the event stream or the configuration requests as they pass
    through.c    s   t  i i |   | |  _ d  S(   N(   s	   xmlreaders	   XMLReaders   __init__s   selfs   parents   _parent(   s   selfs   parents,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   __init__k s    c    s   |  i i |  d  S(   N(   s   selfs   _err_handlers   errors	   exception(   s   selfs	   exceptions,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   errorq s    c    s   |  i i |  d  S(   N(   s   selfs   _err_handlers
   fatalErrors	   exception(   s   selfs	   exceptions,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   fatalErrort s    c    s   |  i i |  d  S(   N(   s   selfs   _err_handlers   warnings	   exception(   s   selfs	   exceptions,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   warningw s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers   setDocumentLocators   locator(   s   selfs   locators,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   setDocumentLocator| s    c    s   |  i i   d  S(   N(   s   selfs   _cont_handlers   startDocument(   s   selfs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startDocument s    c    s   |  i i   d  S(   N(   s   selfs   _cont_handlers   endDocument(   s   selfs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   endDocument s    c    s   |  i i | |  d  S(   N(   s   selfs   _cont_handlers   startPrefixMappings   prefixs   uri(   s   selfs   prefixs   uris,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startPrefixMapping s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers   endPrefixMappings   prefix(   s   selfs   prefixs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   endPrefixMapping s    c    s   |  i i | |  d  S(   N(   s   selfs   _cont_handlers   startElements   names   attrs(   s   selfs   names   attrss,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startElement s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers
   endElements   name(   s   selfs   names,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   endElement s    c    s   |  i i | |  d  S(   N(   s   selfs   _cont_handlers   startElements   names   attrs(   s   selfs   names   qnames   attrss,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   startElementNS s    c    s   |  i i | |  d  S(   N(   s   selfs   _cont_handlers   endElementNSs   names   qname(   s   selfs   names   qnames,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   endElementNS s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers
   characterss   content(   s   selfs   contents,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   characters s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers   ignorableWhitespaces   chars(   s   selfs   charss,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   ignorableWhitespace s    c    s   |  i i | |  d  S(   N(   s   selfs   _cont_handlers   processingInstructions   targets   data(   s   selfs   targets   datas,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   processingInstruction s    c    s   |  i i |  d  S(   N(   s   selfs   _cont_handlers   skippedEntitys   name(   s   selfs   names,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   skippedEntity s    c    s   |  i i | | |  d  S(   N(   s   selfs   _dtd_handlers   notationDecls   names   publicIds   systemId(   s   selfs   names   publicIds   systemIds,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   notationDecl s    c    s   |  i i | | | |  d  S(   N(   s   selfs   _dtd_handlers   unparsedEntityDecls   names   publicIds   systemIds   ndata(   s   selfs   names   publicIds   systemIds   ndatas,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   unparsedEntityDecl s    c    s   |  i i | |  d  S(   N(   s   selfs   _ent_handlers   resolveEntitys   publicIds   systemId(   s   selfs   publicIds   systemIds,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   resolveEntity s    c    sT   |  i i |   |  i i |   |  i i |   |  i i |   |  i i |  d  S(   N(   s   selfs   _parents   setContentHandlers   setErrorHandlers   setEntityResolvers   setDTDHandlers   parses   source(   s   selfs   sources,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   parse s
    c    s   |  i i |  d  S(   N(   s   selfs   _parents	   setLocales   locale(   s   selfs   locales,   /usr/local/lib/python2.0/xml/sax/saxutils.pys	   setLocale s    c    s   |  i i |  Sd  S(   N(   s   selfs   _parents
   getFeatures   name(   s   selfs   names,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   getFeature s    c    s   |  i i | |  d  S(   N(   s   selfs   _parents
   setFeatures   names   state(   s   selfs   names   states,   /usr/local/lib/python2.0/xml/sax/saxutils.pys
   setFeature s    c    s   |  i i |  Sd  S(   N(   s   selfs   _parents   getPropertys   name(   s   selfs   names,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   getProperty s    c    s   |  i i | |  d  S(   N(   s   selfs   _parents   setPropertys   names   value(   s   selfs   names   values,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   setProperty s    c    s   |  i Sd  S(   N(   s   selfs   _parent(   s   selfs,   /usr/local/lib/python2.0/xml/sax/saxutils.pys	   getParent s    c    s   | |  _ d  S(   N(   s   parents   selfs   _parent(   s   selfs   parents,   /usr/local/lib/python2.0/xml/sax/saxutils.pys	   setParent s    (   s   __doc__s   Nones   __init__s   errors
   fatalErrors   warnings   setDocumentLocators   startDocuments   endDocuments   startPrefixMappings   endPrefixMappings   startElements
   endElements   startElementNSs   endElementNSs
   characterss   ignorableWhitespaces   processingInstructions   skippedEntitys   notationDecls   unparsedEntityDecls   resolveEntitys   parses	   setLocales
   getFeatures
   setFeatures   getPropertys   setPropertys	   getParents	   setParent(    s,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   XMLFilterBasec s:    																										c    sG  t  |   t j o t i |   }  nX t |  d  oG |  } t i   }  |  i |  t | d  o | i | i	  n n |  i
   t j o |  i   } t i i |  oQ t i i t i i |   d } |  i t i i | |   t | d  } n/ |  i t i | |   t i |  i    } |  i |  n |  Sd S(   s   This function takes an InputSource and an optional base URL and
    returns a fully resolved InputSource object ready for reading.s   reads   namei    s   rbN(   s   types   sources   _StringTypess	   xmlreaders   InputSources   hasattrs   fs   setByteStreams   setSystemIds   names   getByteStreams   Nones   getSystemIds   sysids   oss   paths   isfiles   splits   normpaths   bases   baseheads   joins   opens   urlparses   urljoins   urllibs   urlopen(   s   sources   bases   fs   sysids   baseheads,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   prepare_input_source s&     "s    (   s   __doc__s   oss   urlparses   urllibs   typess   handlers	   xmlreaders
   StringTypes   UnicodeTypes   _StringTypess   escapes   ContentHandlers   XMLGenerators	   XMLReaders   XMLFilterBases   prepare_input_source(    s,   /usr/local/lib/python2.0/xml/sax/saxutils.pys   ? s   $		Ho