ó œ0{Yc@`s³ddlmZmZmZddlmZddlZddlmZddlm Z ddlm Z dd l m Z dd l m Z ejd ƒZed „Ze eƒZdS( i(tabsolute_importtdivisiontunicode_literals(t text_typeNi(t_basei(tihatexml(t constants(t namespaces(tmoduleFactoryFactoryu {([^}]*)}(.*)c `sˆ‰ˆjdƒj‰dtjf‡fd†ƒY‰dˆf‡fd†ƒY‰dˆf‡fd†ƒY‰dˆf‡fd †ƒY‰d ˆf‡fd †ƒY‰‡fd †‰ ‡‡fd †}dtjf‡‡‡‡‡‡‡‡ fd†ƒY}tƒS(NuasdtElementc`séeZd‡fd†Zd„Zd„Zd„ZeeeƒZd„Z d„Z ee e ƒZ d„Z d„Z ee e ƒZd„Zd „ZeeeƒZd „Zd „Zd „Zd „Zdd„Zd„Zd„ZRS(c`s‰||_||_ˆj|j||ƒƒ|_|dkrUtd|jf|_n|j|jf|_d|_g|_ g|_ dS(Nuhtml( t_namet _namespaceR t _getETreeTagt_elementtNoneRt nameTupletparentt _childNodest_flags(tselftnamet namespace(t ElementTree(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt__init__s     cS`s)|dkr|}nd||f}|S(Nu{%s}%s(R(RRRt etree_tag((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR !s  cS`s+||_|j|j|jƒ|j_dS(N(R R R R ttag(RR((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setName(s cS`s|jS(N(R (R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getName,scS`s+||_|j|j|jƒ|j_dS(N(R R R R R(RR((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _setNamespace1s cS`s|jS(N(R (R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _getNamespace5scS`s |jjS(N(R tattrib(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getAttributes:scS`s”x-t|jjjƒƒD]}|jj|=qWx]|jƒD]O\}}t|tƒrsd|d|df}n|}|jj||ƒq=WdS(Nu{%s}%sii(tlistR Rtkeystitemst isinstancettupletset(Rt attributestkeytvalueR((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setAttributes=scS`s|jS(N(R(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getChildNodesKscS`s2|j2g|_x|D]}|j|ƒqWdS(N(R Rt insertChild(RR(telement((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setChildNodesNs  cS`st|jjpt|jƒƒS(u,Return true if the node has children or text(tboolR ttexttlen(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt hasContentVscS`s0|jj|ƒ|jj|jƒ||_dS(N(RtappendR R(Rtnode((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt appendChildZscS`s>t|jƒj|jƒ}|jj||jƒ||_dS(N(R R tindextinsertR(RR3trefNodeR5((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt insertBefore_scS`s |jj|jƒd|_dS(N(R tremoveRR(RR3((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt removeChilddscS`s-t|jƒs?|jjs*d|j_n|jj|7_nê|dkr‡|jdjsnd|jd_n|jdj|7_n¢t|jƒ}|j|jƒ}|dkrü|j|djsßd|j|d_n|j|dj|7_n-|jjsd|j_n|jj|7_dS(Nuiÿÿÿÿii(R0R R/RttailR R5(RtdataR8tchildrenR5((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt insertTexths"    cS`sLt|ƒ|j|jƒ}x*|jjƒD]\}}||j|R@RC((R(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR s*               tCommentc`s8eZ‡fd†Zd„Zd„ZeeeƒZRS(c`s1ˆj|ƒ|_d|_g|_g|_dS(N(RHR RRRR(RR<(R(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR‘s  cS`s |jjS(N(R R/(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_getData™scS`s||j_dS(N(R R/(RR(((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt_setDataœs(RERFRRIRJRGR<((R(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRHs  t DocumentTypec`sYeZ‡fd†Zd„Zd„ZeeeƒZd„Zd„ZeeeƒZ RS(c`s2ˆj|dƒ||j_||_||_dS(Nu (RR R/tpublicIdtsystemId(RRRLRM(R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR¢s  cS`s|jjddƒS(NupublicIdu(R tget(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _getPublicId¨scS`s&|dk r"|jjd|ƒndS(NupublicId(RR R%(RR(((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _setPublicId«s cS`s|jjddƒS(NusystemIdu(R RN(R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _getSystemId±scS`s&|dk r"|jjd|ƒndS(NusystemId(RR R%(RR(((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt _setSystemId´s ( RERFRRORPRGRLRQRRRM((R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRK¡s    tDocumentc`seZ‡fd†ZRS(c`sˆj|dƒdS(Nu DOCUMENT_ROOT(R(R(R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR»s(RERFR((R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRSºstDocumentFragmentc`seZ‡fd†ZRS(c`sˆj|dƒdS(NuDOCUMENT_FRAGMENT(R(R(R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyR¿s(RERFR((R (sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRT¾sc`s8g‰d‡‡‡fd†‰ˆ|dƒdjˆƒS(Nic `sŠt|dƒs|jƒ}n|jdkr¯|jdƒsK|jdƒr•|jdƒp]d}|jdƒprd}ˆjd|j||fƒq0ˆjd|jfƒn|jdkrMˆjd ƒ|jdk rÿˆjd d |d |jfƒn|jdk rtd ƒ‚nt|dƒr0t |j ƒr0tdƒ‚q0nã|jˆkr}ˆjdd ||jfƒn³t |jt ƒs±t dt|jƒ|jfƒ‚tj|jƒ}|dkrÛ|j}n/|jƒ\}}tj|}d||f}ˆjdd ||fƒt|dƒrg}xƒ|j jƒD]r\}} tj|ƒ}|dk r£|jƒ\}}tj|}d||f} n|} |j| | fƒqJWx?t|ƒD].\}} ˆjdd |d || fƒqÍWn|jr0ˆjd d |d |jfƒn|d 7}x|D]} ˆ| |ƒqAW|jr†ˆjd d |d |jfƒndS(Nutagu upublicIdusystemIduuu u DOCUMENT_ROOTu #documentu|%s"%s"u iuDocument node cannot have tailuattribu$Document node cannot have attributesu|%suExpected unicode, got %s, %su%s %su|%s<%s>u |%s%s="%s"(thasattrtgetrootRRNR2R/RR;t TypeErrorR0RR#RtAssertionErrorR?t tag_regexptmatchtgroupsRtprefixesR"tsorted( R,tindentRLRMtnsmatchRtnstprefixR&R(t attr_stringtchild(tElementTreeCommentTypetrvtserializeElement(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRfÅs^  %!     ) %   u (tjoin(R,(Rd(ReRfsX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyttestSerializerÂs7 c`sDg‰tjƒ‰‡‡‡‡‡fd†‰ˆ|ƒdjˆƒS(u4Serialize an element and its child nodes to a stringc`smt|ˆjƒr!|jƒ}n|jdkr²|jdƒsN|jdƒr˜|jdƒp`d}|jdƒpud}ˆjd|j||fƒqMˆjd|jfƒn›|jdkrL|jdk rãˆj|jƒn|jdk rt dƒ‚nt |d ƒr.t |j ƒr.t d ƒ‚nx|D]}ˆ|ƒq5Wn|jˆkruˆjd |jfƒnØ|j s¡ˆjd ˆj |jƒfƒn^d jg|j jƒD]%\}}dˆj |ƒ|f^q·ƒ}ˆjd|j|fƒ|jrˆj|jƒnx|D]}ˆ|ƒq"Wˆjd|jfƒ|jriˆj|jƒndS(Nu upublicIdusystemIduuu u DOCUMENT_ROOTuDocument node cannot have tailuattribu$Document node cannot have attributesu u<%s>u u%s="%s"u<%s %s>u(R#RRVRRNR2R/RR;RWRUR0Rt fromXmlNameRgR"(R,RLRMRcRR(tattr(RRdtfilterReRf(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRfs@   # ;   u(Rt InfosetFilterRg(R,(RRd(RkReRfsX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyttostrings  - t TreeBuilderc`sSeZˆZˆZˆZˆZˆZˆZ‡fd†Z‡fd†Z d„Z RS(c`s ˆ|ƒS(N((RR,(Rh(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRh>sc`sPˆr|jjS|jdk r9|jjjd|jƒS|jjjdƒSdS(Nu{%s}htmluhtml(tdocumentR tdefaultNamespaceRtfind(R(tfullTree(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyt getDocumentAs   cS`stjj|ƒjS(N(RRnt getFragmentR (R((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRtKs( RERFt documentClasst doctypeClasst elementClasst commentClasst fragmentClasstimplementationRhRsRt((RHRSRTRKR tElementTreeImplementationRrRh(sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyRn6s (RHRRRBRntlocals(R{RrRmRn(( RHRSRTRKR RRdR{RrRhsX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pytgetETreeBuilders}>64(t __future__RRRtpip._vendor.sixRtretRRRRtutilsRtcompileRYtFalseR}tgetETreeModule(((sX/opt/alt/python34/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.pyts  ÿC