[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.141.193.175: ~ $


��Zlx�@s�ddlZddlmZmZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
mZddlZddlmZmZdZdZd
ddd
dddd
iZe�ZGdd�d�ZGdd	�d	�ZdS)�N)�Mapping�Sequence)�
ip_address)�SplitResult�	parse_qsl�urljoin�urlsplit�
urlunsplit)�	MultiDict�MultiDictProxy�)�_Quoter�	_Unquoterz1.1.1�URLZhttp�PZhttpsi�ZwsZwssc@s=eZdZdZdd�Zedd�Zdd�ZdS)	�cached_propertyaRUse as a class method decorator.  It operates almost exactly like
    the Python `@property` decorator, but it puts the result of the
    method it decorates into the instance dict after the first call,
    effectively replacing the function it decorates with an instance
    variable.  It is, in Python parlance, a data descriptor.

    cCsG||_y|j|_Wntk
r6d|_YnX|j|_dS)N�)�wrapped�__doc__�AttributeError�__name__�name)�selfr�r�/__init__.py�__init__(s	
zcached_property.__init__cCs[|dkr|S|jj|j|�}||k	r8|S|j|�}||j|j<|S)N)�_cache�getrr)r�inst�owner�	_sentinel�valrrr�__get__0szcached_property.__get__cCstd��dS)Nzcached property is read-only)r)rr�valuerrr�__set__:szcached_property.__set__N)r�
__module__�__qualname__rr�sentinelr"r$rrrrrs
rc@seZdZd�Ze�Zedddd�Zeddddd	d
�Zeddd	d
�Zedd�Z	e
�Ze
dd�Ze
d	d
�Z
d
dddddd�Zedd
dd
dd
dd
dddd
dddd
dd
dddd�
�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Ze d=d>��Z!e d?d@��Z"e#dAdB��Z$e dCdD��Z%e#dEdF��Z&e dGdH��Z'e#dIdJ��Z(e dKdL��Z)e dMdN��Z*e#dOdP��Z+e#dQdR��Z,e dSdT��Z-e#dUdV��Z.e#dWdX��Z/e#dYdZ��Z0e d[d\��Z1e#d]d^��Z2e#d_d`��Z3e#dadb��Z4e#dcdd��Z5e#dedf��Z6e#dgdh��Z7edidj��Z8edkdl��Z9edmdn��Z:dodp�Z;dqdr�Z<dsdt�Z=dudv�Z>dwdx�Z?dddydz�Z@d{d|�ZAd}d~�ZBdd��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGdS)�rr�_valZsafez@:Z	protectedz/+z?/:@z=+&;ZqsTZunsafe�+r�encodedF�strictNc	Css|dk	rtjd�t|t�rD|j|_|j|_dSt|t�rbt|�}n0t|t�r�|s�t	d��nt
d��|s]|ds�d}nH|j}|dkr�t	d��|j|j
|j||jdd�}|j|d	�}|r|j|�}|j|d
�}|j|d�}t|d||||�}||_i|_dS)
Nzstrict parameter is ignoredz$Cannot apply decoding to SplitResultz#Constructor parameter should be strrrz/Invalid URL: host is required for abolute urls.�encodeT���r)�warnings�warn�
isinstancerr(r�strrr�
ValueError�	TypeError�hostname�_make_netloc�username�password�port�_PATH_QUOTER�_normalize_path�
_QUERY_QUOTER�_FRAGMENT_QUOTER)	rr!r*r+�netloc�host�path�query�fragmentrrrr�s@

						zURL.__init__�scheme�userr9r@r:rArB�query_stringrCc

Cs|r|rtd��|r2|r2td��|rJ|rJtd��|ro|ro|ro|rod}n|j||||d|
�}|
s�|j|�}|r�|j|�}|j|�}|j|	�}	|t|||||	�dd�}|r
|j|�S|SdS)	zCreates and returns a new URLz1Can't build URL with "host" but without "scheme".z1Can't build URL with "scheme" but without "host".z6Only one of "query" or "query_string" should be passedrr,r*TN)r4r7r;r<r=r>r�
with_query)
�clsrDrEr9r@r:rArBrFrCr*r?�urlrrr�build�s<
	
			
		
