-í
{‚…=c       sm     d  Z    d k l Z l Z 	 d k Z  d e i e i f d „  ƒ  YZ C d e f d „  ƒ  YZ d S(   sz   
Common code for the sgmllib, htmllib and xmllib parser drivers.

$Id: pylibs.py,v 1.6 2002/08/13 09:28:52 afayolle Exp $
(   s   saxlibs   saxutilsNs	   LibParserc      sn    d  Z    d „  Z  d „  Z  d „  Z ( d „  Z , d „  Z 0 d „  Z 4 d „  Z 8 d „  Z RS(	   s?   Common code for the sgmllib, htmllib and xmllib parser drivers.c    s     t  i i |  ƒ d  S(   N(   s   saxlibs   Parsers   __init__s   self(   s   self(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   __init__ s   c    s/      | |  _   |  i t i | ƒ ƒ d S(   s   Parses the referenced document.N(   s   sysIDs   selfs	   parseFiles   urllib2s   urlopen(   s   selfs   sysID(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   parse s   c    sá      |  i ƒ  o  |  i i |  ƒ n  |  i ƒ   x  d o…  | i d ƒ }  | d j o  Pn ! y " |  i | ƒ Wn= # t	 j
 o. } $ |  i i t i t | ƒ | ƒ ƒ n Xq@ W& |  i ƒ  d S(   s   Parses the given file.i   i @  s    N(   s   selfs   _can_locates   doc_handlers   setDocumentLocators   resets   fileobjs   reads   bufs   feeds   RuntimeErrors   es   err_handlers
   fatalErrors   saxlibs   SAXExceptions   strs   close(   s   selfs   fileobjs   es   buf(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys	   parseFile s    
 /c    s   ( ) * |  i i | ƒ d S(   s   Handles end tags.N(   s   selfs   doc_handlers
   endElements   tag(   s   selfs   tag(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   unknown_endtag( s   c    s   , - . | d j |  _  d S(   s-   Remembers whether the document is standalone.s   yesN(   s
   standalones   self(   s   selfs   encodings
   standalone(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys
   handle_xml, s   c    s)   0 1 2 |  i i | d t | ƒ ƒ d S(   s   Handles PCDATA.i    N(   s   selfs   doc_handlers
   characterss   datas   len(   s   selfs   data(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   handle_data0 s   c    s)   4 5 6 |  i i | d t | ƒ ƒ d S(   s   Handles CDATA marked sections.i    N(   s   selfs   doc_handlers
   characterss   datas   len(   s   selfs   data(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   handle_cdata4 s   c    sb   8 9 : |  i ƒ  o) ; |  i i t i | t < |  ƒ ƒ n  > |  i i t i | t ƒ ƒ d S(   s   Handles fatal errors.N(	   s   selfs   _can_locates   err_handlers
   fatalErrors   saxlibs   SAXParseExceptions   messages   Nones   SAXException(   s   selfs   message(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   syntax_error8 s
   (	   s   __doc__s   __init__s   parses	   parseFiles   unknown_endtags
   handle_xmls   handle_datas   handle_cdatas   syntax_error(    (    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys	   LibParser s   	s   SGMLParsersc      sz   C d  Z  D F d „  Z K d „  Z N d „  Z V d „  Z Z d „  Z _ d „  Z c d „  Z g d „  Z k d	 „  Z	 RS(
   s0   Common code for the sgmllib and htmllib parsers.c    s    F G I |  i i d | ƒ d S(   s    Handles processing instructions.s    N(   s   selfs   doc_handlers   processingInstructions   data(   s   selfs   data(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys	   handle_piF s   c    s   K L |  i | | ƒ d  S(   N(   s   selfs   unknown_starttags   tags
   attributes(   s   selfs   tags   methods
   attributes(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   handle_starttagK s   c    s\   N O P h  } Q x$ | DQ ] \ } } R | | | <q WT |  i i | t i	 | ƒ ƒ d S(   s   Handles start tags.N(
   s   attrss
   attributess   as   vs   selfs   doc_handlers   startElements   tags   saxutilss   AttributeMap(   s   selfs   tags
   attributess   as   attrss   v(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   unknown_starttagN s   	
 c    s   V W X |  i i | ƒ d S(   s   Handles end tags.N(   s   selfs   doc_handlers
   endElements   tag(   s   selfs   tags   method(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   handle_endtagV s   c    s0   Z [ \ |  i i t i d | ] t ƒ ƒ d S(   s/   Handles entity references by throwing an error.s    Reference to unknown entity '%s'N(   s   selfs   err_handlers
   fatalErrors   saxlibs   SAXExceptions   names   None(   s   selfs   name(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   unknown_entityrefZ s   c    s-   _ ` a |  i i t i d | t ƒ ƒ d S(   s'   Handles non-ASCII character references.s#   Reference to unknown character '%d'N(   s   selfs   err_handlers
   fatalErrors   saxlibs   SAXExceptions   nos   None(   s   selfs   no(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   unknown_charref_ s   c    s)   c d e |  i i | d t | ƒ ƒ d S(   s*   Handles character data in element content.i    N(   s   selfs   doc_handlers
   characterss   datas   len(   s   selfs   data(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   handle_datac s   c    s-   g h i |  i i t i d | t ƒ ƒ d S(   s   Reports unbalanced tags.s   Unbalanced end tag for '%s'N(   s   selfs   err_handlers
   fatalErrors   saxlibs   SAXExceptions   gis   None(   s   selfs   gi(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   report_unbalancedg s   c    s   k l m d Sd S(   s5   Internal: returns true if location info is available.i    N(    (   s   self(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   _can_locatek s   (
   s   __doc__s	   handle_pis   handle_starttags   unknown_starttags   handle_endtags   unknown_entityrefs   unknown_charrefs   handle_datas   report_unbalanceds   _can_locate(    (    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   SGMLParsersC s   	(	   s   __doc__s   xml.saxs   saxlibs   saxutilss   urllib2s   Parsers   Locators	   LibParsers   SGMLParsers(   s	   LibParsers   saxlibs   SGMLParserss   urllib2s   saxutils(    (    sI   /usr/local/twc/lib/python2.2/site-packages/_xmlplus/sax/drivers/pylibs.pys   ? s   "6