Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
lxml
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/lxml/doctestcompare.pyc
mò ÔZ´Gc @ sm d Z d k l Z d k Z d k Z d k Z d d d d d d d g Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i Z d „ Z d „ Z e i d e d e ƒ Z d „ Z e i d ƒ Z e i d ƒ Z d e f d „ ƒ YZ d e f d „ ƒ YZ e d „ Z e e d „ Z d e f d „ ƒ YZ d „ Z h d d <Z e d j o d k Z e i ƒ n d S( sÑ 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 ``<html``). You can also use the ``PARSE_HTML`` and ``PARSE_XML`` flags to force parsing. Some rough wildcard-like things are allowed. Whitespace is generally ignored (except in attributes). In text (attributes and text in the body) you can use ``...`` as a wildcard. In an example it also matches any trailing tags in the element, though it does not match leading tags. You may create a tag ``<any>`` 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`` ( s etreeNt PARSE_HTMLt PARSE_XMLt NOPARSE_MARKUPt LXMLOutputCheckert LHTMLOutputCheckert installt temp_installc C s# | d j o d Sn | i ƒ Sd S( N( t vt Nonet strip( R ( ( t7 /usr/lib/python2.4/site-packages/lxml/doctestcompare.pyR 4 s c C s t i d | ƒ S( Nt ( t _norm_whitespace_ret subR ( R ( ( R t norm_whitespace: s t recovert remove_blank_textc C s t i | t ƒ S( N( t etreet fromstringt htmlt _html_parser( R ( ( R t html_fromstring? s s ^<[^>]+ (at|object) s [ \t\n][ \t\n]+c B s³ t Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z e d „ Z d d „ Z e d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z e d „ Z RS( Nt paramt imgt areat brt basefontt inputt baset metat linkt colc C s t i S( N( R t XML( t self( ( R t get_default_parserL s c C sØ t | d d ƒ } | d j o | i } | } n t i } | i | | | ƒ } | p | | | | | ƒ Sn y | | ƒ } Wn t i j o t Sn Xy | | ƒ } Wn t i j o t Sn X| i | | ƒ S( Nt _temp_override_self( t getattrR! R t alt_selft _temp_call_super_check_outputt super_methodt OutputCheckert check_outputt get_parsert wantt gott optionflagst parsert want_docR t XMLSyntaxErrort Falset got_doct compare_docs( R! R+ R, R- R' R. R% R2 R/ ( ( R R) O s"