Files
PowerToys/PythonHome/Lib/site-packages/bs4/builder/_html5lib.pyc

45 lines
13 KiB
Plaintext
Raw Normal View History

2014-07-10 23:57:08 +08:00
<03>
m<EFBFBD><EFBFBD>Sc@s dgZddlZddlmZmZmZmZddlmZddl Z ddl
m Z ddlm Z m Z mZmZdefd<00><00>YZde jjjfd <00><00>YZd
efd <00><00>YZd e jjjfd <00><00>YZdefd<00><00>YZdS(tHTML5TreeBuilderi<72><69><EFBFBD><EFBFBD>N(t
PERMISSIVEtHTMLtHTML_5tHTMLTreeBuilder(tNamespacedAttribute(t
namespaces(tCommenttDoctypetNavigableStringtTagcBsDeZdZdeeegZd<00>Zd<00>Zd<00>Z d<00>Z
RS(sUse html5lib to build a tree.thtml5libccs||_|ddtfVdS(N(tuser_specified_encodingtNonetFalse(tselftmarkupR ((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pytprepare_markups cCs<>|jjdk r"tjd<00>ntjd|j<00>}|j|d|j <00>}t
|t <00>rjd|_ n|j jjd|_ dS(Ns<4E>You provided a value for parse_only, but the html5lib tree builder doesn't support parse_only. The entire document will be parsed.ttreetencodingi(tsoupt
parse_onlyR twarningstwarnR t
HTMLParsertcreate_treebuildertparseR t
isinstancetunicodetoriginal_encodingt tokenizertstreamt charEncoding(RRtparsertdoc((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pytfeed!s cCst|j|<00>|_|jS(N(tTreeBuilderForHtml5libRtunderlying_builder(RtnamespaceHTMLElements((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR/scCsd|S(sSee `TreeBuilder`.u)<html><head></head><body>%s</body></html>((Rtfragment((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyttest_fragment_to_document4s( t__name__t
__module__t__doc__RRRtfeaturesRR#RR((((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRs    R$cBsYeZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d<00>Z
RS( cCs#||_tt|<00>j|<00>dS(N(RtsuperR$t__init__(RRR&((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR.;s cCs#|jj<00>t|j|jd<00>S(N(RtresettElementR (R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt documentClass?s cCsG|d}|d}|d}tj|||<00>}|jj|<00>dS(NtnametpublicIdtsystemId(Rtfor_name_and_idsRtobject_was_parsed(RttokenR2R3R4tdoctype((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt insertDoctypeCs



cCs(|jj||<00>}t||j|<00>S(N(Rtnew_tagR0(RR2t namespacettag((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt elementClassKscCstt|<00>|j<00>S(N(tTextNodeRR(Rtdata((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt commentClassOscCs1td<00>|_d|j_t|j|jd<00>S(Nts[document_fragment](t BeautifulSoupRR2R0R (R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt fragmentClassRs cCs|jj|j<00>dS(N(Rtappendtelement(Rtnode((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt appendChildWscCs|jS(N(R(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt getDocument[scCstjjjj|<00>jS(N(R t treebuilderst_baset TreeBuildert getFragmentRE(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRL^s( R)R*R.R1R9R=R@RCRGRHRL(((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR$9s        tAttrListcBsPeZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z RS(cCs"||_t|jj<00>|_dS(N(REtdicttattrs(RRE((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR.bs cCst|jj<00><00>j<00>S(N(tlistROtitemst__iter__(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRRescCsd||f||j|<dS(Nsset attr(RE(RR2tvalue((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt __setitem__gs cCst|jj<00><00>S(N(RPRORQ(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRQjscCst|jj<00><00>S(N(RPROtkeys(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRUlscCs t|j<00>S(N(tlenRO(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt__len__nscCs |j|S(N(RO(RR2((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt __getitem__pscCs|t|jj<00><00>kS(N(RPRORU(RR2((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt __contains__rs(
R)R*R.RRRTRQRURWRXRY(((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRMas       R0cBs<>eZd<00>Zd<00>Zd<00>Zd<00>Zeee<00>Zd d<00>Z d<00>Z
d<00>Z d<00>Z d<00>Z d <00>Zd
<00>Zee<00>ZRS( cCs;tjjjj||j<00>||_||_||_dS(N( R RIRJtNodeR.R2RERR;(RRERR;((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR.ws  c Csvd}}t|t<00>r&|}}nCt|t<00>r>|}n+|jjtkr`|j}}n |j}t|t<00> r<>|jdk r<>|jj<00>n|r|jj r|jj djtkr|jj d}|j
j ||<17>}|j |<00>||j
_ nmt|t<00>r)|j
j |<00>}n|jj rJ|jjt<00>}n |j}|j
j|d|jd|<00>dS(Ni<4E><69><EFBFBD><EFBFBD>tparenttmost_recent_element(R Rt
basestringR
REt __class__R R[textracttcontentsRt
new_stringt replace_witht_most_recent_elementt_last_descendantRR6(RRFt string_childtchildt old_elementt new_elementR\((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRG}s0
       cCs t|j<00>S(N(RMRE(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt getAttributes<65>scCs<>|dk r<>t|<00>dkr<>g}xOt|j<00><00>D];\}}t|t<00>r7t|<00>}||=|||<q7q7W|jjj |j
|<00>x'|j<00>D]\}}||j |<q<>W|jjj |j <00>ndS(Ni( R RVRPRQRttupleRRtbuildert$_replace_cdata_list_attribute_valuesR2REtset_up_substitutions(Rt
attributestconverted_attributesR2RStnew_name((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt setAttributes<65>s   cCsH|r7t|jj|<00>|j<00>}|j||<00>n |j|<00>dS(N(R>RRat insertBeforeRG(RR?Rrttext((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt
insertText<78>scCs<>|jj|j<00>}|jjtkr<>|jjr<>|jj|djtkr<>|jj|d}|jj||j<17>}|j|<00>n|jj||j<00>||_ dS(Ni(
REtindexR^R R`RRaRbtinsertR[(RRFtrefNodeRutold_nodetnew_str((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyRr<00>scCs|jj<00>dS(N(RER_(RRF((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt removeChild<6C>sc Cs |j}|j}|j}|jtt<00>}t|j<00>dkr[|jd}|j}nd}|j}|j}|jj} t|<00>dkr<>|d}
||
_||
_ |d} || _d| _nx'|D]} || _
|jj | <00>q<>Wg|_||_dS(s1Move all of this tag's children into another tag.ii<><69><EFBFBD><EFBFBD>N( REt next_siblingRdRRVR`t next_elementR tprevious_elementtprevious_siblingR[RD( Rt
new_parentREtnew_parent_elementtfinal_next_elementtnew_parents_last_descendanttnew_parents_last_childt(new_parents_last_descendant_next_elementt to_appendt append_aftert first_childt
last_childRf((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pytreparentChildren<65>s.        
  
     cCsa|jj|jj|j<00>}t||j|j<00>}x$|jD]\}}||j|<q@W|S(N(RR:RER2R;R0Rn(RR<RFtkeyRS((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt cloneNodes
cCs
|jjS(N(RER`(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt
hasContent scCs4|jdkr td|jfS|j|jfSdS(Nthtml(R;R RR2(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt getNameTuplesN(R)R*R.RGRiRqtpropertyRnR RtRrRzR<>R<>R<>R<>t nameTuple(((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR0vs  .     )   R>cBseZd<00>Zd<00>ZRS(cCs/tjjjj|d<00>||_||_dS(N(R RIRJRZR.R RER(RRER((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR.s cCs
t<00>dS(N(tNotImplementedError(R((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR<79>s(R)R*R.R<>(((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyR>s (t__all__Rt bs4.builderRRRRt bs4.elementRR thtml5lib.constantsRRRR R
RRIRJRKR$tobjectRMRZR0R>(((sXe:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\site-packages\bs4\builder\_html5lib.pyt<module>s  " "#(<1F>