AlkantarClanX12

Your IP : 3.147.205.19


Current Path : /opt/alt/python33/lib64/python3.3/xml/sax/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/xml/sax/__pycache__/expatreader.cpython-33.pyc

�
��fC9c@s.dZdZddlTddlmZmZddlmZddlmZmZddlm	Z	ddlm
Z
mZdd	lZej
d	d
�dkr�ede��n[ydd
lmZWn!ek
r�ede��Yn#Xeed�rede��nddlmZmZmZejZejZydd	lZWnek
rjdd�ZYnXdd	lZejZ[[Gdd�dej�ZGdd�dej ej�Z!dd�Z"e#dkr*dd	l$Z%e"�Z&e&j'e%j(jj)��e&j*e%j(j+��e&j,d�nd	S(u]
SAX driver for the pyexpat C module.  This driver works with
pyexpat.__version__ == '2.22'.
u0.20i(u*(ufeature_validationufeature_namespaces(ufeature_namespace_prefixes(ufeature_external_gesufeature_external_pes(ufeature_string_interning(uproperty_xml_stringuproperty_interning_dictNiujavauexpat not available in Java(uexpatuexpat not supporteduParserCreate(u	xmlreaderusaxutilsuhandlercCs|S(N((uo((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu_mkproxy'su_mkproxycBsV|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS(
uExpatLocatoru�Locator for use with the ExpatParser class.

    This uses a weak reference to the parser object to avoid creating
    a circular reference between the parser and the content handler.
    cCst|�|_dS(N(u_mkproxyu_ref(uselfuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu__init__6suExpatLocator.__init__cCs&|j}|jdkrdS|jjS(N(u_refu_parseruNoneuErrorColumnNumber(uselfuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetColumnNumber9s	uExpatLocator.getColumnNumbercCs&|j}|jdkrdS|jjS(Ni(u_refu_parseruNoneuErrorLineNumber(uselfuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
getLineNumber?s	uExpatLocator.getLineNumbercCs&|j}|dkrdS|jj�S(N(u_refuNoneu_sourceugetPublicId(uselfuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetPublicIdEs	uExpatLocator.getPublicIdcCs&|j}|dkrdS|jj�S(N(u_refuNoneu_sourceugetSystemId(uselfuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetSystemIdKs	uExpatLocator.getSystemIdN(	u__name__u
__module__u__qualname__u__doc__u__init__ugetColumnNumberu
getLineNumberugetPublicIdugetSystemId(u
__locals__((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuExpatLocator0suExpatLocatorcBs�|EeZdZdZddDdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBS(EuExpatParseru$SAX driver for the pyexpat C module.iiiicCsetjj||�tj�|_d|_||_d|_d|_	g|_
d|_d|_dS(Nii(
u	xmlreaderuIncrementalParseru__init__uInputSourceu_sourceuNoneu_parseru_namespacesu_lex_handler_propu_parsingu
_entity_stacku
_external_gesu
_interning(uselfunamespaceHandlingubufsize((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu__init__Ws						uExpatParser.__init__cCsOtj|�}||_|j�|jjt|��tjj	||�dS(u3Parse an XML document from a URL or an InputSource.N(
usaxutilsuprepare_input_sourceu_sourceuresetu
_cont_handlerusetDocumentLocatoruExpatLocatoru	xmlreaderuIncrementalParseruparse(uselfusource((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuparseds
	
uExpatParser.parsecCs/|j�dk	r+|jj|j��ndS(N(ugetSystemIduNoneu_parseruSetBase(uselfusource((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
prepareParsermsuExpatParser.prepareParsercCs-tjj||�|jr)|j�ndS(N(u	xmlreaderuIncrementalParserusetContentHandleru_parsingu_reset_cont_handler(uselfuhandler((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyusetContentHandlerss	uExpatParser.setContentHandlercCsl|tkr|jS|tkr,|jdk	S|tttfkrEdS|tkrX|j	St
d|��dS(NiuFeature '%s' not recognized(ufeature_namespacesu_namespacesufeature_string_interningu
_interninguNoneufeature_validationufeature_external_pesufeature_namespace_prefixesufeature_external_gesu
_external_gesuSAXNotRecognizedException(uselfuname((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
getFeaturexs
	uExpatParser.getFeaturecCs|jrtd��n|tkr0||_n�|tkrH||_n�|tkr�|rx|jdkr�i|_q�qd|_n||t	kr�|rtd��qnX|t
kr�|rtd��qn4|tkr�|rtd��qntd|��dS(Nu!Cannot set features while parsingu!expat does not support validationu/expat does not read external parameter entitiesu(expat does not report namespace prefixesuFeature '%s' not recognized(
u_parsinguSAXNotSupportedExceptionufeature_namespacesu_namespacesufeature_external_gesu
_external_gesufeature_string_interningu
_interninguNoneufeature_validationufeature_external_pesufeature_namespace_prefixesuSAXNotRecognizedException(uselfunameustate((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
setFeature�s2	uExpatParser.setFeaturecCs�|tjkr|jS|tkr)|jS|tkr{|jrlt|jd�r]|jj�St	d��q{t
d��nt	d|��dS(NuGetInputContextu=This version of expat does not support getting the XML stringu.XML string cannot be returned when not parsinguProperty '%s' not recognized(uhandleruproperty_lexical_handleru_lex_handler_propuproperty_interning_dictu
_interninguproperty_xml_stringu_parseruhasattruGetInputContextuSAXNotRecognizedExceptionuSAXNotSupportedException(uselfuname((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetProperty�s	
uExpatParser.getPropertycCs||tjkr1||_|jrx|j�qxnG|tkrI||_n/|tkrhtd|��nt	d|��dS(NuProperty '%s' cannot be setuProperty '%s' not recognized(
uhandleruproperty_lexical_handleru_lex_handler_propu_parsingu_reset_lex_handler_propuproperty_interning_dictu
_interninguproperty_xml_stringuSAXNotSupportedExceptionuSAXNotRecognizedException(uselfunameuvalue((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyusetProperty�s		
uExpatParser.setPropertycCs�|js,|j�d|_|jj�ny|jj||�WnVtjk
r�}z3ttj	|j
�||�}|jj|�WYdd}~XnXdS(Ni(
u_parsinguresetu
_cont_handleru
startDocumentu_parseruParseuexpatuerroruSAXParseExceptionuErrorStringucodeu_err_handleru
fatalError(uselfudatauisFinalueuexc((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyufeed�s	
	uExpatParser.feedcCsk|jr
dS|jddd�|jj�d|_d|_|jj�}|dk	rg|j	�ndS(NuuisFinalii(
u
_entity_stackufeedu
_cont_handleruendDocumentu_parsinguNoneu_parseru_sourceu
getByteStreamuclose(uselfubs((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuclose�s	
		uExpatParser.closecCs(|jj|j_|jj|j_dS(N(u
_cont_handleruprocessingInstructionu_parseruProcessingInstructionHandleru
charactersuCharacterDataHandler(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu_reset_cont_handler�suExpatParser._reset_cont_handlercCs�|j}|j}|dkrNd|_d|_d|_d|_d|_n<|j|_|j	|_|j
|_|j|_|j|_dS(N(
u_lex_handler_propu_parseruNoneuCommentHandleruStartCdataSectionHandleruEndCdataSectionHandleruStartDoctypeDeclHandleruEndDoctypeDeclHandlerucommentu
startCDATAuendCDATAustart_doctype_decluendDTD(uselfulexuparser((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu_reset_lex_handler_prop�s						u#ExpatParser._reset_lex_handler_propcCsd|jr]tj|jj�dd|j�|_d|j_|j|j_	|j
|j_nBtj|jj�d|j�|_|j|j_	|j
|j_|j�|j|j_|j|j_|j|j_|j|j_d|_|jr|j�n|j|j_y|j|j_Wntk
r:YnX|jj tj!�d|_"g|_#dS(Nu uinternii($u_namespacesuexpatuParserCreateu_sourceugetEncodingu
_interningu_parserunamespace_prefixesustart_element_nsuStartElementHandleruend_element_nsuEndElementHandleru
start_elementuend_elementu_reset_cont_handleruunparsed_entity_decluUnparsedEntityDeclHandleru
notation_decluNotationDeclHandlerustart_namespace_decluStartNamespaceDeclHandleruend_namespace_decluEndNamespaceDeclHandleruNoneu_decl_handler_propu_lex_handler_propu_reset_lex_handler_propuexternal_entity_refuExternalEntityRefHandleruskipped_entity_handleruSkippedEntityHandleruAttributeErroruSetParamEntityParsingu*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONEu_parsingu
_entity_stack(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyureset�s6	
		

	
	uExpatParser.resetcCs|jdkrdS|jjS(N(u_parseruNoneuErrorColumnNumber(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetColumnNumbersuExpatParser.getColumnNumbercCs|jdkrdS|jjS(Ni(u_parseruNoneuErrorLineNumber(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
getLineNumber#suExpatParser.getLineNumbercCs
|jj�S(N(u_sourceugetPublicId(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetPublicId(suExpatParser.getPublicIdcCs
|jj�S(N(u_sourceugetSystemId(uself((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyugetSystemId+suExpatParser.getSystemIdcCs|jj|t|��dS(N(u
_cont_handlerustartElementuAttributesImpl(uselfunameuattrs((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
start_element/suExpatParser.start_elementcCs|jj|�dS(N(u
_cont_handleru
endElement(uselfuname((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuend_element2suExpatParser.end_elementcCsL|j�}t|�dkr-d|f}n5t|�dkrV|d|df}nt|�}i}i}x�|j�D]�\}}|j�}t|�}	|	dkr�|}
d|f}nQ|	dkr�d|d|df}
|d|df}n|d}
t|�}|||<|
||<q{W|jj|dt||��dS(Niiiu%s:%si(usplitulenuNoneutupleuitemsu
_cont_handlerustartElementNSuAttributesNSImpl(uselfunameuattrsupairunewattrsuqnamesuanameuvalueupartsulengthuqnameuapair((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyustart_element_ns5s.

uExpatParser.start_element_nscCsy|j�}t|�dkr-d|f}n5t|�dkrV|d|df}nt|�}|jj|d�dS(Niii(usplitulenuNoneutupleu
_cont_handleruendElementNS(uselfunameupair((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuend_element_nsWsuExpatParser.end_element_nscCs|jj||�dS(N(u
_cont_handleruprocessingInstruction(uselfutargetudata((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuprocessing_instructioncsu"ExpatParser.processing_instructioncCs|jj|�dS(N(u
_cont_handleru
characters(uselfudata((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyucharacter_datagsuExpatParser.character_datacCs|jj||�dS(N(u
_cont_handlerustartPrefixMapping(uselfuprefixuuri((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyustart_namespace_decljsu ExpatParser.start_namespace_declcCs|jj|�dS(N(u
_cont_handleruendPrefixMapping(uselfuprefix((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuend_namespace_declmsuExpatParser.end_namespace_declcCs|jj|||�dS(N(u_lex_handler_propustartDTD(uselfunameusysidupubiduhas_internal_subset((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyustart_doctype_declpsuExpatParser.start_doctype_declcCs|jj||||�dS(N(u_dtd_handleruunparsedEntityDecl(uselfunameubaseusysidupubidu
notation_name((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuunparsed_entity_declssu ExpatParser.unparsed_entity_declcCs|jj|||�dS(N(u_dtd_handlerunotationDecl(uselfunameubaseusysidupubid((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
notation_declvsuExpatParser.notation_declc
Cs�|js
dS|jj||�}tj||jj�p=d�}|jj|j	|jf�|j	j
|�|_	||_ytjj
||�WndSYnX|jd\|_	|_|jd=dS(Niuii����i����(u
_external_gesu_ent_handleru
resolveEntityusaxutilsuprepare_input_sourceu_sourceugetSystemIdu
_entity_stackuappendu_parseruExternalEntityParserCreateu	xmlreaderuIncrementalParseruparse(uselfucontextubaseusysidupubidusource((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuexternal_entity_refys 					
uExpatParser.external_entity_refcCs'|rd|}n|jj|�dS(Nu%(u
_cont_handleru
skippedEntity(uselfunameuis_pe((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuskipped_entity_handler�s
u"ExpatParser.skipped_entity_handlerNii�("u__name__u
__module__u__qualname__u__doc__u__init__uparseu
prepareParserusetContentHandleru
getFeatureu
setFeatureugetPropertyusetPropertyufeeducloseu_reset_cont_handleru_reset_lex_handler_propuresetugetColumnNumberu
getLineNumberugetPublicIdugetSystemIdu
start_elementuend_elementustart_element_nsuend_element_nsuprocessing_instructionucharacter_dataustart_namespace_decluend_namespace_declustart_doctype_decluunparsed_entity_declu
notation_decluexternal_entity_refuskipped_entity_handler(u
__locals__((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyuExpatParserTs>
	
'"uExpatParsercOs
t||�S(N(uExpatParser(uargsukwargs((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu
create_parser�su
create_parseru__main__u:http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml(-u__doc__uversionuxml.sax._exceptionsuxml.sax.handlerufeature_validationufeature_namespacesufeature_namespace_prefixesufeature_external_gesufeature_external_pesufeature_string_interninguproperty_xml_stringuproperty_interning_dictusysuplatformuSAXReaderNotAvailableuNoneuxml.parsersuexpatuImportErroruhasattruxml.saxu	xmlreaderusaxutilsuhandleruAttributesImpluAttributesNSImplu_weakrefu_mkproxyuweakrefuproxyuLocatoruExpatLocatoruIncrementalParseruExpatParseru
create_parseru__name__uxml.sax.saxutilsuxmlupusetContentHandlerusaxuXMLGeneratorusetErrorHandleruErrorHandleruparse(((u8/opt/alt/python33/lib64/python3.3/xml/sax/expatreader.pyu<module>sJ

		
	$�D