[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.254.203: ~ $
U

��Zlx�@s�ddlZddlmZmZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
mZddlZddlmZmZdZd	Zd
dd
dd�Ze�ZGd
d�d�ZGdd�d�ZdS)�N)�Mapping�Sequence)�
ip_address)�SplitResult�	parse_qsl�urljoin�urlsplit�
urlunsplit)�	MultiDict�MultiDictProxy�)�_Quoter�	_Unquoterz1.1.1)�URL�Pi�)ZhttpZhttpsZwsZwssc@s,eZdZdZdd�Zefdd�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.

    cCs:||_z|j|_Wntk
r,d|_YnX|j|_dS)N�)�wrapped�__doc__�AttributeError�__name__�name)�selfr�r�/__init__.py�__init__(szcached_property.__init__cCsB|dkr|S|j�|j|�}||k	r(|S|�|�}||j|j<|S�N)�_cache�getrr)r�inst�ownerZ	_sentinel�valrrr�__get__0s
zcached_property.__get__cCstd��dS)Nzcached property is read-only)r)rr�valuerrr�__set__:szcached_property.__set__N)r�
__module__�__qualname__rr�sentinelr"r$rrrrrs
rc@s�eZdZdZe�Zeddd�Zedddd�Zeddd	�Zedd
�Z	e
�Ze
dd�Ze
dd
�Z
d�ddd�dd�Zeddddddddddd�
dd��Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Ze d5d6��Z!e d7d8��Z"e#d9d:��Z$e d;d<��Z%e#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��Z0e dSdT��Z1e#dUdV��Z2e#dWdX��Z3e#dYdZ��Z4e#d[d\��Z5e#d]d^��Z6e#d_d`��Z7edadb��Z8edcdd��Z9ededf��Z:dgdh�Z;didj�Z<dkdl�Z=dmdn�Z>dodp�Z?ddq�drds�Z@dtdu�ZAdvdw�ZBdxdy�ZCdzd{�ZDd|d}�ZEd~d�ZFd�d��ZGdS)�r)r�_valz@:z/+)�safe�	protectedz?/:@z=+&;T)r)r*�qs)r)r+)r)�+)Zunsafe)r+rFN)�encoded�strictc	Cs|dk	rt�d�t|t�r0|j|_|j|_dSt|t�rDt|�}n t|t�r\|sdt	d��nt
d��|s�|dsvd}n0|j}|dkr�t	d��|j|j
|j||jdd�}|�|d	�}|r�|�|�}|�|d
�}|�|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.T��encode���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�sD





��
zURL.__init__)
�scheme�userr=rDr>rErF�query_stringrGr-c

Cs�|r|std��|s |r td��|r0|r0td��|sF|sF|sF|sFd}n|j|||||
d�}|
s�|�|�}|rx|�|�}|�|�}|�|	�}	|t|||||	�dd�}|r�|�|�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/T�r-N)r8r;r?r@rArBr�
with_query)
�clsrHrIr=rDr>rErFrJrGr-rC�urlrrr�build�sH����



��
z	URL.buildcCs4|j}|js,|��r,|js |jr,|jdd�}t|�S�N�/�rE)r(rE�is_absoluterFrG�_replacer	�rr!rrr�__str__�szURL.__str__cCsd�|jjt|��S)Nz{}('{}'))�format�	__class__rr7�rrrr�__repr__�szURL.__repr__cCsVt|t�stS|j}|js.|��r.|jdd�}|j}|jsN|��rN|jdd�}||kSrP)r6r�NotImplementedr(rErSrT)r�otherZval1Zval2rrr�__eq__�s
z
URL.__eq__cCsJ|j�d�}|dkrF|j}|js4|��r4|jdd�}t|�}|jd<|S)N�hashrQrR)rrr(rErSrTr^)r�retr!rrr�__hash__�szURL.__hash__cCst|t�stS|j|jkSr�r6rr[r(�rr\rrr�__le__s
z
URL.__le__cCst|t�stS|j|jkSrrarbrrr�__lt__	s
z
URL.__lt__cCst|t�stS|j|jkSrrarbrrr�__ge__s
z
URL.__ge__cCst|t�stS|j|jkSrrarbrrr�__gt__s
z
URL.__gt__cCs�|�|�}|�d�rtd��|jj}|dkr6d|}n6|sH|��sH|}n$|�d��d�}|�|�d�	|�}|��r~|�
|�}t|jj|ddd�dd�S)NrQz/Appending path starting from slash is forbiddenr�rErFrGTrK)
r?�
startswithr8r(rErS�rstrip�split�append�joinr@rrT)rrrE�new_path�partsrrr�__truediv__s 