z	URL.buildcCsM|j}|jrC|j�rC|js1|jrC|jdd�}t|�S)NrA�/)r(rA�is_absoluterBrC�_replacer	)rr!rrr�__str__�s	(zURL.__str__cCsdj|jjt|��S)Nz{}('{}'))�format�	__class__rr3)rrrr�__repr__�szURL.__repr__cCst|t�stS|j}|jrD|j�rD|jdd�}|j}|jru|j�ru|jdd�}||kS)NrArK)r2r�NotImplementedr(rArLrM)r�otherZval1Zval2rrr�__eq__�s		z
URL.__eq__cCsj|jjd�}|dkrf|j}|jrO|j�rO|jdd�}t|�}|jd<|S)N�hashrArK)rrr(rArLrMrU)r�retr!rrr�__hash__�s	zURL.__hash__cCs#t|t�stS|j|jkS)N)r2rrRr()rrSrrr�__le__sz
URL.__le__cCs#t|t�stS|j|jkS)N)r2rrRr()rrSrrr�__lt__	sz
URL.__lt__cCs#t|t�stS|j|jkS)N)r2rrRr()rrSrrr�__ge__sz
URL.__ge__cCs#t|t�stS|j|jkS)N)r2rrRr()rrSrrr�__gt__sz
URL.__gt__cCs�|j|�}|jd�r*td��|jj}|dkrOd|}nQ|rl|j�rl|}n4|jd�jd�}|j|�dj	|�}|j�r�|j
|�}t|jjd|dddd�dd�S)	NrKz/Appending path starting from slash is forbiddenrArBrrCr*T)
r;�
startswithr4r(rArL�rstrip�split�append�joinr<rrM)rrrA�new_path�partsrrr�__truediv__s
	
$zURL.__truediv__cCs
|jfS)N)r()rrrr�__getstate__+szURL.__getstate__cCsS|ddkr7t|dt�r7|dd|_n|^|_}i|_dS)Nrrr()r2�dictr(r)r�stateZunusedrrr�__setstate__.s#zURL.__setstate__cCs
|jdk	S)z�A check for absolute URLs.

        Return True for absolute ones (having scheme or starting
        with //), False otherwise.

        N)�raw_host)rrrrrL6szURL.is_absolutecCsB|jdkrdStj|j�}|dkr5dS|j|kS)z�A check for default port.

        Return True if port is default for specified scheme,
        e.g. 'http://python.org' or 'http://python.org:80', False
        otherwise.

        NF)r:�
DEFAULT_PORTSrrD)r�defaultrrr�is_default_port?szURL.is_default_portc	Cs�|j�std��|jjs0td��|j}|jdd|j|jdd�}|jd|ddd	dd
d�}t|dd�S)
z}Return an URL with scheme, host and port parts only.

        user, password, path, query and fragment are removed.

        zURL should be absolutezURL should have schemeNr,Fr?rArrBrCr*T)	rLr4r(rDr7r6r:rMr)r�vr?r!rrr�originNs		$z
URL.origincCsC|j�std��|jjdddd�}t|dd�S)zhReturn a relative part of the URL.

        scheme, user, password, host and port are removed.

        zURL should be absoluterDrr?r*T)rLr4r(rMr)rr!rrr�relative_szURL.relativecCs
|jjS)zdScheme for absolute URLs.

        Empty string for relative URLs or URLs starting with //

        )r(rD)rrrrrDjsz
URL.schemecCs|jj}|sdS|S)zEEncoded user part of URL.

        None if user is missing.

        N)r(r8)rrVrrr�raw_usersszURL.raw_usercCs|j|j�S)zEDecoded user part of URL.

        None if user is missing.

        )�	_UNQUOTERro)rrrrrE�szURL.usercCs
