https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/distlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/distlib/__pycache__/compat.cpython-310.pyc
o

�z�a+��@s�ddlmZddlZddlZddlZzddlZWney#dZYnwejddkr�ddlmZe	fZ
eZddl
mZddlZddlZddlmZmZmZmZmZddlmZmZmZmZmZm Z m!Z!dd	�Zddl"Z"dd
l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+er�ddl"m,Z,ddl-Z-ddl.Z.ddl/Z0ddl1m1Z1ddl2Z2e3Z3dd
l4m5Z6ddl4m7Z8n�ddl9mZe:fZ
e:Zddl9m;ZddlZddlZddl<Z<ddl=mZmZmZmZmZmZmZm!Z!ddl>m$Z$mZm#Z#mZmZm'Z'm(Z(m)Z)m*Z*m+Z+e�rddl>m,Z,ddl?m&Z&m%Z%m Z ddl@mAZ-ddl>mBZ"ddlCmAZ.ddl0Z0ddlDm1Z1ddlEmFZ2eGZ3ddl4m8Z8e6Z6z
ddlmHZHmIZIWne�y\Gdd�deJ�ZId`dd�ZKdd�ZHYnwzddl
mLZMWne�ywGdd�deN�ZMYnwzddl<mOZOWne�y�ejPejQBdfd d!�ZOYnwdd"lRmSZTeUeTd#��r�eTZSndd$lRmVZWGd%d&�d&eW�ZVGd'd(�d(eT�ZSzdd)lXmYZYWne�y�d*d+�ZYYnwddl<Z<ddlZZZze[Z[Wne\�y�dd,l]m^Z^d-d.�Z[Ynwzej_Z_ej`Z`Wn#ea�ye�b��p	d/Zcecd0k�rd1Zdnd2Zdd3d4�Z_d5d6�Z`Ynwzdd7lemfZfWn#e�yJdd8lgmhZhmiZiddlZe�jd9�Zkd:d;�Zld<d=�ZfYnwzdd>lmmnZnWne�ycdd>lomnZnYnwejdd?�d@k�rse1�jpZpnddAlmmpZpzddBlqmrZrWn0e�y�ddClqmsZszddDltmuZvWne�y�dadFdG�ZvYnwGdHdI�dIes�ZrYnwzddJlwmxZxWne�y�dbdKdL�ZxYnwzddMlqmyZyWnBe�yzddNlzm{Z|Wne�y�ddNl}m{Z|YnwzddOl~mZm�Z�m�Z�Wn
e�y	YnwGdPdQ�dQe��ZyYnwzddRl�m�Z�m�Z�WdSe�y[e�jdSej��Z�dTdU�Z�GdVdW�dWe��Z�dbdXdY�Z�GdZd[�d[e��Z�Gd\d]�d]e��Z�Gd^d_�d_eN�Z�YdSw)c�)�absolute_importN�)�StringIO)�FileType)�urlparse�
urlunparse�urljoin�urlsplit�
urlunsplit)�urlretrieve�quote�unquote�url2pathname�pathname2url�ContentTooShortError�	splittypecCst|t�r
|�d�}t|�S)N�utf-8)�
isinstance�unicode�encode�_quote)�s�r�0/usr/lib/python3/dist-packages/distlib/compat.pyrs

r)	�Request�urlopen�URLError�	HTTPError�HTTPBasicAuthHandler�HTTPPasswordMgr�HTTPHandler�HTTPRedirectHandler�build_opener)�HTTPSHandler)�
HTMLParser)�ifilter)�ifilterfalse)�
TextIOWrapper)rrrrr
r	r
r)
rrrrrrrr r!r")rrr)�filterfalse)�match_hostname�CertificateErrorc@seZdZdS)r*N)�__name__�
__module__�__qualname__rrrrr*_sr*�c
Cs�g}|sdS|�d�}|d|dd�}}|�d�}||kr'tdt|���|s1|��|��kS|dkr;|�d�n|�d	�sE|�d	�rN|�t�|��n|�t�|��	d
d��|D]
}|�t�|��q\t�
dd
�|�dtj�}	|	�
|�S)zpMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        F�.rr.N�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr*�repr�lower�append�
startswith�re�escape�replace�compile�join�
IGNORECASE�match)
�dn�hostname�
max_wildcards�pats�parts�leftmost�	remainder�	wildcards�frag�patrrr�_dnsname_matchcs*


