B ¥Q'ÙÃ}wã@s dZddlmZddlmZmZddlmZmZm Z m Z m Z eƒfdd„Z eƒfdd„Z d gZd Zernd d lZd d lZd d lZejjs d ejkr ejd  d ¡Z[dZejd d…dkrÖej e¡rÖej e¡ d ¡Zgfdd„Zejd d…dkrþdd„Zndd„Z[d S)aÛ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. é)Ú InputSource)ÚContentHandlerÚ ErrorHandler)Ú SAXExceptionÚSAXNotRecognizedExceptionÚSAXParseExceptionÚSAXNotSupportedExceptionÚSAXReaderNotAvailablecCs(tƒ}| |¡| |¡| |¡dS)N)Ú make_parserÚsetContentHandlerÚsetErrorHandlerÚparse)ÚsourceÚhandlerÚ errorHandlerÚparser©rú5/opt/alt/python37/lib64/python3.7/xml/sax/__init__.pyr s  r cCspddl}|dkrtƒ}tƒ}| |¡| |¡tƒ}t|tƒrR| |  |¡¡n|  |  |¡¡|  |¡dS)Né) Úiorr r r rÚ isinstanceÚstrZsetCharacterStreamÚStringIOZ setByteStreamÚBytesIOr )ÚstringrrrrZinpsrcrrrÚ parseString#s   rzxml.sax.expatreaderrNZ PY_SAX_PARSERú,zpython.xml.sax.parseréÚjavac Csrxb|tD]V}yt|ƒStk rL}zddl}||jkr<‚Wdd}~XYq tk r^Yq Xq Wtddƒ‚dS)a&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.rNzNo parsers found)Údefault_parser_listÚ_create_parserÚ ImportErrorÚsysÚmodulesr )Z parser_listÚ parser_nameÚer"rrrr Fs  r cCs$ddlm}| |dtƒ¡}| ¡S)Nr)Úimp)Zorg.python.corer&Z importNameÚglobalsÚ create_parser)r$r&Ú drv_modulerrrr as r cCst|iidgƒ}| ¡S)Nr()Ú __import__r()r$r)rrrr gs)Ú__doc__Z xmlreaderrrrrÚ _exceptionsrrrrr r rrÚ_falseZxml.sax.expatreaderZxmlÚosr"ÚflagsÚignore_environmentÚenvironÚsplitZ_keyÚplatformÚregistryZ containsKeyZ getPropertyr r rrrrÚs*