|jjS)zMEncoded password part of URL.

        None if password is missing.

        )r(r9)rrrr�raw_password�szURL.raw_passwordcCs|j|j�S)zMDecoded password part of URL.

        None if password is missing.

        )rprq)rrrrr9�szURL.passwordcCs
|jjS)zDEncoded host part of URL.

        None for relative URLs.

        )r(r6)rrrrrh�s	zURL.raw_hostcCsr|j}|dkrdSd|kr)|Sytj|jd��SWn(tk
rm|jd�jd�SYnXdS)zDDecoded host part of URL.

        None for relative URLs.

        N�%�ascii�idna)rhrt�decoder,�UnicodeError)r�rawrrrr@�s	
zURL.hostcCs|jjptj|jj�S)z�Port part of URL.

        None for relative URLs or URLs without explicit port and
        scheme without default port substitution.

        )r(r:rirrD)rrrrr:�szURL.portcCs)|jj}|r%|j�r%d}|S)zNEncoded path of URL.

        / for absolute URLs without path part.

        rK)r(rArL)rrVrrr�raw_path�szURL.raw_pathcCs|j|j�S)zNDecoded path of URL.

        / for absolute URLs without path part.

        )�_PATH_UNQUOTERrx)rrrrrA�szURL.pathcCs%tt|jdd��}t|�S)z�A MultiDictProxy representing parsed query parameters in decoded
        representation.

        Empty value if URL has no query part.

        �keep_blank_valuesT)r
r�raw_query_stringr)rrVrrrrB�sz	URL.querycCs
|jjS)zOEncoded query part of URL.

        Empty string if query is missing.

        )r(rB)rrrrr{�szURL.raw_query_stringcCs|j|j�S)zODecoded query part of URL.

        Empty string if query is missing.

        )�_QS_UNQUOTERr{)rrrrrF�szURL.query_stringcCs&|js|jSdj|j|j�S)zDecoded path of URL with query.z{}?{})rFrArO)rrrr�path_qs�s	zURL.path_qscCs&|js|jSdj|j|j�S)zEncoded path of URL with query.z{}?{})r{rxrO)rrrr�raw_path_qs�s	zURL.raw_path_qscCs
|jjS)zUEncoded fragment part of URL.

        Empty string if fragment is missing.

        )r(rC)rrrr�raw_fragmentszURL.raw_fragmentcCs|j|j�S)zUDecoded fragment part of URL.

        Empty string if fragment is missing.

        )rpr)rrrrrCszURL.fragmentcCs�|jj}|j�rM|s*dg}q�dg|dd�jd�}nA|jd�rdg|dd�jd�}n|jd�}t|�S)zjA tuple containing encoded *path* parts.

        ('/',) for absolute URLs if *path* is missing.

        rKrN)r(rArLr^r\�tuple)rrArbrrr�	raw_partss##z
URL.raw_partscs t�fdd��jD��S)zjA tuple containing decoded *path* parts.

        ('/',) for absolute URLs if *path* is missing.

        c3s|]}�j|�VqdS)N)rp)�.0�part)rrr�	<genexpr>3szURL.parts.<locals>.<genexpr>)r�r�)rr)rrrb,sz	URL.partscCs�|j}|s|dkrW|js.|jrSt|jjdddd�dd�S|S|jd�}|jjddj|dd