�zURL.__truediv__cCs|jfSr)r(rYrrr�__getstate__+szURL.__getstate__cCs>|ddkr*t|dt�r*|dd|_n
|^|_}i|_dS)Nrrr()r6�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_hostrYrrrrS6szURL.is_absolutecCs0|jdkrdSt�|j�}|dkr&dS|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_PORTSrrH)r�defaultrrr�is_default_port?s
zURL.is_default_portcCs\|��std��|jjs td��|j}|jdd|j|jdd�}|j|dddd�}t|dd	�S)
z}Return an URL with scheme, host and port parts only.

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

        �URL should be absolutezURL should have schemeNFr/r)rCrErFrGTrK)	rSr8r(rHr;r:r>rTr)r�vrCr!rrr�originNs�z
URL.origincCs,|��std��|jjddd�}t|dd�S)zhReturn a relative part of the URL.

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

        rxr)rHrCTrK)rSr8r(rTrrUrrr�relative_szURL.relativecCs|jjS)zdScheme for absolute URLs.

        Empty string for relative URLs or URLs starting with //

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

        None if user is missing.

        N)r(r<�rr_rrr�raw_usersszURL.raw_usercCs|�|j�S)zEDecoded user part of URL.

        None if user is missing.

        )�	_UNQUOTERr}rYrrrrI�szURL.usercCs|jjS)zMEncoded password part of URL.

        None if password is missing.

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

        None if password is missing.

        )r~rrYrrrr=�szURL.passwordcCs|jjS)zDEncoded host part of URL.

        None for relative URLs.

        )r(r:rYrrrrt�s	zURL.raw_hostcCsZ|j}|dkrdSd|kr|Szt�|�d��WStk
rT|�d��d�YSXdS)zDDecoded host part of URL.

        None for relative URLs.

        N�%�ascii�idna)rtr��decoder0�UnicodeError)r�rawrrrrD�szURL.hostcCs|jjpt�|jj�S)z�Port part of URL.

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

        )r(r>rurrHrYrrrr>�szURL.portcCs|jj}|s|��rd}|S)zNEncoded path of URL.

        / for absolute URLs without path part.

        rQ)r(rErSr|rrr�raw_path�szURL.raw_pathcCs|�|j�S)zNDecoded path of URL.

        / for absolute URLs without path part.

        )�_PATH_UNQUOTERr�rYrrrrE�szURL.pathcCstt|jdd��}t|�S)z�A MultiDictProxy representing parsed query parameters in decoded
        representation.

        Empty value if URL has no query part.

        T�Zkeep_blank_values)r
r�raw_query_stringrr|rrrrF�s�z	URL.querycCs|jjS)zOEncoded query part of URL.

        Empty string if query is missing.

        )r(rFrYrrrr��szURL.raw_query_stringcCs|�|j�S)zODecoded query part of URL.

        Empty string if query is missing.

        )�_QS_UNQUOTERr�rYrrrrJ�szURL.query_stringcCs|js|jSd�|j|j�S)zDecoded path of URL with query.�{}?{})rJrErWrYrrr�path_qs�szURL.path_qscCs|js|jSd�|j|j�S)zEncoded path of URL with query.r�)r�r�rWrYrrr�raw_path_qs�szURL.raw_path_qscCs|jjS)zUEncoded fragment part of URL.

        Empty string if fragment is missing.

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

        Empty string if fragment is missing.

        )r~r�rYrrrrGszURL.fragmentcCsl|jj}|��r6|sdg}qddg|dd��d�}n.|�d�rZdg|dd��d�}n
