7ec@sdZddlZddlZddlmZdddgZdddYZddd YZd Z de fd YZ de fd YZ d ddYZ [dddYZdddYZdS(s4Implementation of the DOM Level 3 'LS-Load' feature.iN(t NodeFiltert DOMBuildertDOMEntityResolvertDOMInputSourcetOptionscBseZdZdZeZeZeZeZ eZ eZ eZ eZ eZeZeZeZeZeZeZeZdZdZRS(sFeatures 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/lib64/python2.7/xml/dom/xmlbuilder.pyR s(c BseZd#Zd#Zd#ZdZdZdZdZ eeee fZ dZ dZ dZ dZdZd 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]6ZdZdZd Zd!Zd"ZRS(^iiiicCst|_dS(N(Rt_options(tself((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt__init__9scCs|jS(N(tentityResolver(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_entityResolver<scCs ||_dS(N(R!(RR!((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_set_entityResolver>scCs|jS(N(R(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_errorHandlerAscCs ||_dS(N(R(RR((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_set_errorHandlerCscCs|jS(N(R(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_filterFscCs ||_dS(N(R(RR((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_filterHscCs|j|r|rdpd}y|jt||f}Wn*tk rjtjjd|fqXxF|D]\}}t|j||qrWntjj dt |dS(Niisunsupported feature: %rsunknown feature: ( tsupportsFeaturet _settingst _name_xformtKeyErrortxmltdomtNotSupportedErrtsetattrRt NotFoundErrtrepr(Rtnametstatetsettingstvalue((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt setFeatureKs  cCst|jt|S(N(thasattrRR*(RR2((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR(YscCs+t||rdpdf}||jkS(Nii(R*R)(RR2R3tkey((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt canSetFeature\sR iR RR RRRRRRRRRRRcCst|}yt|j|SWntk 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/lib64/python2.7/xml/dom/xmlbuilder.pyt getFeatures             cCsC|jr!|jjd|}ntjd|}|j|S(N(R!t resolveEntityRRtparse(Rturitinput((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytparseURIs cCsytj|j}|j|_|j|_|j}|dkri|jriddl}|j|j}n|j ||S(Ni( tcopyRRRt byteStreamRtsystemIdturllib2turlopent_parse_bytestream(RRBR=tfpRG((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR@s    cCs.||jkrtdntddS(Nsnot a legal actionsHaven't written this yet...(t_legal_actionst ValueErrortNotImplementedError(RRBtcnodetaction((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytparseWithContextscCs.ddl}|jjj|}|j|S(Ni(txml.dom.expatbuilderR-t expatbuildert makeBuildert parseFile(RtstreamR=R,tbuilder((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRIs N(R i(R i(R i(R i(R i(R i(Ri(Ri(Ri(Ri(R i(R i(R i(R i(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(R i(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(Ri(RRRR!RRtACTION_REPLACEtACTION_APPEND_AS_CHILDRENtACTION_INSERT_AFTERtACTION_INSERT_BEFORERKR R"R#R$R%R&R'R6R(R9R)R>RCR@RPRI(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR,sv                                      cCs|jjddS(Nt-t_(tlowertreplace(R2((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR*scBs2eZdZdZdZdZdZRS(t_openerc Cst}||_||_|jj||_|j||_ddl}ddl }|j |}|\}}} } } } | r| j d r|j | d} ||| | | | f}|j ||_ n|S(Nit/(RtpublicIdRFt _get_openertopenREt_guess_media_encodingtencodingt posixpathturlparsetendswithtdirnamet urlunparsetbaseURI( RRaRFtsourceRfRgtpartstschemetnetloctpathtparamstquerytfragment((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR?s   cCs6y |jSWn$tk r1|j|_|jSXdS(N(R_R;t_create_opener(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRbs   cCsddl}|jS(Ni(RGt build_opener(RRG((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRts cCsb|jj}d|kr^x@|jD]/}|jdr(|jdddjSq(WndS(Ns Content-Typescharset=t=i(REtinfotgetplistt startswithtsplitR](RRlRwtparam((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRds  (R_(RRt __slots__R?RbRtRd(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRs    cBseZdZdZdZd Zd Zd Zd Zd Z dZ dZ dZ dZ dZdZdZdZRS(REtcharacterStreamt stringDataReRaRFRkcCsCd|_d|_d|_d|_d|_d|_d|_dS(N(RRER}R~ReRaRFRk(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR s      cCs|jS(N(RE(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_byteStream scCs ||_dS(N(RE(RRE((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_set_byteStreamscCs|jS(N(R}(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_characterStreamscCs ||_dS(N(R}(RR}((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_set_characterStreamscCs|jS(N(R~(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_stringDatascCs ||_dS(N(R~(Rtdata((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_set_stringDatascCs|jS(N(Re(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_encodingscCs ||_dS(N(Re(RRe((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_encodingscCs|jS(N(Ra(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_publicId!scCs ||_dS(N(Ra(RRa((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_publicId#scCs|jS(N(RF(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_systemId&scCs ||_dS(N(RF(RRF((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_systemId(scCs|jS(N(Rk(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_baseURI+scCs ||_dS(N(Rk(RRA((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_baseURI-s(RER}R~ReRaRFRk(RRR|R RRRRRRRRRRRRRR(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRs"             tDOMBuilderFiltercBsJeZdZdZdZdZdZejZ dZ dZ dZ RS(sSElement filter which can be used to tailor construction of a DOM instance. iiiicCs|jS(N(t whatToShow(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt_get_whatToShowBscCs|jS(N(t FILTER_ACCEPT(Rtelement((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt acceptNodeEscCs|jS(N(R(RR((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytstartContainerHs( RRRRt FILTER_REJECTt FILTER_SKIPtFILTER_INTERRUPTRtSHOW_ALLRRRR(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyR1s   t DocumentLScBsJeZdZeZdZdZdZdZdZ dZ RS(s=Mixin to create documents that conform to the load/save spec.cCstS(N(R (R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _get_asyncSscCs|rtjjdndS(Ns.asynchronous document loading is not supported(R,R-R.(Rtasync((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyt _set_asyncUs cCstddS(Ns'haven't figured out what this means yet(RM(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytabortZscCstddS(Nshaven't written this yet(RM(RRA((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytload`scCstddS(Nshaven't written this yet(RM(RRl((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytloadXMLcscCs@|dkr|}n!|j|k r6tjjn|jS(N(Rt ownerDocumentR,R-tWrongDocumentErrttoxml(Rtsnode((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytsaveXMLfs   ( RRRR RRRRRRR(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRNs     tDOMImplementationLScBs/eZdZdZdZdZdZRS(iicCsk|dk r!tjjdn||jkr7tS||jkr[tjjdntddS(NsschemaType not yet supporteds'asynchronous builders are not supportedsunknown value for mode(RR,R-R.tMODE_SYNCHRONOUSRtMODE_ASYNCHRONOUSRL(Rtmodet schemaType((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytcreateDOMBuilderrs     cCstddS(Ns-the writer interface hasn't been written yet!(RM(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytcreateDOMWriter}scCstS(N(R(R((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pytcreateDOMInputSources(RRRRRRR(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyRns  ((((((RRDtxml.domR,txml.dom.NodeFilterRt__all__RRR*tobjectRRRRR(((s*/usr/lib64/python2.7/xml/dom/xmlbuilder.pyts    ,1