��dddd�}t|dd�S)z]A new URL with last part of path removed and cleaned up query and
        fragment.

        rKrBrrCr*TrANr���)rxrr{rr(rMr^r`)rrArbr!rrr�parent5s	%z
URL.parentcCsF|j}|j�r:|dd�}|s/dS|dSn|dSdS)zThe last part of raw_parts.rNrr�r�)r�rL)rrbrrr�raw_nameFs	zURL.raw_namecCs|j|j�S)zThe last part of parts.)rpr�)rrrrrSszURL.namecCs�|jd�}g}x_|D]W}|dkrTy|j�Wqstk
rPYqsXq|dkrfqq|j|�qW|ddkr�|jd�dj|�S)NrK�..�.rrr�)r�r�)r^�pop�
IndexErrorr_r`)rHrAZsegmentsZ
resolved_pathZsegrrrr<Xs


zURL._normalize_pathcCs�y(|jd�\}}}t|�}Wnatk
r�y"tj|dd�jd�}Wn*tk
r�|jd�jd�}YnXYn;X|j}|r�|d|7}|jdkr�d|d}|S)	NrrZuts46Trsrt��[�])	�	partitionrr4rtr,rurv�
compressed�version)rHr@Zip�sepZzonerrr�_encode_hostus
"
"	zURL._encode_hostcCs�|r|j|�}n|}|r8|dt|�}|r�|sMd}n|rb|j|�}|rw|j|�}|d|}n|r�|r�|j|�}|r�|d|}|S)N�:r�@)r�r3�_QUOTER)rHrEr9r@r:r,rVrrrr7�s$	zURL._make_netloccCsXt|t�std��|j�s3td��t|jjd|j��dd�S)z&Return a new URL with scheme replaced.zInvalid scheme typez3scheme replacement is not allowed for relative URLsrDr*T)	r2r3r5rLr4rr(rM�lower)rrDrrr�with_scheme�s
zURL.with_schemec
Cs�|j}|dkrd}n6t|t�rH|j|�}|j}ntd��|j�sltd��t|jj	d|j
|||j|jdd��dd�S)	z�Return a new URL with user replaced.

        Autoencode user if needed.

        Clear user/password if user is None.

        NzInvalid user typez1user replacement is not allowed for relative URLsr?r,Fr*T)
r(r2r3r�r9r5rLr4rrMr7r6r:)rrEr!r9rrr�	with_user�s				z
URL.with_userc
Cs�|dkrn-t|t�r0|j|�}ntd��|j�sTtd��|j}t|jjd|j	|j
||j|jdd��dd�S)	z�Return a new URL with password replaced.

        Autoencode password if needed.

        Clear password if argument is None.

        NzInvalid password typez5password replacement is not allowed for relative URLsr?r,Fr*T)
r2r3r�r5rLr4r(rrMr7r8r6r:)rr9r!rrr�
with_password�s 			zURL.with_passwordc
Cs�t|t�std��|j�s3td��|sEtd��|j|�}|j}t|jjd|j	|j
|j||jdd��dd�S)	z�Return a new URL with host replaced.

        Autoencode host if needed.

        Changing host for relative URLs is not allowed, use .join()
        instead.

        zInvalid host typez1host replacement is not allowed for relative URLszhost removing is not allowedr?r,Fr*T)
r2r3r5rLr4r�r(rrMr7r8r9r:)rr@r!rrr�	with_host�s
		z
URL.with_hostc
Cs�|dk	r7t|t�r7tdjt|����|j�sOtd��|j}t|jj	d|j
|j|j|j
|dd��dd�S)	z`Return a new URL with port replaced.

        Clear port to default if None is passed.

        Nz"port should be int or None, got {}z1port replacement is not allowed for relative URLsr?r,Fr*T)r2�intr5rO�typerLr4r(rrMr7r8r9r6)rr:r!rrr�	with_port�s	z
URL.with_portcCs�|s0|j|�}|j�r0|j|�}t|�dkr\|ddkr\d|}t|jjd|dddd�dd�S)	z$Return a new URL with path replaced.rrKrArBrrCr*T)r;rLr<�lenrr(rM)rrAr*rrr�	with_paths"
$z
URL.with_pathcs�|r-t|�dkr$td��|}n+t|�dkrL|d}ntd��|dkrmd}nGt|t�r#|j�g}x�|j�D]u\}}t|t�r�n6t|�tkr�t|�}nt	dj
|���|j�|�d�|��q�Wdj|�}n�t|t�rD|j
|�}npt|tttf�rkt	d��nIt|t�r�|j�dj�fd	d
�|D��}nt	d��|S)Nrz7Either kwargs or single query parameter must be presentrrzCInvalid variable type: mapping value should be str or int, got {!r}�=�&zAInvalid query type: bytes, bytearray and memoryview are forbiddenc3s/|]%\}}�|�d�|�VqdS)r�Nr)r��krl)�quoterrrr�>sz%URL._get_str_query.<locals>.<genexpr>zPInvalid query type: only str, mapping or sequence of (str, str) pairs is allowed)r�r4r2r�_QUERY_PART_QUOTER�itemsr3r�r�r5rOr_r`r=�bytes�	bytearray�
memoryviewr)r�args�kwargsrBZlstr�rlr)r�r�_get_str_querys@	
				zURL._get_str_querycOs=|j||�}t|jjd|jjd|�dd�S)aReturn a new URL with query part replaced.

        Accepts any Mapping (e.g. dict, multidict.MultiDict instances)
        or str, autoencode the argument if needed.

        It also can take an arbitrary number of keyword arguments.

        Clear query if None is passed.

        rArBr*T)r�rr(rMrA)rr�r��	new_queryrrrrGFs
