ó û^‚Rc@sØdZddlZddlZddlmZdddgZddd„ƒYZddd „ƒYZd „Z de fd „ƒYZ de fd „ƒYZ d dd„ƒYZ [ddd„ƒYZddd„ƒYZdS(s4Implementation of the DOM Level 3 'LS-Load' feature.iÿÿÿÿN(t NodeFiltert DOMBuildertDOMEntityResolvertDOMInputSourcetOptionscBs€eZdZdZeZeZeZeZ eZ eZ eZ eZ eZeZeZeZeZeZeZeZdZdZRS(s±Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses an instance of this class to pass settings to the ExpatBuilder class. iN(t__name__t __module__t__doc__t namespacestTruetnamespace_declarationstFalset validationtexternal_parameter_entitiestexternal_general_entitiestexternal_dtd_subsettvalidate_if_schematvalidatetdatatype_normalizationtcreate_entity_ref_nodestentitiestwhitespace_in_element_contenttcdata_sectionstcommentstcharset_overrides_xml_encodingtinfosettsupported_mediatypes_onlytNonet errorHandlertfilter(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR s(c BsãeZd#Zd#Zd#ZdZdZdZdZ eeee fZ d„Z d„Z d„Z d„Zd„Zd „Zd „Zd „Zd „Zd „Zid$gd%6d&gd'6d(gd)6d*gd+6d,gd-6d.gd/6d0gd16d2gd36d4gd56d6gd76d8d9gd:6d;gd<6d=gd>6d?gd@6dAgdB6dCgdD6dEgdF6dGgdH6dIgdJ6dKgdL6gdM6dNdOdPdQdRdSdTdUdVg dW6dXgdY6dZgd[6d\gd]6Zd„Zd„Zd „Zd!„Zd"„ZRS(^iiiicCstƒ|_dS(N(Rt_options(tself((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt__init__9scCs|jS(N(tentityResolver(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_entityResolver<scCs ||_dS(N(R!(RR!((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_set_entityResolver>scCs|jS(N(R(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_errorHandlerAscCs ||_dS(N(R(RR((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_set_errorHandlerCscCs|jS(N(R(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_filterFscCs ||_dS(N(R(RR((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_filterHscCs¸|j|ƒr˜|rdpd}y|jt|ƒ|f}Wn*tk rjtjjd|fƒ‚q´XxF|D]\}}t|j||ƒqrWntjj dt |ƒƒ‚dS(Niisunsupported feature: %rsunknown feature: ( tsupportsFeaturet _settingst _name_xformtKeyErrortxmltdomtNotSupportedErrtsetattrRt NotFoundErrtrepr(Rtnametstatetsettingstvalue((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt setFeatureKs  cCst|jt|ƒƒS(N(thasattrRR*(RR2((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR(YscCs+t|ƒ|rdpdf}||jkS(Nii(R*R)(RR2R3tkey((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt canSetFeature\sR iR RR RRRRRRRRRRRc Cs¹t|ƒ}yt|j|ƒSWn’tk r´|dkr•|j}|jo”|jo”|jo”|jo”|jp“|j p“|j p“|j p“|j St jjdt|ƒƒ‚nXdS(NRsfeature %s not known(R*tgetattrRtAttributeErrorRRRRR RRRRR,R-R0R1(RR2txnametoptions((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt getFeature¢s             cCsC|jr!|jjd|ƒ}ntƒjd|ƒ}|j|ƒS(N(R!t resolveEntityRRtparse(Rturitinput((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytparseURI´s cCsytj|jƒ}|j|_|j|_|j}|dkri|jriddl}|j|jƒ}n|j ||ƒS(Niÿÿÿÿ( tcopyRRRt byteStreamRtsystemIdturllib2turlopent_parse_bytestream(RRBR=tfpRG((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR@»s    cCs.||jkrtdƒ‚ntdƒ‚dS(Nsnot a legal actionsHaven't written this yet...(t_legal_actionst ValueErrortNotImplementedError(RRBtcnodetaction((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytparseWithContextÅscCs.ddl}|jjj|ƒ}|j|ƒS(Niÿÿÿÿ(txml.dom.expatbuilderR-t expatbuildert makeBuildert parseFile(RtstreamR=R,tbuilder((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRIÊs N(snamespace_declarationsi(snamespace_declarationsi(snamespace_declarationsi(snamespace_declarationsi(s validationi(s validationi(sexternal_general_entitiesi(sexternal_general_entitiesi(sexternal_general_entitiesi(sexternal_general_entitiesi(sexternal_parameter_entitiesi(sexternal_parameter_entitiesi(sexternal_parameter_entitiesi(sexternal_parameter_entitiesi(svalidate_if_schemai(svalidate_if_schemai(screate_entity_ref_nodesi(screate_entity_ref_nodesi(screate_entity_ref_nodesi(screate_entity_ref_nodesi(screate_entity_ref_nodesi(sentitiesi(sentitiesi(sentitiesi(sentitiesi(swhitespace_in_element_contenti(swhitespace_in_element_contenti(swhitespace_in_element_contenti(swhitespace_in_element_contenti(scdata_sectionsi(scdata_sectionsi(scdata_sectionsi(scdata_sectionsi(scommentsi(scommentsi(scommentsi(scommentsi(scharset_overrides_xml_encodingi(scharset_overrides_xml_encodingi(scharset_overrides_xml_encodingi(scharset_overrides_xml_encodingi(sinfoseti(snamespace_declarationsi(svalidate_if_schemai(screate_entity_ref_nodesi(sentitiesi(scdata_sectionsi(sdatatype_normalizationi(swhitespace_in_element_contenti(scommentsi(scharset_overrides_xml_encodingi(sinfoseti(ssupported_mediatypes_onlyi(ssupported_mediatypes_onlyi(s namespacesi(s namespacesi(s namespacesi(s namespacesi(RRRR!RRtACTION_REPLACEtACTION_APPEND_AS_CHILDRENtACTION_INSERT_AFTERtACTION_INSERT_BEFORERKR R"R#R$R%R&R'R6R(R9R)R>RCR@RPRI(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR,sv                                      cCs|jƒjddƒS(Nt-t_(tlowertreplace(R2((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR*ÐscBs2eZdZd„Zd„Zd„Zd„ZRS(t_openerc Csð|dk st‚tƒ}||_||_|jƒj|ƒ|_|j|ƒ|_ ddl }ddl }|j |ƒ}|\}}} } } } | rì| j dƒ rì|j | ƒd} ||| | | | f}|j|ƒ|_n|S(Niÿÿÿÿt/(RtAssertionErrorRtpublicIdRFt _get_openertopenREt_guess_media_encodingtencodingt posixpathturlparsetendswithtdirnamet urlunparsetbaseURI( RRbRFtsourceRgRhtpartstschemetnetloctpathtparamstquerytfragment((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR?×s   cCs6y |jSWn$tk r1|jƒ|_|jSXdS(N(R_R;t_create_opener(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRcís   cCsddl}|jƒS(Niÿÿÿÿ(RGt build_opener(RRG((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRuôs cCsb|jjƒ}d|kr^x@|jƒD]/}|jdƒr(|jddƒdjƒSq(WndS(Ns Content-Typescharset=t=i(REtinfotgetplistt startswithtsplitR](RRmRxtparam((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyReøs  (s_opener(RRt __slots__R?RcRuRe(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRÔs    cBs•eZdZd„Zd„Zd „Zd „Zd „Zd „Zd „Z d„Z d„Z d„Z d„Z d„Zd„Zd„Zd„ZRS(REtcharacterStreamt stringDataRfRbRFRlcCsCd|_d|_d|_d|_d|_d|_d|_dS(N(RRER~RRfRbRFRl(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR s      cCs|jS(N(RE(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_byteStream scCs ||_dS(N(RE(RRE((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_set_byteStreamscCs|jS(N(R~(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_characterStreamscCs ||_dS(N(R~(RR~((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_set_characterStreamscCs|jS(N(R(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_stringDatascCs ||_dS(N(R(Rtdata((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_set_stringDatascCs|jS(N(Rf(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_encodingscCs ||_dS(N(Rf(RRf((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_encodingscCs|jS(N(Rb(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_publicId!scCs ||_dS(N(Rb(RRb((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_publicId#scCs|jS(N(RF(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_systemId&scCs ||_dS(N(RF(RRF((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_systemId(scCs|jS(N(Rl(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_baseURI+scCs ||_dS(N(Rl(RRA((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_baseURI-s(s byteStreamscharacterStreams stringDatasencodingspublicIdssystemIdsbaseURI(RRR}R R€RR‚RƒR„R†R‡RˆR‰RŠR‹RŒRRŽ(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRs"             tDOMBuilderFiltercBsJeZdZdZdZdZdZejZ d„Z d„Z d„Z RS(sSElement filter which can be used to tailor construction of a DOM instance. iiiicCs|jS(N(t whatToShow(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt_get_whatToShowBscCs|jS(N(t FILTER_ACCEPT(Rtelement((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt acceptNodeEscCs|jS(N(R’(RR“((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytstartContainerHs( RRRR’t FILTER_REJECTt FILTER_SKIPtFILTER_INTERRUPTRtSHOW_ALLRR‘R”R•(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR1s   t DocumentLScBsJeZdZeZd„Zd„Zd„Zd„Zd„Z d„Z RS(s=Mixin to create documents that conform to the load/save spec.cCstS(N(R (R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _get_asyncSscCs|rtjjdƒ‚ndS(Ns.asynchronous document loading is not supported(R,R-R.(Rtasync((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyt _set_asyncUs cCstdƒ‚dS(Ns'haven't figured out what this means yet(RM(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytabortZscCstdƒ‚dS(Nshaven't written this yet(RM(RRA((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytload`scCstdƒ‚dS(Nshaven't written this yet(RM(RRm((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytloadXMLcscCs@|dkr|}n!|j|k r6tjjƒ‚n|jƒS(N(Rt ownerDocumentR,R-tWrongDocumentErrttoxml(Rtsnode((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytsaveXMLfs   ( RRRR RœR›RRžRŸR R¥(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyRšNs     tDOMImplementationLScBs/eZdZdZd„Zd„Zd„ZRS(iicCsk|dk r!tjjdƒ‚n||jkr7tƒS||jkr[tjjdƒ‚ntdƒ‚dS(NsschemaType not yet supporteds'asynchronous builders are not supportedsunknown value for mode(RR,R-R.tMODE_SYNCHRONOUSRtMODE_ASYNCHRONOUSRL(Rtmodet schemaType((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytcreateDOMBuilderrs     cCstdƒ‚dS(Ns-the writer interface hasn't been written yet!(RM(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytcreateDOMWriter}scCstƒS(N(R(R((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pytcreateDOMInputSources(RRR§R¨R«R¬R­(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyR¦ns  ((((((RRDtxml.domR,txml.dom.NodeFilterRt__all__RRR*tobjectRRRRšR¦(((s(/usr/lib/python2.7/xml/dom/xmlbuilder.pyts   ¤ ,1