File "util.cpython-36.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/lib64/python3.6/wsgiref/__pycache__/util.cpython-36.pyc
File size: 5.07 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3


 \	@sxdZddlZddddddgZGd	ddZd
dZddZdd
dZddZddZdddddddddj	Z
ddZdS)z$Miscellaneous WSGI-related UtilitiesNFileWrapperguess_schemeapplication_urirequest_urishift_path_infosetup_testing_defaultsc@s2eZdZdZdddZddZddZd	d
ZdS)
rz1Wrapper to convert file-like objects to iterables cCs"||_||_t|dr|j|_dS)Nclose)filelikeblksizehasattrr	)selfr
rr$/usr/lib64/python3.6/wsgiref/util.py__init__s
zFileWrapper.__init__cCs|jj|j}|r|StdS)N)r
readr
IndexError)r
keydatarrr__getitem__szFileWrapper.__getitem__cCs|S)Nr)r
rrr__iter__szFileWrapper.__iter__cCs|jj|j}|r|StdS)N)r
rr
StopIteration)r
rrrr__next__szFileWrapper.__next__N)r)__name__
__module____qualname____doc__rrrrrrrrrs

cCs|jddkrdSdSdS)	zMReturn a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    ZHTTPSyeson1httpshttpN)rrr)get)environrrrr#scCs|dd}ddlm}|jdr0||d7}nR||d7}|ddkrf|dd	kr|d
|d7}n|ddkr|d
|d7}|||jdpd
dd7}|S)z@Return the application's base URI (no PATH_INFO or QUERY_STRING)zwsgi.url_schemez://r)quote	HTTP_HOSTSERVER_NAMEr SERVER_PORT443:80SCRIPT_NAME/latin1)encoding)urllib.parser$r")r#urlr$rrrr+s
TcCspt|}ddlm}||jddddd}|jdsF||d	d
7}n||7}|rl|jdrl|d|d7}|S)
zBReturn the full request URI, optionally including the query stringr)r$	PATH_INFOz/;=,r-)Zsafer.r+NZQUERY_STRING?)rr/r$r")r#Z
include_queryr0r$	path_inforrrr?s
cCs|jdd}|sdS|jd}dd|dd
D|dd<|d}|d=|jdd}tj|d|}|jdr~|dd}|r|jdr|d7}||d<dj||d<|d	krd}|S)
aZShift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    r1r2Nr,cSsg|]}|r|dkr|qS).r).0prrr
<listcomp>^sz#shift_path_info.<locals>.<listcomp>r3r+r6r:r:)r"split	posixpathnormpathendswithjoin)r#r5
path_partsnameZscript_namerrrrLs$


cCs|jdd|jdd|jd|d|jddd|kr\d	|kr\|jdd
|jd	d|jdd|jdd|jdd|jddddlm}m}|jd||jd||jdt||ddkr|jddn|ddkr|jdddS)a:Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    r&z	127.0.0.1ZSERVER_PROTOCOLzHTTP/1.0r%ZREQUEST_METHODZGETr+r1r2r,zwsgi.versionr3rz
wsgi.run_oncezwsgi.multithreadzwsgi.multiprocess)StringIOBytesIOz
wsgi.inputzwsgi.errorszwsgi.url_schemer!r'r*r r(N)r3r)
setdefaultiorBrCr)r#rBrCrrrrus&
r3)Z
connectionz
keep-alivezproxy-authenticatezproxy-authorizationZteZtrailersztransfer-encodingZupgradecCst|jS)z?Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header)_hoppishlower)Zheader_namerrr
is_hop_by_hopsrH)T)rr<__all__rrrrrr__contains__rFrHrrrr<module>s

))