Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 6]/@s,ddlmZddlZddlZddlmZmZmZmZddddgZ dZ d Z d Z d Z d Zd ZGdddeZeZGdddeZGdddeZGdddeZddZGdddeZddlmZeeyddlmZeeWnek rYnXyddlmZeeWnek r&YnXdS)) defaultdictN)CharsetMetaAttributeValueContentMetaAttributeValueHTMLAwareEntitySubstitution whitespace_reHTMLTreeBuilderSAXTreeBuilder TreeBuilderTreeBuilderRegistryZfastZ permissivestrictZxmlZhtmlZhtml5c@s$eZdZddZddZddZdS)r cCstt|_g|_dS)N)rlistbuilders_for_featurebuilders)selfr/usr/lib/python3.6/__init__.py__init__ s zTreeBuilderRegistry.__init__cCs4x |jD]}|j|jd|qW|jjd|dS)z8Register a treebuilder based on its advertised features.rN)featuresr insertr)rZtreebuilder_classfeaturerrrregister$s zTreeBuilderRegistry.registercGst|jdkrdSt|dkr(|jdSt|}|jd}d}xVt|dkr|j}|jj|g}t|dkrB|dkr|}t|}qB|jt|}qBW|dkrdSx|D]}||kr|SqWdS)Nr) lenrr reversepopr getset intersection)rrZ candidatesZ candidate_setrZwe_have_the_feature candidaterrrlookup*s.     zTreeBuilderRegistry.lookupN)__name__ __module__ __qualname__rrrrrrrr sc@steZdZdZdZgZgZdZdZe Z dZ iZ ddZ ddZd d Zd d Zdd dZddZddZddZdS)r z2Turn a document into a Beautiful Soup object tree.z[Unknown tree builder]FNcCs d|_dS)N)soup)rrrrrfszTreeBuilder.__init__cCsdS)Nr)rrrrresetiszTreeBuilder.resetcCs|jdkrdS||jkS)aMight a tag with this name be an empty-element tag? The final markup may or may not actually present this tag as self-closing. For instance: an HTMLBuilder does not consider a

tag to be an empty-element tag (it's not in HTMLBuilder.empty_element_tags). This means an empty

tag will be presented as "

", not "

". The default implementation has no opinion about which tags are empty-element tags, so a tag will be presented as an empty-element tag if and only if it has no contents. "" will become "", and "bar" will be left alone. NT)empty_element_tags)rtag_namerrrcan_be_empty_elementls z TreeBuilder.can_be_empty_elementcCs tdS)N)NotImplementedError)rmarkuprrrfeedszTreeBuilder.feedcCs |dddfS)NFr)rr(Zuser_specified_encodingZdocument_declared_encodingrrrprepare_markupszTreeBuilder.prepare_markupcCs|S)aWrap an HTML fragment to make it look like a document. Different parsers do this differently. For instance, lxml introduces an empty tag, and html5lib doesn't. Abstracting this away lets us write simple tests which run HTML fragments through the parser and compare the results against other HTML fragments. This method should not be used outside of tests. r)rZfragmentrrrtest_fragment_to_documents z%TreeBuilder.test_fragment_to_documentcCsdS)NFr)rtagrrrset_up_substitutionssz TreeBuilder.set_up_substitutionscCs|s|S|jr|jjdg}|jj|jd}xRt|jD]B}||ksT|r<||kr<||}t|trrtj|}n|}|||<qsz.SAXTreeBuilder.startElement..)dictr itemsr"Zhandle_starttag)rnamer5rrr startElementszSAXTreeBuilder.startElementcCs|jj|dS)N)r"Z handle_endtag)rrDrrr endElementszSAXTreeBuilder.endElementcCs|j||dS)N)rE)rnsTuplenodeNamer5rrrstartElementNSszSAXTreeBuilder.startElementNScCs|j|dS)N)rF)rrGrHrrr endElementNSszSAXTreeBuilder.endElementNScCsdS)Nr)rprefixZ nodeValuerrrstartPrefixMappingsz!SAXTreeBuilder.startPrefixMappingcCsdS)Nr)rrKrrrendPrefixMappingszSAXTreeBuilder.endPrefixMappingcCs|jj|dS)N)r"Z handle_data)rcontentrrr charactersszSAXTreeBuilder.characterscCsdS)Nr)rrrr startDocumentszSAXTreeBuilder.startDocumentcCsdS)Nr)rrrr endDocumentszSAXTreeBuilder.endDocumentN)rr r!r:r)r=rErFrIrJrLrMrOrPrQrrrrrsc$@seZdZdZejZedddddddd d d d d ddddddddddddgZeddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.dd/d0d1d2d3d4d5d6d7d8d9d:d;g#Zdgd?d@gd?d@gdAgdAgdAgdBgdCgd?gdDgdEgdFgdG Z dHdIZ dJS)Krz]This TreeBuilder knows facts about HTML. Such as which tags are empty-element tags. areabasebrcolZembedZhrZimginputZkeygenlinkZmenuitemmetaZparamsourceZtrackZwbrZbasefontZbgsoundZcommandframeZimageZisindexZnextidZspacerZaddressZarticleZasideZ blockquoteZcanvasZddZdivZdlZdtZfieldsetZ figcaptionZfigureZfooterformZh1Zh2Zh3Zh4Zh5Zh6headerZlimainZnavZnoscriptZoloutputpZpreZsectiontableZtfootZulZvideoclassZ accesskeyZdropzoneZrelZrevZheaderszaccept-charsetarchiveZsizesZsandboxfor) r.arWtdZthrer[objectrRZiconZiframer^cCsz|jdkrdS|jd}|jd}|jd}d}|dk rJ|}t||d<n(|dk rr|dk rr|jdkrrt||d<|dk S)NrXFz http-equivrNcharsetz content-type)rDrrr0r)rr,Z http_equivrNrgZ meta_encodingrrrr-s      z$HTMLTreeBuilder.set_up_substitutionsN) rr r!r:rr<rr$Zblock_elementsr/r-rrrrrs& N  cCsVtjd}xF|jD]<}t||}t|trt||||jj||jj |qWdS)z9Copy TreeBuilders from the given module into this module.z bs4.builderN) sysmodules__all__getattr issubclassr setattrappendbuilder_registryr)moduleZ this_modulerDobjrrrregister_treebuilders_from2s      rrc@s eZdZdS)ParserRejectedMarkupN)rr r!rrrrrs?srsr>) _htmlparser) _html5lib)_lxml) collectionsr itertoolsrhZ bs4.elementrrrrrjZFASTZ PERMISSIVEZSTRICTZXMLZHTMLZHTML_5rfr ror rrrr Exceptionrsrtru ImportErrorrvrrrrs@ 4b.N