403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/paste/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/paste/fixture.pyc
Ic@sdZddkZddkZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkl
Z
yddklZWn#ej
oddklZnXddkZyddkZWn#ej
oddklZnXddklZddklZddklZd	Zd
efdYZdZd
efdYZdefdYZ defdYZ!defdYZ"defdYZ#defdYZ$defdYZ%ei&dei'Z(dZ)defdYZ*de*fd YZ+e+e*i,d!<d"e+fd#YZ-e-e*i,d$<d%e*fd&YZ.e.e*i,d'<d(e*fd)YZ/e/e*i,d*<d+e/fd,YZ0e0e*i,d-<d.e/fd/YZ1e1e*i,d0<d1e*fd2YZ2e2e*i,d3<e2e*i,d4<e2e*i,d5<d6efd7YZ3d8efd9YZ4d:efd;YZ5d<efd=YZ6e7d>Z8e7e7e9d?Z:d@Z;e7dAZ<dBZ=dS(Cs
Routines for testing WSGI applications.

Most interesting is the `TestApp <class-paste.fixture.TestApp.html>`_
for testing WSGI applications, and the `TestFileEnvironment
<class-paste.fixture.TestFileEnvironment.html>`_ class for testing the
effects of command-line scripts.
iN(t
BaseCookie(tStringIO(tsubprocess24(twsgilib(tlint(t
HeaderDictcGs
ti|S(s
    An os.tempnam with the warning turned off, because sometimes
    you just need to use this and don't care about the stupid
    security warning.
    (tosttempnam(targs((s1/usr/lib/python2.6/site-packages/paste/fixture.pyttempnam_no_warning&st	NoDefaultcBseZRS((t__name__t
__module__(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR
.scCst|}|i|S(N(tlisttsort(tl((s1/usr/lib/python2.6/site-packages/paste/fixture.pytsorted1s
t
Dummy_smtplibcBsGeZdZdZdZdZdZeeZdZ	RS(cCsVddk}|idtd|ip
td||_t|_||i_dS(Nis1Dummy_smtplib is not maintained and is deprecatedisIsmtplib.SMTP() called again before Dummy_smtplib.existing.reset() called.(	twarningstwarntDeprecationWarningtexistingtAssertionErrortservertTruetopent	__class__(tselfRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__init__:s
		cCs%|iptd|t|_dS(NsCalled %s.quit() twice(RRtFalse(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pytquitFs
cCs||_||_||_dS(N(tfrom_addresstto_addressestmessage(RRR tmsg((s1/usr/lib/python2.6/site-packages/paste/fixture.pytsendmailKs		cCs
|t_dS(N(tsmtplibtSMTP(tcls((s1/usr/lib/python2.6/site-packages/paste/fixture.pytinstallPscCs%|ip
tdd|i_dS(NsSMTP connection not quit(RRtNoneRR(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pytresetUsN(
RRR(RRRR#R'tclassmethodR)(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR6s				tAppErrorcBseZRS((RR(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR+ZstTestAppcBseZeZddddddZdZdZddddedZ	dddddedZ
dddddedZdddddedZddddedZ
d	Zd
ZdZdZd
ZdZdZRS(cCst|ttfo&ddkl}||d|}n||_||_||_|djo
h}n||_	||_
||_|idS(s}
        Wraps a WSGI application in a more convenient interface for
        testing.

        ``app`` may be an application, or a Paste Deploy app
        URI, like ``'config:filename.ini#test'``.

        ``namespace`` is a dictionary that will be written to (if
        provided).  This can be used with doctest or some other
        system, and the variable ``res`` will be assigned everytime
        you make a request (instead of returning the request).

        ``relative_to`` is a directory, and filenames used for file
        uploads are calculated relative to this.  Also ``config:``
        URIs that aren't absolute.

        ``extra_environ`` is a dictionary of values that should go
        into the environment for each request.  These can provide a
        communication channel with the application.

        ``pre_request_hook`` is a function to be called prior to
        making requests (such as ``post`` or ``get``). This function
        must take one argument (the instance of the TestApp).

        ``post_request_hook`` is a function, similar to
        ``pre_request_hook``, to be called after requests are made.
        i(tloadapptrelative_toN(
t
isinstancetstrtunicodetpaste.deployR-tappt	namespaceR.R(t
extra_environtpre_request_hooktpost_request_hookR)(RR3R4R.R5R6R7R-((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRbs			

			cCs
h|_dS(sc
        Resets the state of the application; currently just clears
        saved cookies.
        N(tcookies(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR)scCs|ii}t|d<|S(Nspaste.throw_errors(R5tcopyR(Rtenviron((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
_make_environs
c
Cs|djo
h}nt}|obt|ttfpti|dt}nd|jo|d7}n|d7}||7}n|i}t|}d|jo |idd\}|d<nd|d<|i	|||i
|t|||}	|i|	d|S(	s
        Get the given url (well, actually a path like
        ``'/page.html'``).

        ``params``:
            A query string, or a dictionary that will be encoded
            into a query string.  You may also include a query
            string on the ``url``.

        ``headers``:
            A dictionary of extra headers to send.

        ``extra_environ``:
            A dictionary of environmental variables that should
            be added to the request.

        ``status``:
            The integer status code you expect (if not 200 or 3xx).
            If you expect a 404 response, for instance, you must give
            ``status=404`` or it will be an error.  You can also give
            a wildcard, like ``'3*'`` or ``'*'``.

        ``expect_errors``:
            If this is not true, then if anything is written to
            ``wsgi.errors`` it will be an error.  If it is true, then
            non-200/3xx responses are also okay.

        Returns a `response object
        <class-paste.fixture.TestResponse.html>`_
        tdoseqt?t&itQUERY_STRINGttstatusN(
R(RR/R0R1turllibt	urlencodeR;tsplitt_set_headerstupdatetTestRequestt
do_request(
RturltparamstheadersR5RAt
expect_errorst__tracebackhide__R:treq((s1/usr/lib/python2.6/site-packages/paste/fixture.pytgets& 




 

R@c	Cs|d
jo
h}n|d
jo
h}n|i}	t|tttfoti|}nt|doti|i	}n|o;t
i|dt}|i
||\}
}|
|	d<n|o|	iddnd|jo |idd\}|	d<nd|	d<tt||	d	<||	d
<t||	d<|i||	|	i|t||	|}|i|d|S(s)
        Do a generic request.  
        titemstkeep_blank_valuestCONTENT_TYPEs!application/x-www-form-urlencodedR=iR?R@tCONTENT_LENGTHtREQUEST_METHODs
wsgi.inputRAN(R(R;R/R
ttupletdictRBRCthasattrRPtcgit	parse_qslRtencode_multipartt
setdefaultRDR0tlenRRERFRGRH(RtmethodRIRJRKR5RAtupload_filesRLR:tcontent_typeRN((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt_gen_requests4




 


cCs4|id|d|d|d|d|d|d|S(s
        Do a POST request.  Very like the ``.get()`` method.
        ``params`` are put in the body of the request.

        ``upload_files`` is for file uploads.  It should be a list of
        ``[(fieldname, filename, file_content)]``.  You can also use
        just ``[(fieldname, filename)]`` and the file content will be
        read from disk.

        Returns a `response object
        <class-paste.fixture.TestResponse.html>`_
        tPOSTRJRKR5RAR^RL(R`(RRIRJRKR5RAR^RL((s1/usr/lib/python2.6/site-packages/paste/fixture.pytpostscCs4|id|d|d|d|d|d|d|S(s
        Do a PUT request.  Very like the ``.get()`` method.
        ``params`` are put in the body of the request.

        ``upload_files`` is for file uploads.  It should be a list of
        ``[(fieldname, filename, file_content)]``.  You can also use
        just ``[(fieldname, filename)]`` and the file content will be
        read from disk.

        Returns a `response object
        <class-paste.fixture.TestResponse.html>`_
        tPUTRJRKR5RAR^RL(R`(RRIRJRKR5RAR^RL((s1/usr/lib/python2.6/site-packages/paste/fixture.pytputscCs4|id|d|d|d|d|ddd|S(	s
        Do a DELETE request.  Very like the ``.get()`` method.
        ``params`` are put in the body of the request.

        Returns a `response object
        <class-paste.fixture.TestResponse.html>`_
        tDELETERJRKR5RAR^RLN(R`R((RRIRJRKR5RARL((s1/usr/lib/python2.6/site-packages/paste/fixture.pytdeletes	cCs|pdSxz|iD]l\}}|idjo
d}n:|idjo
d}nd|iddi}|||<qWdS(	s9
        Turn any headers into environ variables
        Nscontent-typeRRscontent-lengthRSsHTTP_%st-t_(RPtlowertreplacetupper(RRKR:theadertvaluetvar((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRE+s


cCsDdti}g}xP|D]H\}}|id||id||id|i|qWx|D]}|i|\}}}|id||id||fti|d}	|id|	pd|id|i|qpW|id|d|idd	i|}
d
|}||
fS(s
        Encodes a set of parameters (typically a name/value list) and
        a set of files (a list of (name, filename, file_body)) into a
        typical POST body, returning the (content_type, body).
        s----------a_BoUnDaRy%s$s--s)Content-Disposition: form-data; name="%s"R@s8Content-Disposition: form-data; name="%s"; filename="%s"isContent-Type: %ssapplication/octet-streams
s multipart/form-data; boundary=%s(trandomtappendt_get_file_infot	mimetypest
guess_typetjoin(RRJtfilestboundarytlinestkeyRmt	file_infotfilenametfcontenttbodyR_((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRZ:s0
		


cCst|djog|d}|iotii|i|}nt|d}|i}|i|d||fSt|djo|Stdt	|d dS(Niitrbiisuupload_files need to be a list of tuples of (fieldname, filename, filecontent) or (fieldname, filename); you gave: %rid(
R\R.RtpathRtRtreadtcloset
ValueErrortrepr(RRyRztftcontent((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRqWs


cCs|io|i|nt}|iot}x'|iiD]\}}|||<qDWdig}|iD]"}|di|i|igqu~}	|	|i	d<nt|i	d<h|i	d<t
i|i}
t
i}t|}zP|t
_ti}
|i}ti|
|id||i	}ti}Wd|t
_t
ii|iX|i|||
}||_xU|i	diD]@\}}t||otd|nt|||qW|idj	o||id	<n|ip!|i|||i |nh|_!x`|i"d
D]O}t|}x:|iD],\}}|i|i|<|i|i!|<qcWqDW|i#o|i#|n|idjo|SdS(s
        Executes the given request (``req``), with the expected
        ``status``.  Generally ``.get()`` and ``.post()`` are used
        instead.
        s; t=tHTTP_COOKIEs
paste.testingspaste.testing_variablestraise_on_wsgi_errorNsopaste.testing_variables contains the variable %r, but the response object already has an attribute by that nametress
set-cookie($R6RR8RRPRttvaluesRxRmR:Rt
middlewareR3tsyststdoutt
CaptureStdoutttimeRLRtraw_interactiveRItstderrtwritetgetvaluet_make_responsetrequestRWRtsetattrR4R(t
_check_statust
_check_errorstcookies_settall_headersR7(RRNRARMtctnameRmt_[1]tmthcR3t
old_stdouttoutt
start_timeRtraw_restend_timeRRlRxtmorsel((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRHjsh

	E

		
		
	

cCs
t}|djodSt|ttfoS|i|jo>td|iditt	||i
i|ifndS|djoN|idjo|idjodStd|i|i
i|ifn||ijotd|i|fndS(Nt*s*Bad response: %s (not one of %s for %s)
%ss, iis7Bad response: %s (not 200 OK or 3xx redirect for %s)
%ssBad response: %s (not %s)(RR/R
RURAR+tfull_statusRttmapR0RRIR|R((RRARRM((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs(

 cCs%|iotd|indS(Ns!Application had errors logged:
%s(terrorsR+(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs
cCs+|\}}}}t||||||S(N(tTestResponse(Rt.1t
total_timeRARKR|R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRsN(RRRtdisabledR(RR)R;RROR`RbRdRfRERZRqRHRRR(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR,]s.+			6	"							<		RcBs5eZdZdZdZdZdZRS(cCst|_||_dS(N(Rtcapturedtactual(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs$|ii||ii|dS(N(RRR(Rts((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs|iidS(N(Rtflush(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs"x|D]}|i|qWdS(N(R(RRwtitem((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
writelinesscCs
|iiS(N(RR(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs(RRRRRRR(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs
				RcBs2eZeZdZdZeeddZdZeeddZ	e
ide
ie
i
BZdZedZd	Zd
ZdddddedZdddddedZd
ZddZe
idZdZeeddZdZdZdZdZ dZ!RS(cCsz||_t|id|_||_||_ti|i|_||_	||_
d|_||_
d|_dS(Ni(ttest_apptintRDRARRKRtfromlisttheader_dictR|RR(t_normal_bodyRt_forms_indexed(RRRARKR|RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs							cCs%|idjo|in|iS(s
        Returns a dictionary of ``Form`` objects.  Indexes are both in
        order (from zero) and by form id (if the form is given an id).
        N(RR(t_parse_forms(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
forms__getstdocs
                     A list of <form>s found on the page (instances of
                     `Form <class-paste.fixture.Form.html>`_)
                     cCsE|i}|ptdnd|jotdn|dS(Ns*You used response.form, but no forms existis5You used response.form, but more than one form existsi(tformst	TypeError(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt	form__gets	


s
                    Returns a single `Form
                    <class-paste.fixture.Form.html>`_ instance; it
                    is an error if there are multiple forms on the
                    page.
                    s<(/?)([:a-z0-9_\-]*)(.*?)>c
CsZh}|_g}d}x|ii|iD]}|iddj}|idi}|djoq/n|oB|ptd|i|i	|i||i
!d}q/|ptd|i|i}q/W|ptd|i|xNt|D]@\}}t||}	|	||<|	i
o|	||	i
<qqWdS(Nit/itforms</form> unexpected at %ssNested form tags at %ssDanging form: %r(RR(t_tag_retfinditerR|tgroupRiRtstartRptendt	enumeratetFormtid(
RRt
form_textststartedtmatchRttagtittextR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs2






c	
Csd}xY|iD]N\}}|i|ijo)|ptd|||f|}qqW|djo\|tjoGtd|dig}|iD]\}}||q~fq|Sn|S(s
        Returns the named header; an error if there is not exactly one
        matching header (unless you give a default -- always an error
        if there is more than one header)
        s&Ambiguous header: %s matches %r and %rsNo header found: %r (from %s)s, N(R(RKRiRR
tKeyErrorRt(	RRtdefaulttfoundtcur_nameRmRtntv((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRl.s


AcCsNg}xA|iD]6\}}|i|ijo|i|qqW|S(sE
        Gets all headers by the ``name``, returns as a list
        (RKRiRp(RRRRRm((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRDs
cKs}|idjo|idjptd|i|id}ti|\}}ti|\}}|ii||S(s
        If this request is a redirect, follow that redirect.  It
        is an error if this is not a redirect response.  Returns
        another response object.
        i,is/You can only follow redirect responses (not %s)tlocation(	RARRRlRBt	splittypet	splithostRRO(RtkwRttypetrestthostR~((s1/usr/lib/python2.6/site-packages/paste/fixture.pytfollowNs#cCsbt}|idddddd
d|d|d|d	|d
|d|	\}}	}
|i|
dS(s
        Click the link as described.  Each of ``description``,
        ``linkid``, and ``url`` are *patterns*, meaning that they are
        either strings (regular expressions), compiled regular
        expressions (objects with a ``search`` method), or callables
        returning true or false.

        All the given patterns are ANDed together:

        * ``description`` is a pattern that matches the contents of the
          anchor (HTML and all -- everything between ``<a...>`` and
          ``</a>``)

        * ``linkid`` is a pattern that matches the ``id`` attribute of
          the anchor.  It will receive the empty string if no id is
          given.

        * ``href`` is a pattern that matches the ``href`` of the anchor;
          the literal content of that attribute, not the fully qualified
          attribute.

        * ``anchor`` is a pattern that matches the entire anchor, with
          its contents.

        If more than one link matches, then the ``index`` link is
        followed.  If ``index`` is not given and more than one link
        matches, or if no link matches, then ``IndexError`` will be
        raised.

        If you give ``verbose`` then messages will be printed about
        each link, and why it does or doesn't match.  If you use
        ``app.click(verbose=True)`` you'll see a list of all the
        links.

        You can use multiple criteria to essentially assert multiple
        aspects about the link, e.g., where the link's destination is.
        Rtat	href_attrthrefthref_extractRRthref_patternthtml_patterntindextverboseturiN(Rt
_find_elementR(tgoto(RtdescriptiontlinkidRtanchorRRRMt
found_htmlt
found_desctfound_attrs((s1/usr/lib/python2.6/site-packages/paste/fixture.pytclick]s'	cCskt}|idddddtidd|d|d	|d
|d|d|	\}}	}
|i|
d
S(s
        Like ``.click()``, except looks for link-like buttons.
        This kind of button should look like
        ``<button onclick="...location.href='url'...">``.
        RtbuttonRtonclickRslocation\.href='(.*?)'RRRRRRR(RRtretcompileR(RRtbuttonidRRRRRMRRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pytclickbuttons	c
sAt|}
t|}t|}t|}
tid||ftiti}fd}g}d}x|i|iD]}|id}|id}|id}t|}o|d|n|i	|p|d|qn||}|o:|i
|}|p|dqn|id}n||d	<|id
o|dqn|ido|d
qn|d7}|
o|
|o|dqn|o+||i	ddo|dqn|o||o|dqn|
o|
|o|dqn|d|i|||fqW|pt
d|n|djoht|djoGt
ddig}|D]\}}}|t|q~n|d}nDy||}Wn2t
j
o&t
dt|||fnX|S(Ns<%s\s+(.*?)>(.*?)</%s>cso	|GHndS(N((R(R(s1/usr/lib/python2.6/site-packages/paste/fixture.pytprintlogsiiisElement: %rs  Skipped: no %s attributes(  Skipped: doesn't match extract patternRt#s&  Skipped: only internal fragment hrefsjavascript:s$  Skipped: cannot follow javascript:s$  Skipped: doesn't match descriptionRR@s  Skipped: doesn't match ids  Skipped: doesn't match hrefs  Skipped: doesn't match htmls
  Accepteds-No matching elements found (from %s possible)sMultiple links match: %ss, s6Only %s (out of %s) links match; index %s out of range(t
_make_patternRRtItSRR|Rt_parse_attrsROtsearcht
startswithRpt
IndexErrorR(R\RtR(RRRRRRRRRRtcontent_pattid_patthref_patthtml_patRRtfound_linksttotal_linksRtel_htmltel_attrt
el_contenttattrstel_hrefRRtanctdtattrt
found_link((Rs1/usr/lib/python2.6/site-packages/paste/fixture.pyRs






!




AROc	Ksti|\}}}}}d}}}ti|||||f}ti|ii|}|i}|djptd||djo|ii	}n
|ii
}|||S(s
        Go to the (potentially relative) link ``href``, using the
        given method (``'get'`` or ``'post'``) and any extra arguments
        you want to pass to the ``app.get()`` or ``app.post()``
        methods.

        All hostnames and schemes will be ignored.
        R@RORbs9Only "get" or "post" are allowed for method (you gave %r)(sgetspost(turlparseturlsplitt
urlunsplitturljoinRtfull_urlRiRRRORb(	RRR]RtschemeRR~tquerytfragment((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs	
s
[ \n\r\t]+cCs6|idjo|iid|i|_n|iS(Nt (RR(t_normal_body_regextsubR|(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pytnormal_body__gets	s]
                           Return the whitespace-normalized body
                           cCsxt|ttfpt|}nt|to|id}n|ii|djp|ii|djS(s
        A response 'contains' a string if it is present in the body
        of the response.  Whitespace is normalized when searching
        for a string.
        tutf8i(R/R0R1tencodeR|tfindtnormal_body(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__contains__scOsd|jo2|d}|d=t|to
|g}qEng}|otdnxM|D]E}||jo2tid|IJti|IJtd|qcqcWxM|D]E}||jo2tid|IJti|IJtd|qqWdS(s
        Assert that the response contains all of the strings passed
        in as arguments.

        Equivalent to::

            assert string in res
        tnos)The only keyword argument allowed is 'no'sActual response (no %r):sBody does not contain string %rsActual response (has %r)sBody contains string %rN(R/t
basestringRRRR(RtstringsRRRtno_s((s1/usr/lib/python2.6/site-packages/paste/fixture.pytmustcontain!s.	






cCsd|i|id fS(Ns<Response %s %r>i(RR|(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__repr__AscCsdig}|iiD]}|io||qq~}d|idig}|iD]\}}|d||fqa~|fS(Ns
sResponse: %s
%s
%ss%s: %s(RtR|t
splitlineststripRARK(RRRtsimple_bodyt_[2]RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__str__Ds $:cCsrddk}tddd}t|d}|i|i|id|iti	d}|i
|dS(s{
        Show this response in a browser window (for debugging purposes,
        when it's hard to read the HTML).
        iNs
paste-fixtures.htmltwbsfile:R(t
webbrowserR	R(RRR|RRjRtseptopen_new(RR*tfnRRI((s1/usr/lib/python2.6/site-packages/paste/fixture.pytshowbrowserLs
N("RRRRRRtpropertyRRRRRRRRRR
RlRRR(RRRRRRRRRR"R#R(R.(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs8	
									
		1		M					 		RGcBseZeZedZRS(cCsu|ido|td}n||_||_|ido|d|d|_n
||_||_dS(Nshttp://localhostR?R=(RR\RIR:RORRL(RRIR:RL((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRss			(RRRRRR(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRGYsRcBseZdZeideiZdZdZdZ	dZ
dZddZ
dedZdd	Zddd
ZdddZRS(
s
    This object represents a form that has been found in a page.
    This has a couple useful attributes:

    ``text``:
        the full HTML of the form.

    ``action``:
        the relative URI of the action.

    ``method``:
        the method (e.g., ``'GET'``).

    ``id``:
        the id, or None if not given.

    ``fields``:
        a dictionary of fields, each value is a list of fields by
        that name.  ``<input type="radio">`` and ``<select>`` are
        both represented as single fields with multiple options.
    s<(/?)([:a-z0-9_\-]*)([^>]*?)>cCs*||_||_|i|idS(N(tresponseRt
_parse_fieldst
_parse_action(RR0R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs		
cCsad}d}h}x?|ii|iD](}|iddj}|idi}|djoq(n|djo2|o+|ptd	|id
d}q(n|djoV|oO|ptd|it|i|d|i!|d
_	d}q(n|oq(nt
|id}d
|jo|id
}nd}|djo,|ii
|idd|jfq(n|djo|iddjo|i|}	|	p;t||||i|}	|i|gi
|	n"|	d
}	t|	tpt|	ii
|idd|jfq(n|}
|djo|iddi}
ntii|
t}|||||i|}	|djo;|ptd||id
f|	|if}n=|djo/|ptd||id
f|	}n|i|gi
|	q(W||_dS(NiRitinputtselecttoptionttextareaRs%r without starting selectis$</textarea> with no <textarea> at %siRRmtselectedRtradiotcheckedRsNested textareas: %r and %rsNested selects: %r and %r(sinputsselectsoptionR6sbutton(R(RRRRRiRRthtml_unquoteRmRtpoptoptionsRpROtRadioR[R/tFieldtclassesRtfields(Rt	in_selecttin_textareaR@RRRRRtfieldttag_typet
FieldClass((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR1st


'

#




cCsd|_x|ii|iD]}|iddj}|idi}|djoqn|oPnt|id}|idd|_|idd	|_	|id
|_
qWdp
td|idj	p
td
dS(NiRiRitactionR@R]tGETRisNo </form> tag foundsNo <form> tag found(R(RFRRRRRiRROR]RR(RRRRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR2s 	
cCs|ii|}|dj	p/td|ditt|iift|djp&td|ditt|f||d_	dS(s
        Set the value of the named field.  If there is 0 or multiple
        fields by that name, it is an error.

        Setting the value of a ``<select>`` selects the given option
        (and confirms it is an option).  Setting radio fields does the
        same.  Checkboxes get boolean values.  You cannot set hidden
        fields or buttons.

        Use ``.set()`` if there is any ambiguity and you must provide
        an index.
        s*No field by the name %r found (fields: %s)s, isMultiple fields match %r: %siN(
R@ROR(RRtRRtkeysR\Rm(RRRmR@((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__setitem__s
) cCsn|ii|}|dj	ptd|t|djp&td|ditt|f|dS(sE
        Get the named field object (ambiguity is an error).
        sNo field by the name %r foundisMultiple fields match %r: %ss, iN(R@ROR(RR\RtRR(RRR@((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt__getitem__s cCs_|djo|||<nA|ii|}|dj	ptd|||}||_dS(sF
        Set the given name, using ``index`` to disambiguate.
        sNo fields found matching %rN(R(R@RORRm(RRRmRR@RC((s1/usr/lib/python2.6/site-packages/paste/fixture.pytsets

cCs|ii|}|djo|tj	o|S|djo	||S|ii|}|dj	ptd|||}|SdS(sb
        Get the named/indexed field object, or ``default`` if no field
        is found.
        sNo fields found matching %rN(R@ROR(R
R(RRRRR@RC((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRO!s
	
cCs9|i|d|}t|tpt||_dS(s]
        Like ``.set()``, except also confirms the target is a
        ``<select>``.
        RN(ROR/tSelectRRm(RRRmRRC((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR42scKs:|i|d|}|ii|id|id||S(s
        Submits the form.  If ``name`` is given, then also select that
        button (using ``index`` to disambiguate)``.

        Any extra keyword arguments are passed to the ``.get()`` or
        ``.post()`` method.
        RR]RJ(t
submit_fieldsR0RRFR](RRRRR@((s1/usr/lib/python2.6/site-packages/paste/fixture.pytsubmit;scCsg}|dj	o5|i|d|}|i|i|ifnxr|iiD]a\}}|djoqXnx>|D]6}|i}|djoqn|i||fqWqXW|S(sf
        Return a list of ``[(name, value), ...]`` for the current
        state of the form.
        RN(R(RORpRtvalue_if_submittedR@RPRm(RRRRNRCR@Rm((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRMGs
 
	
N(RRt__doc__RRRRRR1R2RIRJR(RKR
ROR4RNRM(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs		=			
	sH([^= \n\r\t]+)[ \n\r\t]*(?:=[ \n\r\t]*(?:"([^"]*)"|([^"][^ \n\r\t>]*)))?cCsuh}xhti|D]W}|idi}|idp
|id}t|pd}|||<qW|S(NiiiR@(t_attr_reRRRiR:(RRRt	attr_namet	attr_body((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR]sR>cBsSeZdZhZeZdddZdZdZ	dZ
ee
eZRS(s
    Field object.
    cKsC||_||_||_||_||_||_||_dS(N(RRRtpost_valueRR(RRRRRTRmRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRqs						cCs7|ip td|i|ifn||_dS(Ns-You cannot set the value of the <%s> field %r(tsettabletAttributeErrorRRRU(RRm((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
value__set{s

cCs
||_dS(s^
        Like setting a value, except forces it even for, say, hidden
        fields.
        N(RU(RRm((s1/usr/lib/python2.6/site-packages/paste/fixture.pytforce_valuescCs|iS(N(RU(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
value__getsN(
RRRPR?RRVR(RRXRYRZR/Rm(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR>fs				RLcBs8eZdZdZdZdZeeeZRS(s)
    Field representing ``<select>``
    cOsVtt|i||g|_|id|_|ip
tdd|_dS(Ntmultiples#<select multiple> not yet supported(	tsuperRLRR<ROR[RR(t
selectedIndex(RRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs	cCsxt|iD]3\}\}}|t|jo||_PqqWtd|dig}|iD]\}}|t|qd~fdS(NsOption %r not found (from %s)s, (RR<R0R]RRtR(RRmRR5R9RtoR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRXs			cCsk|idj	o|i|idSxA|iD]\}}|o|Sq-W|io|iddSdSdS(Ni(R]R(R<(RR5R9((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRZs
	
(RRRPRRXRZR/Rm(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRLs
				
R4R=cBseZdZRS(s5
    Field representing ``<input type="radio">``
    (RRRP(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR=sR8tCheckboxcBs8eZdZdZdZdZeeeZRS(s8
    Field representing ``<input type="checkbox">``
    cOs,tt|i||d|j|_dS(NR9(R\R_RR9(RRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs||_dS(N(R9(RRm((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRXscCs2|io |idjodS|iSndSdS(Nton(R9RUR((R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRZs

(RRRPRRXRZR/Rm(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR_s
				tcheckboxtTextcBseZdZdddZRS(s4
    Field representing ``<input type="text">``
    R@cKs,ti|||||d|d||dS(NRmR(R>R(RRRRRTRmRR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRsN(RRRPR(R(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRbsRtTextareacBseZdZRS(s+
    Field representing ``<textarea>``
    (RRRP(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRcsR6tHiddencBseZdZRS(s6
    Field representing ``<input type="hidden">``
    (RRRP(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRdsthiddentSubmitcBs2eZdZeZdZeeZdZRS(sG
    Field representing ``<input type="submit">`` and ``<button>``
    cCsdS(N(R((R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRZscCs|iS(N(RU(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyROs(	RRRPRRVRZR/RmRO(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRfs
	RNRtimagetTestFileEnvironmentcBsweZdZeZd	d	d	d	ed	edZdZdZdZ	dZ
dZdZd	d	dZ
RS(
se
    This represents an environment in which files will be written, and
    scripts will be run.
    c		Cs||_||_|djotii}n||_|djoNtidjo|iddi	d}q|iddi	d}n||_
|djo
|}n||_|o|in%ti
i|pti|n|pg|_||_dS(s
        Creates an environment.  ``base_path`` is used as the current
        working directory, and generally where changes are looked for.

        ``template_path`` is the directory to look for *template*
        files, which are files you'll explicitly add to the
        environment.  This is done with ``.writefile()``.

        ``script_path`` is the PATH for finding executables.  Usually
        grabbed from ``$PATH``.

        ``environ`` is the operating system environment,
        ``os.environ`` if not given.

        ``cwd`` is the working directory, ``base_path`` by default.

        If ``start_clear`` is true (default) then the ``base_path``
        will be cleared (all files deleted) when an instance is
        created.  You can also use ``.clear()`` to clear the files.

        ``ignore_paths`` is a set of specific filenames that should be
        ignored when created in the environment.  ``ignore_hidden``
        means, if true (default) that filenames and directories
        starting with ``'.'`` will be ignored.
        twin32tPATHR@t;t:N(t	base_patht
template_pathR(RR:R9RtplatformRORDtscript_pathtcwdtclearR~texiststmakedirstignore_pathst
ignore_hidden(	RRmRnRpR:Rqtstart_clearRuRv((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs&		
	
	

	cOst}t|dt}t|d|}t|d|i}t|dd}t|dt}	tt|}|ptddi|i	d|joG|ptd	||f|i
dd
\}}ti
|}n|i|}|g|}
|i
}ti|
dtidtidtid|d
|i}|i|\}
}|i
}t||
||
|d|id|d|}|	o|GHddGHn|p|in|p|in|S(s
        Run the command, with the given arguments.  The ``script``
        argument can have space-separated arguments, or you can use
        the positional arguments.

        Keywords allowed are:

        ``expect_error``: (default False)
            Don't raise an exception in case of errors
        ``expect_stderr``: (default ``expect_error``)
            Don't raise an exception if anything is printed to stderr
        ``stdin``: (default ``""``)
            Input to the script
        ``printresult``: (default True)
            Print the result after running
        ``cwd``: (default ``self.cwd``)
            The working directory to run in

        Returns a `ProcResponse
        <class-paste.fixture.ProcResponse.html>`_ object.
        texpect_errort
expect_stderrRqtstdintprintresultsArguments not expected: %ss, Rs?You cannot give a multi-argument script (%r) and arguments (%s)iRRtenvt
returncodetfiles_beforetfiles_afterRgi(N(Rt_popgetRRqR(RR0RRtRHRDtshlext	_find_exet_find_filest
subprocesstPopentPIPER:tcommunicatet
ProcResultR}tassert_no_errortassert_no_stderr(RtscriptRRRMRxRyRqRzR{tallR~tprocRRRtresult((s1/usr/lib/python2.6/site-packages/paste/fixture.pytrunKsL

				
cCs|idjoDtii|i|}tii|ptd|n|Sx>|iD]3}tii||}tii|o|Sq^Wtd|di|ifdS(NsScript %s does not exists"Script %s could not be found in %sRl(RpR(RR~RtRqRstOSError(Rtscript_nameR~R-((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs
	cCsNh}xAti|iD]-}|i|oqn|i||qW|S(N(RtlistdirRmt_ignore_filet_find_traverse(RRR-((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCsD||ijotS|io!tii|idotStS(Nt.(RuRRvRR~tbasenameRR(RR-((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs
&cCstii|i|}tii|opt|i|||<xmti|D]B}tii||}|i|oqQn|i||qQWnt	|i|||<dS(N(
RR~RtRmtisdirtFoundDirRRRt	FoundFile(RR~RtfullR-((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs>tii|ioti|inti|idS(s=
        Delete all the files in the base directory.
        N(RR~RsRmtshutiltrmtreetmkdir(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRrscCstii|i|}tiitii|ptitii|nt|d}|dj	o|i	|n|dj	oV|i
otii|i
|}nt|d}|i	|i|in|it
|i|S(s
        Write a file to the given path.  If ``content`` is given then
        that text is written, otherwise the file in ``frompath`` is
        used.  ``frompath`` is relative to ``self.template_path``
        R)R}N(RR~RtRmRstdirnameRtRR(RRnRRR(RR~RtfrompathRRtf2((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt	writefiles



N(RRRPRRR(RRRRRRRrR(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRhs	/	=					RcBs2eZdZdZdZdZdZRS(s
    Represents the results of running a command in
    `TestFileEnvironment
    <class-paste.fixture.TestFileEnvironment.html>`_.

    Attributes to pay particular attention to:

    ``stdout``, ``stderr``:
        What is produced

    ``files_created``, ``files_deleted``, ``files_updated``:
        Dictionaries mapping filenames (relative to the ``base_dir``)
        to `FoundFile <class-paste.fixture.FoundFile.html>`_ or
        `FoundDir <class-paste.fixture.FoundDir.html>`_ objects.
    c	Cs||_||_||_||_||_||_||_||_h|_h|_	|i
|_xq|iD]c\}	}
|	|jo|
|i|	<qvn|i|	=|
i
||	i
jo||	|i	|	<qvqvWdS(N(ttest_envRRzRRR}R~Rt
files_deletedt
files_updatedR9t
files_createdRPtmtime(RRRRzRRR}R~RR~R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs&										



cCs+t}|idjptd|idS(NisScript returned code: %s(RR}R(RRM((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRscCs1t}|iodGH|iGHtdndS(Ns
Error output:sstderr output not expected(RRR(RRM((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs

c	
Csddi|ig}|io|id|in|io!|id|i|in|io!|id|i|inxd|itfd|itfd|i	tfgD]\}}}|o|id	||i
}|id
}xv|D]j\}}dt||dd
dt
}|}|o%|idjo|d|i7}n|i|qWqqWdi|S(NsScript result: %sRs  return code: %ss-- stderr: --------------------s-- stdout: --------------------tcreatedtdeletedtupdateds-- %s: -------------------R@s  %stindentitinclude_sepsN/As  (%s bytes)s
(RtRR}RpRRRRRRRPRt
_space_prefixRtsize(	RRRRut	show_sizetlastR~Rtt((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR(s8






(RRRPRRRR((((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs
			RcBsSeZdZeZeZdZdZe	eZ
dZdZdZ
RS(s
    Represents a single file found as the result of a command.

    Has attributes:

    ``path``:
        The path of the file, relative to the ``base_path``

    ``full``:
        The full path

    ``stat``:
        The results of ``os.stat``.  Also ``mtime`` and ``size``
        contain the ``.st_mtime`` and ``st_size`` of the stat.

    ``bytes``:
        The contents of the file.

    You may use the ``in`` operator with these objects (tested against
    the contents of the file), and the ``.mustcontain()`` method.
    cCsj||_||_tii|||_ti|i|_|ii|_|ii|_	d|_dS(N(RmR~RRtRtstattst_mtimeRtst_sizeRR(t_bytes(RRmR~((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR:s		cCsF|idjo/t|id}|i|_|in|iS(NR}(RR(RRRR(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt
bytes__getCs
cCs
||ijS(N(tbytes(RR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRKscCsFt}|i}||jo&d|GH|GH||jptndS(NsCould not find %r in:(RRR(RRRMR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR"Ns	
	cCsd|ii|i|ifS(Ns
<%s %s:%s>(RRRmR~(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR#Vs	(RRRPRtfileRtdirRRR/RRR"R#(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs					RcBs,eZdZeZeZdZdZRS(s6
    Represents a directory created by a command.
    cCs@||_||_tii|||_d|_d|_dS(NsN/A(RmR~RRtRRR(RRmR~((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRds
			cCsd|ii|i|ifS(Ns
<%s %s:%s>(RRRmR~(R((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR#ks	(	RRRPRRRRRR#(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR[s
	cCs||jo|i|S|S(s4
    Pop the key if found (else return default)
    (R;(R
RxR((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRps
cCs)|djotii}n|i|}|i|}g}x|o|oz|d|djoe|djo)|idt|dt|n|id||id|idqDW|oD|odi|||i|Sdi||i|Sn|i|SdS(sg
    Anything shared by pref and full will be replaced with spaces
    in full, and full returned.
    iRR@N(	R(RR~R+RDRpR\R;Rt(tprefRR+RRtpadding((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRxs"
#
)
cCs~|djodSt|ttfoti|}nt|do|iSt|o|Sdpt	d|dS(NRis-Cannot make callable pattern object out of %r(
R(R/R0R1RRRWRtcallableR(tpat((s1/usr/lib/python2.6/site-packages/paste/fixture.pyRs


cCsddk}|idtd|djotiiid}nt|t	t
foti|}nt|do|i
ndS(s
    This is used by py.test if it is in the module, so you can
    import this directly.

    Use like::

        from paste.fixture import setup_module
    iNssetup_module is deprecatediRtreset_state(RRRR(Rt	_getframetf_backt	f_globalsR/R0R1tmodulesRWR(tmoduleR((s1/usr/lib/python2.6/site-packages/paste/fixture.pytsetup_modules


cCs<x5ddd
ddgD]\}}|i||}qW|S(s8
    Unquote (some) entities in HTML.  (incomplete)
    s&nbsp;Rs&gt;t>s&lt;t<s&quot;t"s&amp;R>(s&nbsp;R(s&gt;R(s&lt;R(s&quot;R(s&amp;R>(Rj(Rtenttrepl((s1/usr/lib/python2.6/site-packages/paste/fixture.pyR:s	(>RPRRoRBR
RrRRXRRR$RtCookieRt	cStringIORtImportErrorRRt
paste.utilRtpasteRRtpaste.responseRR	tobjectR
RRt	ExceptionR+R,RRRGRRRRQRR>RLR?R=R_RbRcRdRfRhRRRR(RRRRRR:(((s1/usr/lib/python2.6/site-packages/paste/fixture.pyt<module>
s		$i&		()









O<	

Youez - 2016 - github.com/yon3zu
LinuXploit