;
Ņā"Ic            	   @   sr  d  Z  d d l m Z d d l m Z m Z d d l m Z m Z m	 Z	 m
 Z
 m Z e   d  Z e   d  Z d g Z d Z e o d d	 l Z n d d	 l Z d d	 l Z d
 e j k o e j d
 j d  Z n [ d Z e j d	 d  d k o2 e j j e  o e j j e  j d  Z n g  d  Z e j d	 d  d k o d   Z n
 d   Z [ d	 S(   uŪ  Simple API for XML (SAX) implementation for Python.

This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/.  The Python version of the interface is
documented at <...>.

This package contains the following modules:

handler -- Base classes and constants which define the SAX 2 API for
           the 'client-side' of SAX for Python.

saxutils -- Implementation of the convenience classes commonly used to
            work with SAX.

xmlreader -- Base classes and constants which define the SAX 2 API for
             the parsers used with SAX for Python.

expatreader -- Driver that allows use of the Expat parser with SAX.
i   (   u   InputSource(   u   ContentHandleru   ErrorHandler(   u   SAXExceptionu   SAXNotRecognizedExceptionu   SAXParseExceptionu   SAXNotSupportedExceptionu   SAXReaderNotAvailablec             C   s4   t    } | j |  | j |  | j |   d  S(   N(   u   make_parseru   setContentHandleru   setErrorHandleru   parse(   u   sourceu   handleru   errorHandleru   parser(    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   parse   s    	c             C   sz   d d l  m } | d  k o t   } n t   } | j |  | j |  t   } | j | |    | j	 |  d  S(   Ni    (   u   BytesIO(
   u   iou   BytesIOu   Noneu   ErrorHandleru   make_parseru   setContentHandleru   setErrorHandleru   InputSourceu   setByteStreamu   parse(   u   stringu   handleru   errorHandleru   BytesIOu   parseru   inpsrc(    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   parseString#   s    		u   xml.sax.expatreaderi    Nu   PY_SAX_PARSERu   ,u   python.xml.sax.parseri   u   javac             C   s   x |  t  D]t } y t |  SWq t k
 o> } z( d d l } | | j k o   n WYd d } ~ Xq t k
 o Yq Xq Wt d d   d S(   u&  Creates and returns a SAX parser.

    Creates the first parser it is able to instantiate of the ones
    given in the list created by doing parser_list +
    default_parser_list.  The lists must contain the names of Python
    modules containing both a SAX parser and a create_parser function.i    Nu   No parsers found(   u   default_parser_listu   _create_parseru   ImportErroru   sysu   modulesu   SAXReaderNotAvailableu   None(   u   parser_listu   parser_nameu   eu   sys(    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   make_parserD   s     
c             C   s2   d d l  m } | j |  d t    } | j   S(   Ni    (   u   imp(   u   org.python.coreu   impu
   importNameu   globalsu   create_parser(   u   parser_nameu   impu
   drv_module(    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   _create_parser_   s    c             C   s"   t  |  i  i  d g  } | j   S(   Nu   create_parser(   u
   __import__u   create_parser(   u   parser_nameu
   drv_module(    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   _create_parsere   s    (   u   __doc__u	   xmlreaderu   InputSourceu   handleru   ContentHandleru   ErrorHandleru   _exceptionsu   SAXExceptionu   SAXNotRecognizedExceptionu   SAXParseExceptionu   SAXNotSupportedExceptionu   SAXReaderNotAvailableu   parseu   parseStringu   default_parser_listu   _falseu   xml.sax.expatreaderu   xmlu   osu   sysu   environu   splitu   _keyu   platformu   registryu   containsKeyu   getPropertyu   make_parseru   _create_parser(    (    (    u-   /mit/python/lib/python3.0/xml/sax/__init__.pyu   <module>   s*   (	-	