|�d�}t|�S)zjA tuple containing encoded *path* parts.

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

        rQrN)r(rErSrjrh�tuple)rrErnrrr�	raw_partss

z
URL.raw_partscst�fdd��jD��S)zjA tuple containing decoded *path* parts.

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

        c3s|]}��|�VqdSr)r~)�.0�partrYrr�	<genexpr>3szURL.parts.<locals>.<genexpr>)r�r�rYrrYrrn,sz	URL.partscCsp|j}|r|dkr:|js|jr6t|jjddd�dd�S|S|�d�}|jjd�|dd��ddd�}t|dd�S)	z]A new URL with last part of path removed and cleaned up query and
        fragment.

        rQr)rFrGTrKN���rg)r�r�r�rr(rTrjrl)rrErnr!rrr�parent5s�
�z
URL.parentcCs8|j}|��r,|dd�}|s"dS|dSn|dSdS)zThe last part of raw_parts.rNrr�)r�rS)rrnrrr�raw_nameFs
zURL.raw_namecCs|�|j�S)zThe last part of parts.)r~r�rYrrrrSszURL.namec	Csz|�d�}g}|D]F}|dkrBz|��WqXtk
r>YqXXq|dkrNqq|�|�q|ddkrp|�d�d�|�S)NrQ�..�.r��r�r�r)rj�pop�
IndexErrorrkrl)rMrEZsegmentsZ
resolved_pathZsegrrrr@Xs

