Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 Uñ*WÓGã@spdZddlmZddlZddlZddlZyddlmZWn e k rXddl mZYnXddddd d d gZ ye Z Wnek r�eefZ YnXejdd kZejdƒZejdƒZejdƒZejZd d„Zdd„Zejddd�Zdd„ZejdƒZejdƒZGdd„deƒZ Gdd „d e ƒZ!d#dd „Z"d$dd „Z#Gdd„de$ƒZ%dd„Z&d d!iZ'e(d"k�rlddlZej)ƒdS)%aÑ lxml-based doctest output comparison. Note: normally, you should just import the `lxml.usedoctest` and `lxml.html.usedoctest` modules from within a doctest, instead of this one:: >>> import lxml.usedoctest # for XML output >>> import lxml.html.usedoctest # for HTML output To use this module directly, you must call ``lxmldoctest.install()``, which will cause doctest to use this in all subsequent calls. This changes the way output is checked and comparisons are made for XML or HTML-like content. XML or HTML content is noticed because the example starts with ``<`` (it's HTML if it starts with ```` or include an ``any`` attribute in the tag. An ``any`` tag matches any tag, while the attribute matches any and all attributes. When a match fails, the reformatted example and gotten text is displayed (indented), and a rough diff-like output is given. Anything marked with ``+`` is in the output but wasn't supposed to be, and similarly ``-`` means its in the example but wasn't in the output. You can disable parsing on one line with ``# doctest:+NOPARSE_MARKUP`` é)ÚetreeN)ÚescapeÚ PARSE_HTMLÚ PARSE_XMLÚNOPARSE_MARKUPÚLXMLOutputCheckerÚLHTMLOutputCheckerÚinstallÚ temp_installécCs|dkr dS|jƒSdS)N)Ústrip)Úv©rú&/usr/lib64/python3.6/doctestcompare.pyr ?sr cCs tjd|ƒS)Nú )Ú_norm_whitespace_reÚsub)r rrrÚnorm_whitespaceEsrFT)ZrecoverZremove_blank_textcCs tj|tƒS)N)rZ fromstringÚ _html_parser)ÚhtmlrrrÚhtml_fromstringJsrz^<[^>]+ (at|object) z[ \t\n][ \t\n]+c @s eZdZd0Zd d „Zd d„Zdd„Zdd„Zdd„Zdd„Z dd„Z dd„Z d1dd„Z d2dd „Z d3d!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd4d-d.„Zd/S)5rÚparamÚimgÚareaÚbrÚbasefontÚinputÚbaseÚmetaÚlinkÚcolcCstjS)N)rÚXML)ÚselfrrrÚget_default_parserWsz$LXMLOutputChecker.get_default_parserc Csšt|ddƒ}|dk r |j}|}ntj}|j|||ƒ}|sF|||||ƒSy ||ƒ}Wntjk rhdSXy ||ƒ}Wntjk rŒdSX|j||ƒS)NÚ_temp_override_selfF)ÚgetattrÚ_temp_call_super_check_outputÚ OutputCheckerÚ check_outputÚ get_parserrÚXMLSyntaxErrorÚ compare_docs) r"ÚwantÚgotÚ optionflagsZalt_selfZ super_methodÚparserÚwant_docÚgot_docrrrr(Zs$    zLXMLOutputChecker.check_outputcCstd}t|@rdSt|@rt}nRt|@r.tj}nB|jƒjƒjdƒrT|jƒjdƒrTt}n|j |ƒrp|j |ƒrp|j ƒ}|S)NzrWrX)r"ÚdocrÚindentÚprefixÚpartsr^rrrrXçs@              zLXMLOutputChecker.format_doccCs"|dkr dS|r|jƒ}t|dƒS)NrHrL)r Ú html_escape)r"r=r rrrra s zLXMLOutputChecker.format_textcCslg}t|tjƒrdSx4t|jjƒƒD]"\}}|jd||j|dƒfƒq$W|sXd|jSd|jdj |ƒfS)Nzz)rNrrhr;)r"r^rrrrbs z LXMLOutputChecker.format_end_tagcCsg}t|ƒ r–t|ƒ r–|jd|ƒ|j|j||ƒƒ|j||ƒsl|j|j|j|jƒƒ|j|j||ƒƒ|j|j|j|jƒƒ|jdƒdj|ƒS|jd|ƒ|j|j||ƒƒ|jdƒt |jƒsÖt |jƒ�r|jd|ƒ|j|j|j|jƒƒ|jdƒt |ƒ}t |ƒ}xŒ|�s"|�r |�sL|j|j |j dƒ||ddƒƒ�q|�sv|j|j |j dƒ||ddƒƒ�q|j|j |j dƒ|j dƒ||dƒƒ�qW|jd|ƒ|j|j||ƒƒ|jdƒt |jƒ�sät |jƒ�r|jd|ƒ|j|j|j|jƒƒ|jdƒdj|ƒS)NrrQrHrrRú+ú-)rBrUÚcollect_diff_tagr_Úcollect_diff_textr=Úcollect_diff_end_tagr>rWr rCrXrDrY)r"r,r-rrdrfrFrGrrrrY"sH       $  zLXMLOutputChecker.collect_diffc Cs4|j|j|jƒs"d|j|jf}n|j}g}|jdkp>d|jk}x„t|jjƒƒD]r\}}||jkr„| r„|jd||j|dƒfƒqP||jkr¤|j|j||dƒ}n |j|dƒ}|jd||fƒqPW|�sx@t|jjƒƒD].\}}||jkrðqÜ|jd||j|dƒfƒqÜW|�r(d|dj|ƒf}nd |}|S) Nz %s (got: %s)r9z+%s="%s"Fz%s="%s"z-%s="%s"z<%s %s>rz<%s>) r:r;r?r@rirUrarorW) r"r,r-r;rjr9rkr\r=rrrrnHs*   z"LXMLOutputChecker.collect_diff_tagcCs,|j|jkrd|j|jf}n|j}d|S)Nz %s (got: %s)z)r;)r"r,r-r;rrrrpcs z&LXMLOutputChecker.collect_diff_end_tagcCs:|j|||ƒr"|sdS|j||ƒSd||f}|j||ƒS)NrHz %s (got: %s))r<ra)r"r,r-r r=rrrrojs   z#LXMLOutputChecker.collect_diff_textN) rrrrrrrrrr )T)rH)T)T)Ú__name__Ú __module__Ú __qualname__r]r#r(r)r4r+r<r:rVr_rXrar`rbrYrnrprorrrrrQs& ! #  &c@seZdZdd„ZdS)rcCstS)N)r)r"rrrr#ssz%LHTMLOutputChecker.get_default_parserN)rqrrrsr#rrrrrrscCs|r tt_ntt_dS)z£ Install doctestcompare for all future doctests. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. N)rÚdoctestr'r)rrrrr vsc Csz|r t}nt}tƒ}|jd}|ƒ}|j}||_trJ|jdj}|jj}n|jdj}|jj}t t _ t ||||||ƒdS)zÁ Use this *inside* a doctest to enable this checker for this doctest only. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. r"ZcheckN) rrÚ_find_doctest_frameÚf_localsZ_checkerÚ _IS_PYTHON_3Ú__func__r(Zim_funcrrtÚ_RestoreChecker) rÚ del_moduleZCheckerÚframeÚdt_selfÚcheckerÚ old_checkerÚ check_funcZchecker_check_funcrrrr ‚s"     c@sLeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dS)rycCsD||_||_|j|j_||j_||_||_||_|jƒ|j ƒdS)N) r|r}Ú call_superr&r$rÚ clone_funcrzÚ install_cloneÚinstall_dt_self)r"r|r~Z new_checkerrr�rzrrrÚ__init__ªs z_RestoreChecker.__init__cCsJtr&|jj|_|jj|_|jj|j_n |jj|_|jj|_|jj|j_dS)N)rwrÚ__code__Ú func_codeÚ __globals__Z func_globalsr�)r"rrrr‚µs    z_RestoreChecker.install_clonecCstr|j|j_n |j|j_dS)N)rwr†rr…)r"rrrÚuninstall_clone¾s z_RestoreChecker.uninstall_clonecCs|jj|_||j_dS)N)r|Ú_DocTestRunner__record_outcomeÚ prev_func)r"rrrrƒÃs z_RestoreChecker.install_dt_selfcCs|j|j_dS)N)rŠr|r‰)r"rrrÚuninstall_dt_selfÆsz!_RestoreChecker.uninstall_dt_selfcCsL|jrHddl}|j|j=d|jkrH|jjddƒ\}}|j|}t||ƒdS)NrÚ.rL)rzrSÚmodulesÚrsplitÚdelattr)r"rSÚpackageÚmoduleZ package_modrrrÚuninstall_moduleÈs   z _RestoreChecker.uninstall_modulecOs4|jƒ|jƒ|j`|j`|j||Ž}|jƒ|S)N)rˆr‹r}r$r&rŠr’)r"ÚargsÚkwÚresultrrrÚ__call__Ðs z_RestoreChecker.__call__c Os$|jƒz |j||ŽS|jƒXdS)N)rˆrr‚)r"r“r”rrrr€Øs z_RestoreChecker.call_superN) rqrrrsr„r‚rˆrƒr‹r’r–r€rrrrry©s  rycCs@ddl}|jdƒ}x |r2|j}d|kr*|S|j}qWtdƒ‚dS)NrrLZBOOMzBCould not find doctest (only use this function *inside* a doctest))rSÚ _getframervÚf_backÚ LookupError)rSr{Úlrrrrußs  ruZbasicai >>> temp_install() >>> print """stuff""" ... >>> print """""" >>> print """blahblahblah""" # doctest: +NOPARSE_MARKUP, +ELLIPSIS ...foo /> Ú__main__)F)FN)*Ú__doc__ZlxmlrrSrIrtrrrgÚ ImportErrorZcgiÚ__all__Z basestringrOÚ NameErrorÚstrÚbytesÚ version_inforwZregister_optionflagrrrr'r rZ HTMLParserrrÚcompiler6rrrr r ÚobjectryruZ__test__rqZtestmodrrrrÚ$sL       # '6