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/request.pyo
Ñò
•ÊIc@s’dZddkZddklZddklZddkZddkZyddklZWn#e	j
oddk
lZnXddklZddd	d
ddd
ddg	Z
d„Zd„Zd„Zd„Zed„Zeedddd„Zd„Zd„Zd„Zhdd6dd6dd6Zd„Zdefd „ƒYZd!„Zeei_ed"joddk Z e i!ƒndS(#sÑ
This module provides helper routines with work directly on a WSGI
environment to solve common requirements.

   * get_cookies(environ)
   * parse_querystring(environ)
   * parse_formvars(environ, include_get_vars=True)
   * construct_url(environ, with_query_string=True, with_path_info=True,
                   script_name=None, path_info=None, querystring=None)
   * path_info_split(path_info)
   * path_info_pop(environ)
   * resolve_relative_url(url, environ)

iÿÿÿÿN(tSimpleCookie(tStringIO(t	DictMixin(t	MultiDicttget_cookiestget_cookie_dicttparse_querystringtparse_formvarst
construct_urltpath_info_splitt
path_info_poptresolve_relative_urltEnvironHeaderscCsr|iddƒ}|idƒo&|d\}}||jo|Sntƒ}|i|ƒ||f|d<|S(sµ
    Gets a cookie object (which is a dictionary-like object) from the
    request environment; caches this value in case get_cookies is
    called again for the same request.

    tHTTP_COOKIEts
paste.cookies(tgetthas_keyRtload(tenvirontheadertcookiestcheck_header((s1/usr/lib/python2.6/site-packages/paste/request.pyR#s
		
cCs£|idƒ}|phS|idƒo&|d\}}||jo|Sntƒ}|i|ƒh}x|D]}||i||<qtW||f|d<|S(s#Return a *plain* dictionary of cookies as found in the request.

    Unlike ``get_cookies`` this returns a dictionary, not a
    ``SimpleCookie`` object.  For incoming cookies a dictionary fully
    represents the information.  Like ``get_cookies`` this caches and
    checks the cache.
    R
spaste.cookies.dict(RRRRtvalue(RRRRtresulttname((s1/usr/lib/python2.6/site-packages/paste/request.pyR4s
		
cCs€|iddƒ}|pgSd|jo&|d\}}||jo|Snti|dtdtƒ}||f|d<|S(s<
    Parses a query string into a list like ``[(name, value)]``.
    Caches this value in case parse_querystring is called again
    for the same request.

    You can pass the result to ``dict()``, but be aware that keys that
    appear multiple times will be lost (only the last value will be
    preserved).

    tQUERY_STRINGRspaste.parsed_querystringtkeep_blank_valueststrict_parsing(Rtcgit	parse_qsltTruetFalse(Rtsourcetparsedtcheck_source((s1/usr/lib/python2.6/site-packages/paste/request.pyRKs

		cCs|iddƒ}|ptƒSd|jo&|d\}}||jo|Snti|dtdtƒ}t|ƒ}||f|d<|S(sÊParses a query string like parse_querystring, but returns a MultiDict

    Caches this value in case parse_dict_querystring is called again
    for the same request.

    Example::

        >>> environ = {'QUERY_STRING': 'day=Monday&user=fred&user=jane'}
        >>> parsed = parse_dict_querystring(environ)

        >>> parsed['day']
        'Monday'
        >>> parsed['user']
        'fred'
        >>> parsed.getall('user')
        ['fred', 'jane']

    RRspaste.parsed_dict_querystringRR(RRRRRR(RR R!R"tmulti((s1/usr/lib/python2.6/site-packages/paste/request.pytparse_dict_querystringbs

		cCsB|d}d|joD|d\}}||jo#|o|it|ƒƒn|Sn|iddƒiƒ}d|jo|iddƒd}n|dj}|id
ƒpd|d
<n|iddƒ}d|d<|oBtdƒ}|idƒ}	|id
ƒ}
d|d
<d|d<n|d}tid
|d|ddƒ}||d<|o|	|d<|
|d
<ntƒ}t	|i
tƒozxw|iƒD]e}
||
}t	|tƒp
|g}nx5|D]-}|i
p
|i
}n|i|
|ƒq×Wq£Wn||f|d<|o|it|ƒƒn|S(s¥Parses the request, returning a MultiDict of form variables.

    If ``include_get_vars`` is true then GET (query string) variables
    will also be folded into the MultiDict.

    All values should be strings, except for file uploads which are
    left as ``FieldStorage`` instances.

    If the request was not a normal form request (e.g., a POST with an
    XML body) then ``environ['wsgi.input']`` won't be read.
    s
wsgi.inputspaste.parsed_formvarstCONTENT_TYPERt;iis!application/x-www-form-urlencodedsmultipart/form-datatCONTENT_LENGTHt0RtfpRR(Rs!application/x-www-form-urlencodedsmultipart/form-data(tupdateRRtlowertsplitRRtFieldStorageRt
isinstanceRtlisttkeystfilenametadd(Rtinclude_get_varsR R!R"ttypetfake_out_cgitold_query_stringtinputtold_content_typetold_content_lengthtfstformvarsRtvaluesR((s1/usr/lib/python2.6/site-packages/paste/request.pyR‚s\


	
	


	

	




c	Cs7|dd}|idƒo¸|d}d}d|jot|iddƒ\}}|ddjo|djo
d}q«q¯|ddjo|d	jo
d}q«q¯n||7}|o|d
|7}qGnr||d7}|ddjo+|ddjo|d|d7}qGn(|dd	jo|d|d7}n|djo#|ti|id
dƒƒ7}n|ti|ƒ7}|oG|djo#|ti|iddƒƒ7}qØ|ti|ƒ7}n|oT|djo*|idƒo|d|d7}q/q3|o|d|7}q3n|S(s“Reconstructs the URL from the WSGI environment.

    You may override SCRIPT_NAME, PATH_INFO, and QUERYSTRING with
    the keyword arguments.

    swsgi.url_schemes://t	HTTP_HOSTt:ithttpst443thttpt80s:%stSERVER_NAMEtSERVER_PORTtSCRIPT_NAMERt	PATH_INFORt?N(RtNoneR,turllibtquote(	Rtwith_query_stringtwith_path_infotscript_namet	path_infotquerystringturlthosttport((s1/usr/lib/python2.6/site-packages/paste/request.pyRÂsF