�
rHcCs�|std��g}|�dd�}|D]\}}|dkr%t||�r dS|�|�q|sJ|�dd�D]}|D]\}}|dkrHt||�rCdS|�|�q2q.t|�dkr^td	|d
�tt|��f��t|�dkrntd||df��td
��)a=Verify that *cert* (in decoded format as returned by
        SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
        rules are followed, but IP addresses are not accepted for *hostname*.

        CertificateError is raised on failure. On success, the function
        returns nothing.
        ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIRED�subjectAltNamer�DNSN�subject�
commonNamer.z&hostname %r doesn't match either of %s�, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	�
ValueError�getrHr5�lenr*r;�mapr3)�certr?�dnsnames�san�key�value�subrrrr)�s8

�

���
�r))�SimpleNamespacec@�eZdZdZdd�ZdS)�	ContainerzR
        A generic container for when multiple values need to be returned
        cKs|j�|�dS�N��__dict__�update)�self�kwargsrrr�__init__�szContainer.__init__N)r+r,r-�__doc__rarrrrrZ�srZ)�whichcs"dd�}tj���r|�|�r�SdS|durtj�dtj�}|s#dS|�tj�}tj	dkr^tj
|vr:|�dtj
�tj�dd��tj�}t�fd	d
�|D��rT�g}n
�fdd�|D�}n�g}t
�}|D](}tj�|�}||vr�|�|�|D]}	tj�||	�}
||
|�r�|
SqyqfdS)
aKGiven a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.

        cSs&tj�|�ot�||�otj�|�Sr[)�os�path�exists�access�isdir)�fn�moderrr�
_access_check�s�zwhich.<locals>._access_checkN�PATH�win32r�PATHEXT�c3s"�|]}����|���VqdSr[)r4�endswith��.0�ext��cmdrr�	<genexpr>�s� zwhich.<locals>.<genexpr>csg|]}�|�qSrrrqrtrr�
<listcomp>��zwhich.<locals>.<listcomp>)rdre�dirname�environrO�defpathr1�pathsep�sys�platform�curdir�insert�any�set�normcase�addr;)rurjrerk�pathext�files�seen�dir�normdir�thefile�namerrtrrc�s<





��rc)�ZipFile�	__enter__)�
ZipExtFilec@�$eZdZdd�Zdd�Zdd�ZdS)r�cCs|j�|j�dSr[r\)r_�baserrrra�zZipExtFile.__init__cC�|Sr[r�r_rrrr��zZipExtFile.__enter__cG�|��dSr[��close�r_�exc_inforrr�__exit__�zZipExtFile.__exit__N)r+r,r-rar�r�rrrrr�sr�c@r�)r�cCr�r[rr�rrrr�#r�zZipFile.__enter__cGr�r[r�r�rrrr�&r�zZipFile.__exit__cOs tj|g|�Ri|��}t|�Sr[)�BaseZipFile�openr�)r_�argsr`r�rrrr�*szZipFile.openN)r+r,r-r�r�r�rrrrr�"sr�)�python_implementationcCs0dtjvrdStjdkrdStj�d�rdSdS)z6Return a string identifying the Python implementation.�PyPy�java�Jython�
IronPython�CPython)r}�versionrdr�r6rrrrr�1s

r�)�CallablecCs
t|t�Sr[)rr�)�objrrr�callableC�
r�r�mbcs�strict�surrogateescapecC�6t|t�r|St|t�r|�tt�Stdt|�j���Nzexpect bytes or str, not %s)	r�bytes�	text_typer�_fsencoding�	_fserrors�	TypeError�typer+��filenamerrr�fsencodeW�

�r�cCr�r�)	rr�r��decoder�r�r�r�r+r�rrr�fsdecode`r�r�)�detect_encoding)�BOM_UTF8�lookupzcoding[:=]\s*([-\w.]+)cCsH|dd����dd�}|dks|�d�rdS|dvs |�d�r"d	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_�-rzutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)r4r9r6)�orig_enc�encrrr�_get_normal_nameqs�r�cs�z�jj�Wntyd�Ynwd�d}d}�fdd�}��fdd�}|�}|�t�r7d�|d	d�}d
}|s=|gfS||�}|rH||gfS|�}|sR||gfS||�}|r^|||gfS|||gfS)a?
        The detect_encoding() function is used to detect the encoding that should
        be used to decode a Python source file.  It requires one argument, readline,
        in the same way as the tokenize() generator.

        It will call readline a maximum of twice, and return the encoding used
        (as a string) and a list of any lines (left as bytes) it has read in.

        It detects the encoding from the presence of a utf-8 bom or an encoding
        cookie as specified in pep-0263.  If both a bom and a cookie are present,
        but disagree, a SyntaxError will be raised.  If the encoding cookie is an
        invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
        'utf-8-sig' is returned.

        If no encoding is specified, then the default of 'utf-8' will be returned.
        NFrcsz��WStyYdSw)N�)�
StopIterationr)�readlinerr�read_or_stop�s
�z%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wntyd}�durd�|��}t|��wt�|�}|s(dSt|d�}zt|�}WntyQ�durGd|}t|��d��|�}t|��w�rp|j	dkrl�durcd}t|��d���}t|��|d	7}|S)
Nrz'invalid or missing encoding declarationz{} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
r��UnicodeDecodeError�format�SyntaxError�	cookie_re�findallr�r��LookupErrorr�)�line�line_string�msg�matches�encoding�codec)�	bom_foundr�rr�find_cookie�s@�
���	

�z$detect_encoding.<locals>.find_cookieTrz	utf-8-sig)�__self__r��AttributeErrorr6r�)r�r��defaultr�r��first�secondr)r�r�r�rr�|s6�&


r�)r8�)r�)�unescape)�ChainMap)�MutableMapping)�recursive_repr�...cs�fdd�}|S)zm
            Decorator to make a repr function return fillvalue for a recursive
            call
            csLt�����fdd�}t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sJt|�t�f}|�vr
�S��|�z�|�}W��|�|S��|�wr[)�id�	get_identr��discard)r_rU�result)�	fillvalue�repr_running�
user_functionrr�wrapper�s


�z=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr,rbr+�__annotations__)r��getattrr,rbr+r�)r�r��r�)r�r�r�decorating_function�sz,_recursive_repr.<locals>.decorating_functionr)r�r�rr�r�_recursive_repr�sr�c@s�eZdZdZdd�Zdd�Zdd�Zd'd	d
�Zdd�Zd
d�Z	dd�Z
dd�Ze�dd��Z
edd��Zdd�ZeZdd�Zedd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)(r�a� A ChainMap groups multiple dicts (or other mappings) together
        to create a single, updateable view.

        The underlying mappings are stored in a list.  That list is public and can
        accessed or updated using the *maps* attribute.  There is no other state.

        Lookups search the underlying mappings successively until a key is found.
        In contrast, writes, updates, and deletions only operate on the first
        mapping.

        cGst|�pig|_dS)z�Initialize a ChainMap by setting *maps* to the given mappings.
            If no mappings are provided, a single empty dictionary is used.

            N)�list�maps)r_r�rrrraszChainMap.__init__cCst|��r[)�KeyError�r_rUrrr�__missing__szChainMap.__missing__c	Cs6|jD]}z||WStyYqw|�|�Sr[)r�r�r�)r_rU�mappingrrr�__getitem__s
�
zChainMap.__getitem__NcCs||vr||S|Sr[r�r_rUr�rrrrO$szChainMap.getcC�tt�j|j��Sr[)rPr��unionr�r�rrr�__len__'r�zChainMap.__len__cCr�r[)�iterr�r�r�r�rrr�__iter__*r�zChainMap.__iter__cst�fdd�|jD��S)Nc3s�|]}�|vVqdSr[r)rr�m�rUrrrv.s�z(ChainMap.__contains__.<locals>.<genexpr>�r�r�r�rr�r�__contains__-szChainMap.__contains__cCs
t|j�Sr[r�r�rrr�__bool__0r�zChainMap.__bool__cCsd�|d�tt|j���S)Nz{0.__class__.__name__}({1})rM)r�r;rQr3r�r�rrr�__repr__3s�zChainMap.__repr__cGs|tj|g|�R��S)z?Create a ChainMap with a single dict created from the iterable.)�dict�fromkeys)�cls�iterabler�rrrr8szChainMap.fromkeyscCs&|j|jd��g|jdd��R�S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rr.N)�	__class__r��copyr�rrrr=s&z
ChainMap.copycCs|jig|j�R�S)z;New ChainMap with a new dict followed by all previous maps.�rr�r�rrr�	new_childCszChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].r.Nr	r�rrr�parentsGszChainMap.parentscCs||jd|<dS)Nr)r�)r_rUrVrrr�__setitem__Lr�zChainMap.__setitem__cCs0z	|jd|=WdStytd�|���w)Nr�(Key not found in the first mapping: {!r})r�r�r�r�rrr�__delitem__Os
�zChainMap.__delitem__cCs(z|jd��WStytd��w)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.)r��popitemr�r�rrrrUs
�zChainMap.popitemcGs8z
|jdj|g|�R�WStytd�|���w)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr
)r��popr�r�)r_rUr�rrrr\s
�zChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.rN)r��clearr�rrrrc�zChainMap.clearr[)r+r,r-rbrar�r�rOr�r�rrr�r�classmethodrr�__copy__r
�propertyrrrrrrrrrrr�s0



r�)�cache_from_sourcecCs6|�d�sJ�|dur
d}|rd}||Sd}||S)Nz.pyT�c�o)rp)re�debug_override�suffixrrrrjs�r)�OrderedDict)r�)�KeysView�
ValuesView�	ItemsViewc@s�eZdZdZdd�Zejfdd�Zejfdd�Zdd	�Zd
d�Z	dd
�Z
d6dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZe�Zefdd �Zd7d"d#�Zd7d$d%�Zd&d'�Zd(d)�Zed7d*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Z d4d5�Z!d!S)8rz)Dictionary that remembers insertion ordercOspt|�dkrtdt|���z|jWnty-g|_}||dg|dd�<i|_Ynw|j|i|��dS)z�Initialize an ordered dictionary.  Signature is the same as for
            regular dictionaries, but keyword arguments are not recommended
            because their insertion order is arbitrary.

            r.z$expected at most 1 arguments, got %dN)rPr��_OrderedDict__rootr��_OrderedDict__map�_OrderedDict__update)r_r��kwds�rootrrrra�s


�zOrderedDict.__init__cCsF||vr|j}|d}|||g|d<|d<|j|<||||�dS)z!od.__setitem__(i, y) <==> od[i]=yrr.N)rr )r_rUrV�dict_setitemr#�lastrrrr�s
 zOrderedDict.__setitem__cCs0|||�|j�|�\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]r.rN)r r)r_rU�dict_delitem�	link_prev�	link_nextrrrr�s
zOrderedDict.__delitem__cc�:�|j}|d}||ur|dV|d}||usdSdS)zod.__iter__() <==> iter(od)r.r�N�r�r_r#�currrrrr����
�zOrderedDict.__iter__ccr))z#od.__reversed__() <==> reversed(od)rr�Nr*r+rrr�__reversed__�r-zOrderedDict.__reversed__cCsbz |j��D]}|dd�=q|j}||dg|dd�<|j��Wn	ty)Ynwt�|�dS)z.od.clear() -> None.  Remove all items from od.N)r �
itervaluesrrr�r)r_�noder#rrrr�s�zOrderedDict.clearTcCs||std��|j}|r|d}|d}||d<||d<n|d}|d}||d<||d<|d}|j|=t�||�}||fS)z�od.popitem() -> (k, v), return and remove a (key, value) pair.
            Pairs are returned in LIFO order if last is true or FIFO order if false.

            zdictionary is emptyrr.r�)r�rr rr)r_r%r#�linkr'r(rUrVrrrr�s 
zOrderedDict.popitemcC�t|�S)zod.keys() -> list of keys in od)r�r�rrr�keys��zOrderedDict.keysc��fdd��D�S)z#od.values() -> list of values in odcsg|]}�|�qSrr�rrrUr�rrrw�rxz&OrderedDict.values.<locals>.<listcomp>rr�rr�r�values�rzOrderedDict.valuescr5)z.od.items() -> list of (key, value) pairs in odcsg|]}|�|f�qSrrr6r�rrrw��z%OrderedDict.items.<locals>.<listcomp>rr�rr�r�items�rzOrderedDict.itemscCr2)z0od.iterkeys() -> an iterator over the keys in od)r�r�rrr�iterkeys�r4zOrderedDict.iterkeysccs�|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNr�r_�krrrr/�s��zOrderedDict.itervaluesccs�|D]	}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrr;rrr�	iteritems�s��zOrderedDict.iteritemscOs�t|�dkrtdt|�f��|std��|d}d}t|�dkr%|d}t|t�r6|D]}||||<q,nt|d�rI|��D]}||||<q?n|D]\}}|||<qK|��D]\}}|||<qXdS)	a�od.update(E, **F) -> None.  Update od from dict/iterable E and F.

            If E is a dict instance, does:           for k in E: od[k] = E[k]
            If E has a .keys() method, does:         for k in E.keys(): od[k] = E[k]
            Or if E is an iterable of items, does:   for k, v in E: od[k] = v
            In either case, this is followed by:     for k, v in F.items(): od[k] = v

            r�z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrr.r3N)rPr�rr�hasattrr3r9)r�r"r_�otherrUrVrrrr^s.	�
�
�

�zOrderedDict.updatecCs0||vr
||}||=|S||jurt|��|S)z�od.pop(k[,d]) -> v, remove specified key and return the corresponding value.
            If key is not found, d is returned if given, otherwise KeyError is raised.

            )�_OrderedDict__markerr�)r_rUr�r�rrrr&s
zOrderedDict.popNcCs||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrr�rrr�
setdefault3szOrderedDict.setdefaultcCsj|si}t|�t�f}||vrdSd||<z|s#d|jjfW||=Sd|jj|��fW||=S||=w)zod.__repr__() <==> repr(od)r�r.z%s()z%s(%r))r��
_get_identrr+r9)r_�
_repr_running�call_keyrrrr:s�zOrderedDict.__repr__csX�fdd��D�}t����}tt��D]}|�|d�q|r&�j|f|fS�j|ffS)z%Return state information for picklingcsg|]}|�|g�qSrr�rrr<r�rrrwJr8z*OrderedDict.__reduce__.<locals>.<listcomp>N)�varsrrrr)r_r9�	inst_dictr<rr�r�
__reduce__HszOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od)rr�rrrrR�
zOrderedDict.copycCs|�}|D]}|||<q|S)z�OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
            and values equal to v (which defaults to None).

            r)rrrV�drUrrrrVs
zOrderedDict.fromkeyscCs6t|t�rt|�t|�ko|��|��kSt�||�S)z�od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
            while comparison to a regular mapping is order-insensitive.

            )rrrPr9r�__eq__�r_r?rrrrKas
 zOrderedDict.__eq__cCs
||kSr[rrLrrr�__ne__jr�zOrderedDict.__ne__cCr2)z@od.viewkeys() -> a set-like object providing a view on od's keys)rr�rrr�viewkeysor4zOrderedDict.viewkeyscCr2)z<od.viewvalues() -> an object providing a view on od's values)rr�rrr�
viewvaluessr4zOrderedDict.viewvaluescCr2)zBod.viewitems() -> a set-like object providing a view on od's items)rr�rrr�	viewitemswr4zOrderedDict.viewitems)Tr[)"r+r,r-rbrarrrr�r.rrr3r7r9r:r/r=r^r!�objectr@rrArrHrrrrKrMrNrOrPrrrrr�s<
	




	r)�BaseConfigurator�valid_identz^[a-z_][a-z0-9_]*$cCst�|�}|s
td|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIERr=rN)rr�rrrrS�s
rSc@s"eZdZdZdd�Zddd�ZdS)�ConvertingDictz A converting dictionary wrapper.cC�Jt�||�}|j�|�}||ur#|||<t|�tttfvr#||_||_	|Sr[)
rr��configurator�convertr�rU�ConvertingList�ConvertingTuple�parentrU�r_rUrVr�rrrr���
�zConvertingDict.__getitem__NcCsLt�|||�}|j�|�}||ur$|||<t|�tttfvr$||_||_	|Sr[)
rrOrWrXr�rUrYrZr[rU�r_rUr�rVr�rrrrO�s
�zConvertingDict.getr[)r+r,r-rbr�rOrrrrrU�srUcCsDt�|||�}|j�|�}||ur t|�tttfvr ||_||_	|Sr[)
rrrWrXr�rUrYrZr[rUr^rrrr�s
�rc@s"eZdZdZdd�Zddd�ZdS)	rYzA converting list wrapper.cCrVr[)
r�r�rWrXr�rUrYrZr[rUr\rrrr��r]zConvertingList.__getitem__���cCs<t�||�}|j�|�}||urt|�tttfvr||_|Sr[)	r�rrWrXr�rUrYrZr[)r_�idxrVr�rrrr�s
�zConvertingList.popN)r_)r+r,r-rbr�rrrrrrY�srYc@rY)rZzA converting tuple wrapper.cCsBt�||�}|j�|�}||urt|�tttfvr||_||_	|Sr[)
�tupler�rWrXr�rUrYrZr[rUr\rrrr��s
�zConvertingTuple.__getitem__N)r+r,r-rbr�rrrrrZ�srZc@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
ddd	�Zee
�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rRzQ
        The configurator base class which defines some useful defaults.
        z%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$�ext_convert�cfg_convert)rs�cfgcCst|�|_||j_dSr[)rU�configrW)r_rerrrra�s
zBaseConfigurator.__init__c		Cs�|�d�}|�d�}z-|�|�}|D]"}|d|7}zt||�}Wqty4|�|�t||�}Yqw|WStyYt��dd�\}}td||f�}|||_	|_
|�w)zl
            Resolve strings to objects using standard import and attribute
            syntax.
            r/rr.NzCannot resolve %r: %s)r1r�importerr�r��ImportErrorr}r�rN�	__cause__�
__traceback__)	r_rr��used�foundrF�e�tb�vrrr�resolve�s&



��zBaseConfigurator.resolvecCs
|�|�S)z*Default converter for the ext:// protocol.)ro�r_rVrrrrbrIzBaseConfigurator.ext_convertcCs�|}|j�|�}|durtd|��||��d�}|j|��d}|r||j�|�}|r6||��d}n1|j�|�}|rg|��d}|j�|�sO||}nz
t	|�}||}Wn
t
yf||}Ynw|rr||��d�}ntd||f��|s%|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNr=rN�endre�groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�intr�)r_rV�restr�rJr`�nrrrrcs8
���zBaseConfigurator.cfg_convertcCs�t|t�st|t�rt|�}||_|St|t�s&t|t�r&t|�}||_|St|t�s9t|t�r9t|�}||_|St|t�rd|j	�
|�}|rd|��}|d}|j�
|d�}|rd|d}t||�}||�}|S)z�
            Convert values to an appropriate type. dicts, lists and tuples are
            replaced by their converting alternatives. Strings are checked to
            see if they have a conversion format and are converted if they do.
            �prefixNr)rrUrrWrYr�rZra�string_types�CONVERT_PATTERNr=�	groupdict�value_convertersrOr�)r_rVr�rJrz�	converterrrrrrX.s2�
��
�
zBaseConfigurator.convertcsr��d�}t|�s|�|�}��dd�}t�fdd��D��}|di|��}|r7|��D]
\}}t|||�q,|S)z1Configure an object with a user-supplied factory.z()r/Ncs g|]}t|�r|�|f�qSr)rSrE�rerrrwQs z5BaseConfigurator.configure_custom.<locals>.<listcomp>r)rr�rorr9�setattr)r_rer�propsr`r�r�rVrr�r�configure_customJs

z!BaseConfigurator.configure_customcCst|t�r	t|�}|S)z0Utility function which converts lists to tuples.)rr�rarprrr�as_tupleXs
zBaseConfigurator.as_tupleN)r+r,r-rbr7r:r|rqrtrurvr~�staticmethod�
__import__rfrarorbrcrXr�r�rrrrrR�s$




�"rR)r.)r�r[)��
__future__rrdr7r}�sslrg�version_infor�
basestringr{rr��typesr�	file_type�__builtin__�builtins�ConfigParser�configparserrrrr	r
�urllibrrrr
rrrr�urllib2rrrrrrr r!r"r#�httplib�	xmlrpclib�Queue�queuer$�htmlentitydefs�	raw_input�	itertoolsr%�filterr&r(�io�strr'�shutil�urllib.parse�urllib.request�urllib.error�http.client�client�request�
xmlrpc.client�html.parser�
html.entities�entities�inputr)r*rNrHrXrZrQrc�F_OK�X_OK�zipfiler�r�r>r��BaseZipExtFiler~r��	sysconfigr��	NameError�collections.abcr�r�r�r��getfilesystemencodingr�r��tokenizer��codecsr�r�r:r�r��htmlr8�cgir��collectionsr�r��reprlibr�r��importlib.utilrr�threadr�rB�dummy_thread�_abcollrrrr�logging.configrRrS�IrTrUrr�rYrarZrrrr�<module>sB�$,(0
2�b�	�C��

	�
�l�
������

�

https://t.me/RX1948 - 2025