zURL._normalize_pathcCs�z|�d�\}}}t|�}WnRtk
rnztj|dd��d�}Wn$tk
rh|�d��d�}YnXYn.X|j}|r�|d|7}|jdkr�d|d}|S)	Nr�T)Zuts46r�r���[�])	�	partitionrr8r�r0r�r�Z
compressed�version)rMrDZip�sepZzonerrr�_encode_hostus
zURL._encode_hostcCs�|r|�|�}n|}|r(|dt|�}|r`|s6d}n|rD|�|�}|rR|�|�}|d|}n|rr|rr|�|�}|r�|d|}|S)N�:r�@)r�r7�_QUOTER)rMrIr=rDr>r0r_rrrr;�s$


zURL._make_netloccCs<t|t�std��|��s"td��t|jj|��d�dd�S)z&Return a new URL with scheme replaced.zInvalid scheme typez3scheme replacement is not allowed for relative URLs)rHTrK)	r6r7r9rSr8rr(rT�lower)rrHrrr�with_scheme�s

zURL.with_schemec	Csr|j}|dkrd}n$t|t�r0|�|�}|j}ntd��|��sHtd��t|jj	|j
|||j|jdd�d�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 URLsFr/�rCTrK)
r(r6r7r�r=r9rSr8rrTr;r:r>)rrIr!r=rrr�	with_user�s"	

��z
URL.with_userc	Csj|dkr
nt|t�r |�|�}ntd��|��s8td��|j}t|jj|j	|j
||j|jdd�d�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 URLsFr/r�TrK)
r6r7r�r9rSr8r(rrTr;r<r:r>)rr=r!rrr�
with_password�s&	
���zURL.with_passwordc	Csjt|t�std��|��s"td��|s.td��|�|�}|j}t|jj|j	|j
|j||jdd�d�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 allowedFr/r�TrK)
r6r7r9rSr8r�r(rrTr;r<r=r>)rrDr!rrr�	with_host�s"


��z
URL.with_hostc	Csf|dk	r$t|t�s$td�t|����|��s4td��|j}t|jj	|j
|j|j|j
|dd�d�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 URLsFr/r�TrK)r6�intr9rW�typerSr8r(rrTr;r<r=r:)rr>r!rrr�	with_port�s ���z
URL.with_portrKcCsZ|s |�|�}|��r |�|�}t|�dkr@|ddkr@d|}t|jj|ddd�dd�S)z$Return a new URL with path replaced.rrQrrgTrK)r?rSr@�lenrr(rT)rrEr-rrr�	with_paths

�z
URL.with_pathcs.|rt|�dkrtd��|}nt|�dkr4|d}ntd��|dkrJd}n�t|t�r�|j�g}|��D]R\}}t|t�rzn$t|�tkr�t|�}nt	d�
|���|��|�d�|��qfd�|�}ndt|t�r�|�
|�}nNt|tttf�r�t	d��n4t|t��r"|j�d��fd	d
�|D��}nt	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��kry�Zquoterrrr�>s�z%URL._get_str_query.<locals>.<genexpr>zPInvalid query type: only str, mapping or sequence of (str, str) pairs is allowed)r�r8r6r�_QUERY_PART_QUOTER�itemsr7r�r�r9rWrkrlrA�bytes�	bytearray�
memoryviewr)r�args�kwargsrFZlstr�ryrr�r�_get_str_querysF



��

�
zURL._get_str_querycOs(|j||�}t|jj|jj|d�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.

        )rErFTrK)r�rr(rTrE)rr�r��	new_queryrrrrLFs

�zURL.with_querycOsL|j||�}tt|dd��}t|j�}|�|�t|jj|�|�d�dd�S)z)Return a new URL with query part updated.Tr�)rFrK)r�r
rrF�updaterr(rT)rr�r��sr�rFrrr�update_queryXs

�zURL.update_querycCs<|dkrd}nt|t�s td��t|jj|�|�d�dd�S)z�Return a new URL with fragment replaced.

        Autoencode fragment if needed.

        Clear fragment to default if None is passed.

        NrzInvalid fragment type)rGTrK)r6r7r9rr(rTrB)rrGrrr�
with_fragmentbs	
��zURL.with_fragmentcCs�t|t�std��d|kr"td��|�|�}|dkr<td��t|j�}|��rxt|�dkrf|�	|�n||d<d|d	<n||d<|d	dkr�d|d	<t
|jjd�
|�ddd
�dd�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 typerQzSlash in name is not allowedr�z. and .. values are forbiddenrr�rrrgTrK)r6r7r9r8r?�listr�rSr�rkrr(rTrl)rrrnrrr�	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 URLTrK)r6rr9rr7)rrNrrrrl�s
zURL.joinc
Cs6tt|j|j|j|j|j|jjdd�|j	|j
|j��S)z<Return decoded human readable string for URL representation.Fr/)r	rrHr;rIr=rDr(r>rErJrGrYrrr�
human_repr�s��zURL.human_repr)r)Hrr%r&�	__slots__r
r�r?rAr�rBrr~r�r�r�classmethodrOrVrZr]r`rcrdrerfrorprsrSrwrzr{�propertyrHr}rrIrr=rtrDr>r�rErFr�rJr�r�r�rGr�rnr�r�rr@r�r;r�r�r�r�r�r�r�rLr�r�r�rlr�rrrrr>s�F


'
�,		








	

















+
r)r4Zcollections.abcrrZ	ipaddressrZurllib.parserrrrr	Z	multidictr
rr�Zquotingr
r�__version__�__all__ru�objectr'rrrrrr�<module>s �

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 20.8 KB 0644
__init__.cpython-38.pyc File 20.8 KB 0644
quoting.cpython-38.opt-1.pyc File 3.56 KB 0644
quoting.cpython-38.pyc File 3.56 KB 0644