#
#
cCs"t|dtƒ}ti||ƒS(s

    Resolve the given relative URL as being relative to the
    location represented by the environment.  This can be used
    for redirecting to a relative path.  Note: if url is already
    absolute, this function will (intentionally) have no effect
    on it.

    RK(RRturlparseturljoin(RPRtcur_url((s1/usr/lib/python2.6/site-packages/paste/request.pyRôs	cCs]|pdS|idƒ}d|jo'|iddƒ\}}|d|fS|dfSdS(s
    Splits off the first segment of the path.  Returns (first_part,
    rest_of_path).  first_part can be None (if PATH_INFO is empty), ''
    (if PATH_INFO is '/'), or a name without any /'s.  rest_of_path
    can be '' or a string starting with /.

    Rt/iN(NR(RHtlstripR,(RNtfirsttrest((s1/usr/lib/python2.6/site-packages/paste/request.pyR	s
cCsº|iddƒ}|pdSx/|idƒo|dcd7<|d}q!Wd|jo|dc|7<d|d<|S|iddƒ\}}d||d<|dc|7<|SdS(s…
    'Pops' off the next segment of PATH_INFO, pushing it onto
    SCRIPT_NAME, and returning that segment.

    For instance::

        >>> def call_it(script_name, path_info):
        ...     env = {'SCRIPT_NAME': script_name, 'PATH_INFO': path_info}
        ...     result = path_info_pop(env)
        ...     print 'SCRIPT_NAME=%r; PATH_INFO=%r; returns=%r' % (
        ...         env['SCRIPT_NAME'], env['PATH_INFO'], result)
        >>> call_it('/foo', '/bar')
        SCRIPT_NAME='/foo/bar'; PATH_INFO=''; returns='bar'
        >>> call_it('/foo/bar', '')
        SCRIPT_NAME='/foo/bar'; PATH_INFO=''; returns=None
        >>> call_it('/foo/bar', '/')
        SCRIPT_NAME='/foo/bar/'; PATH_INFO=''; returns=''
        >>> call_it('', '/1/2/3')
        SCRIPT_NAME='/1'; PATH_INFO='/2/3'; returns='1'
        >>> call_it('', '//1/2')
        SCRIPT_NAME='//1'; PATH_INFO='/2'; returns='1'

    RFRRVREiN(RRHt
startswithR,(Rtpathtsegment((s1/usr/lib/python2.6/site-packages/paste/request.pyR
s

t
AuthorizationtHTTP_CGI_AUTHORIZATIONsContent-LengthR'sContent-TypeR%ccsvxo|iƒD]a\}}|tjot||fVq
|idƒo%|diƒiddƒ|fVq
q
WdS(s‚
    Parse the headers in the environment (like ``HTTP_HOST``) and
    yield a sequence of those (header_name, value) tuples.
    tHTTP_it_t-N(t	iteritemst_parse_headers_specialRZttitletreplace(Rtcgi_varR((s1/usr/lib/python2.6/site-packages/paste/request.pyt
parse_headersBs

cBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
sgAn object that represents the headers as present in a
    WSGI environment.

    This object is a wrapper (with no internal state) for a WSGI
    request object, representing the CGI-style HTTP_* keys as a
    dictionary.  Because a CGI environment can only hold one value for
    each key, this dictionary is single-valued (unlike outgoing
    headers).
    cCs
||_dS(N(R(tselfR((s1/usr/lib/python2.6/site-packages/paste/request.pyt__init__YscCsNd|iddƒiƒ}|djo
d}n|djo
d}n|S(NR_RaR`tHTTP_CONTENT_LENGTHR'tHTTP_CONTENT_TYPER%(Retupper(RhRtkey((s1/usr/lib/python2.6/site-packages/paste/request.pyt_trans_name\s



cCsW|djodS|djodS|idƒo|diddƒiƒSdSdS(	NR%sContent-TypeR'sContent-LengthR_iR`Ra(RZReRdRH(RhRm((s1/usr/lib/python2.6/site-packages/paste/request.pyt
_trans_keyds

cCs|i|i|ƒS(N(RRn(Rhtitem((s1/usr/lib/python2.6/site-packages/paste/request.pyt__getitem__nscCs||i|i|ƒ<dS(N(RRn(RhRpR((s1/usr/lib/python2.6/site-packages/paste/request.pyt__setitem__qscCs|i|i|ƒ=dS(N(RRn(RhRp((s1/usr/lib/python2.6/site-packages/paste/request.pyt__delitem__usccs=x6|iD]+}|i|ƒ}|dj	o	|Vq
q
WdS(N(RRoRH(RhRmR((s1/usr/lib/python2.6/site-packages/paste/request.pyt__iter__xs


cCstt|ƒƒS(N(R/titer(Rh((s1/usr/lib/python2.6/site-packages/paste/request.pyR0~scCs|i|ƒ|ijS(N(RnR(RhRp((s1/usr/lib/python2.6/site-packages/paste/request.pyt__contains__s(t__name__t
__module__t__doc__RiRnRoRqRrRsRtR0Rv(((s1/usr/lib/python2.6/site-packages/paste/request.pyRNs				
					cCs9|iod|i|ifSd|i|i|ifS(sÛ monkey patch for FieldStorage.__repr__

    Unbelievely, the default __repr__ on FieldStorage reads
    the entire file content instead of being sane about it.
    This is a simple replacement that doesn't do that
    sFieldStorage(%r, %r)sFieldStorage(%r, %r, %r)(tfileRR1R(Rh((s1/usr/lib/python2.6/site-packages/paste/request.pyt_cgi_FieldStorage__repr__patch„s

t__main__("RyRtCookieRRRSRItUserDictRtImportErrortpaste.util.UserDict24tpaste.util.multidictRt__all__RRRR$RRRHRRR	R
RcRgRR{R-t__repr__Rwtdoctestttestmod(((s1/usr/lib/python2.6/site-packages/paste/request.pyt<module>sD						 @1			(
	6	



Youez - 2016 - github.com/yon3zu
LinuXploit