!zURL.with_querycOsn|j||�}tt|dd��}t|j�}|j|�t|jjd|j|��dd�S)z)Return a new URL with query part updated.rzTrBr*)r�r
rrB�updaterr(rM)rr�r��sr�rBrrr�update_queryXs
!zURL.update_querycCsX|dkrd}nt|t�s0td��t|jjd|j|��dd�S)z�Return a new URL with fragment replaced.

        Autoencode fragment if needed.

        Clear fragment to default if None is passed.

        NrzInvalid fragment typerCr*T)r2r3r5rr(rMr>)rrCrrr�
with_fragmentbs		zURL.with_fragmentcCst|t�std��d|kr3td��|j|�}|dkrZtd��t|j�}|j�r�t|�dkr�|j	|�n
||d<d|d	<n$||d<|d	dkr�d|d	<t
|jjd
dj
|�dddd�d
d�S)z�Return a new URL with name (last part of path) replaced.

        Query and fragment parts are cleaned up.

        Name is encoded if needed.

        zInvalid name typerKzSlash in name is not allowedr��..z. and .. values are forbiddenrrrrArBrCr*T)r�r�r�r�)r2r3r5r4r;�listr�rLr�r_rr(rMr`)rrrbrrr�	with_namets&	



z
URL.with_namecCs@t|t�std��ttt|�t|��dd�S)u_Join URLs

        Construct a full (“absolute”) URL by combining a “base URL”
        (self) with another URL (url).

        Informally, this uses components of the base URL, in
        particular the addressing scheme, the network location and
        (part of) the path, to provide missing components in the
        relative URL.

        zurl should be URLr*T)r2rr5rr3)rrIrrrr`�s
zURL.joinc
CsOtt|j|j|j|j|j|jjdd�|j	|j
|j��S)z<Return decoded human readable string for URL representation.r,F)r	rrDr7rEr9r@r(r:rArFrC)rrrr�
human_repr�szURL.human_repr)rr()Hrr%r&�	__slots__r
r�r;r=r�r>rrpryr|r�classmethodrJrNrQrTrWrXrYrZr[rcrdrgrLrkrmrn�propertyrDrorrErqr9rhr@r:rxrArBr{rFr}r~rrCr�rbr�r�rr<r�r7r�r�r�r�r�r�r�rGr�r�r�r`r�rrrrr>s�F		'*			
			
						

+
)r)r0�collections.abcrrZ	ipaddressrZurllib.parserrrrr	Z	multidictr
rrtZquotingr
r�__version__�__all__ri�objectr'rrrrrr�<module>s(	

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 22.55 KB 0644
__init__.cpython-35.pyc File 22.55 KB 0644
quoting.cpython-35.opt-1.pyc File 4.05 KB 0644
quoting.cpython-35.pyc File 4.05 KB 0644