Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.12.154.243
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : compat.cpython-36.pyc
3

���ea���@sddlmZddlZddlZddlZyddlZWnek
rHdZYnXejddk�r~ddlmZe	fZ
eZddl
mZddlZddlZddlmZddlmZmZmZmZmZdd	lmZmZmZm Z m!Z!m"Z"m#Z#d
d�Zddl$Z$ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-e�r&dd
l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;dd�Z<�nddl=mZe>fZ
e>Zddl=m?ZddlZddlZddlZddl@mZmZmZm<Z<mZmZmZmZm#Z#ddlAm&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-e�r&dd
lAm.Z.ddlBm(Z(m'Z'm"Z"ddlCjDZ/ddlAjEZ$ddlFjDZ0ddl2Z2ddlGm3Z3ddlHjIZ4eJZ5ddl6m:Z:e8Z8yddlmKZKmLZLWn8ek
�r�Gdd�deM�ZLdcdd�ZNdd�ZKYnXyddl
mOZPWn&ek
�rGd d!�d!eQ�ZPYnXydd"lmRZRWn,ek
�rLejSejTBdfd#d$�ZRYnXdd%lUmVZWeXeWd&��rleWZVn,dd'lUmYZZGd(d)�d)eZ�ZYGd*d+�d+eW�ZVydd,l[m\Z\Wnek
�r�d-d.�Z\YnXyddl]Z]Wn"ek
�r�dd/lm]Z]YnXye^Z^Wn*e_k
�r*dd0l`maZad1d2�Z^YnXyejbZbejcZcWnBedk
�r~eje�Zfefd3k�rfd4Zgnd5Zgd6d7�Zbd8d9�ZcYnXydd:lhmiZiWnHek
�r�dd;ljmkZkmlZlddlZejmd<�Znd=d>�Zod?d@�ZiYnXyddAlpmqZqWn"ek
�rddAlrmqZqYnXejddB�ddk�r,e3�jsZsnddDlpmsZsyddEl`mtZtWndek
�r�ddFl`muZuyddGlvmwZxWn ek
�r�dedIdJ�ZxYnXGdKdL�dLeu�ZtYnXyddMlymzZzWn ek
�r�dfdNdO�ZzYnXyddPl`m{Z{Wn�ek
�rzyddQl|m}Z~Wn"ek
�r4ddQlm}Z~YnXyddRl�m�Z�m�Z�m�Z�Wnek
�rdYnXGdSdT�dTe��Z{YnXyddUl�m�Z�m�Z�Wnvek
�rejmdVej��Z�dWdX�Z�GdYdZ�dZe��Z�dgd[d\�Z�Gd]d^�d^e��Z�Gd_d`�d`e��Z�Gdadb�dbeQ�Z�YnXdS)h�)�absolute_importN�)�StringIO)�FileType�)�shutil)�urlparse�
urlunparse�urljoin�urlsplit�
urlunsplit)�urlretrieve�quote�unquote�url2pathname�pathname2url�ContentTooShortError�	splittypecCst|t�r|jd�}t|�S)Nzutf-8)�
isinstance�unicode�encode�_quote)�s�r�/usr/lib/python3.6/compat.pyrs

r)	�Request�urlopen�URLError�	HTTPError�HTTPBasicAuthHandler�HTTPPasswordMgr�HTTPHandler�HTTPRedirectHandler�build_opener)�HTTPSHandler)�
HTMLParser)�ifilter)�ifilterfalsecCs<tdkrddl}|jd�atj|�}|r4|jdd�Sd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz^(.*)@(.*)$r�)�	_userprog�re�compile�match�group)�hostr*r,rrr�	splituser4s

r/)�
TextIOWrapper)	rr	r
r/rrrrr)
rr
rrrrr r!r"r#)rrr)�filterfalse)�match_hostname�CertificateErrorc@seZdZdS)r3N)�__name__�
__module__�__qualname__rrrrr3^sr3c
Cs�g}|sdS|jd�}|d|dd�}}|jd�}||krNtdt|���|sb|j�|j�kS|dkrv|jd�n>|jd	�s�|jd	�r�|jtj|��n|jtj|�j	d
d��x|D]}|jtj|��q�Wtj
dd
j|�dtj�}	|	j
|�S)zpMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        F�.rrN�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr3�repr�lower�append�
startswithr*�escape�replacer+�join�
IGNORECASEr,)
Zdn�hostnameZ
max_wildcardsZpats�partsZleftmostZ	remainderZ	wildcards�fragZpatrrr�_dnsname_matchbs(


rFcCs�|std��g}|jdf�}x0|D](\}}|dkr"t||�r@dS|j|�q"W|s�xF|jdf�D]6}x0|D](\}}|dkrjt||�r�dS|j|�qjWq`Wt|�dkr�td|d	jtt|��f��n*t|�dkr�td
||df��ntd��dS)
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_REQUIREDZsubjectAltNameZDNSNZsubjectZ
commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	�
ValueError�getrFr=�lenr3rA�mapr;)ZcertrCZdnsnamesZsan�key�value�subrrrr2�s.

r2)�SimpleNamespacec@seZdZdZdd�ZdS)�	ContainerzR
        A generic container for when multiple values need to be returned
        cKs|jj|�dS)N)�__dict__�update)�self�kwargsrrr�__init__�szContainer.__init__N)r4r5r6�__doc__rTrrrrrO�srO)�whichcs"dd�}tjj��r&|�|�r"�SdS|dkr>tjjdtj�}|sFdS|jtj�}tj	dkr�tj
|krt|jdtj
�tjjdd�jtj�}t�fd	d
�|D��r��g}q‡fdd�|D�}n�g}t
�}xT|D]L}tjj|�}||kr�|j|�x(|D] }	tjj||	�}
||
|�r�|
Sq�Wq�WdS)
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&tjj|�o$tj||�o$tjj|�S)N)�os�path�exists�access�isdir)�fn�moderrr�
_access_check�szwhich.<locals>._access_checkN�PATHZwin32rZPATHEXT�c3s |]}�j�j|j��VqdS)N)r<�endswith)�.0�ext)�cmdrr�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSrr)rbrc)rdrr�
<listcomp>�szwhich.<locals>.<listcomp>)rWrX�dirname�environrH�defpathr9�pathsep�sys�platform�curdir�insert�any�set�normcase�addrA)rdr]rXr^Zpathext�files�seen�dirZnormdirZthefile�namer)rdrrV�s8







rV)�ZipFile�	__enter__)�
ZipExtFilec@s$eZdZdd�Zdd�Zdd�ZdS)rycCs|jj|j�dS)N)rPrQ)rR�baserrrrTszZipExtFile.__init__cCs|S)Nr)rRrrrrxszZipExtFile.__enter__cGs|j�dS)N)�close)rR�exc_inforrr�__exit__szZipExtFile.__exit__N)r4r5r6rTrxr}rrrrrysryc@s$eZdZdd�Zdd�Zdd�ZdS)rwcCs|S)Nr)rRrrrrx"szZipFile.__enter__cGs|j�dS)N)r{)rRr|rrrr}%szZipFile.__exit__cOstj|f|�|�}t|�S)N)�BaseZipFile�openry)rR�argsrSrzrrrr)szZipFile.openN)r4r5r6rxr}rrrrrrw!srw)�python_implementationcCs0dtjkrdStjdkrdStjjd�r,dSdS)z6Return a string identifying the Python implementation.ZPyPy�javaZJythonZ
IronPythonZCPython)rk�versionrWrvr>rrrrr�0s

r�)�	sysconfig)�CallablecCs
t|t�S)N)rr�)�objrrr�callableDsr��mbcs�strict�surrogateescapecCs:t|t�r|St|t�r$|jtt�Stdt|�j��dS)Nzexpect bytes or str, not %s)	r�bytes�	text_typer�_fsencoding�	_fserrors�	TypeError�typer4)�filenamerrr�fsencodeRs

r�cCs:t|t�r|St|t�r$|jtt�Stdt|�j��dS)Nzexpect bytes or str, not %s)	rr�r��decoder�r�r�r�r4)r�rrr�fsdecode[s

r�)�detect_encoding)�BOM_UTF8�lookupzcoding[:=]\s*([-\w.]+)cCsH|dd�j�jdd�}|dks*|jd�r.dS|d
ks@|jd�rDdS|S)z(Imitates get_normal_name in tokenizer.c.N��_�-zutf-8zutf-8-�latin-1�
iso-8859-1�iso-latin-1�latin-1-�iso-8859-1-�iso-latin-1-)r�r�r�)r�r�r�)r<r@r>)�orig_enc�encrrr�_get_normal_namels
r�cs�y�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|jt�rpd�|d	d�}d
}|s||gfS||�}|r�||gfS|�}|s�||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.
        NFzutf-8cs y��Stk
rdSXdS)N�)�
StopIterationr)�readlinerr�read_or_stop�sz%detect_encoding.<locals>.read_or_stopcs�y|jd�}Wn4tk
rBd}�dk	r6dj|��}t|��YnXtj|�}|sVdSt|d�}yt|�}Wn:tk
r��dkr�d|}ndj�|�}t|��YnX�r�|j	dkr؈dkr�d}n
dj��}t|��|d	7}|S)
Nzutf-8z'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��LookupErrorrv)�line�line_string�msgZmatches�encoding�codec)�	bom_foundr�rr�find_cookie�s6



z$detect_encoding.<locals>.find_cookieTrz	utf-8-sig)�__self__rv�AttributeErrorr>r�)r�r��defaultr�r��first�secondr)r�r�r�rr�ws4
&


r�)r?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)NcsBt|�t�f}|�kr�S�j|�z�|�}Wd�j|�X|S)N)�id�	get_identrr�discard)rRrK�result)�	fillvalue�repr_running�
user_functionrr�wrapper�s
z=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr5rUr4�__annotations__)rp�getattrr5rUr4r�)r�r�)r�)r�r�r�decorating_function�sz,_recursive_repr.<locals>.decorating_functionr)r�r�r)r�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|�pig|_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)rRr�rrrrT
szChainMap.__init__cCst|��dS)N)�KeyError)rRrKrrr�__missing__szChainMap.__missing__cCs8x,|jD]"}y||Stk
r(YqXqW|j|�S)N)r�r�r�)rRrK�mappingrrr�__getitem__s
zChainMap.__getitem__NcCs||kr||S|S)Nr)rRrKr�rrrrHszChainMap.getcCstt�j|j��S)N)rIrp�unionr�)rRrrr�__len__"szChainMap.__len__cCstt�j|j��S)N)�iterrpr�r�)rRrrr�__iter__%szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|kVqdS)Nr)rb�m)rKrrre)sz(ChainMap.__contains__.<locals>.<genexpr>)ror�)rRrKr)rKr�__contains__(szChainMap.__contains__cCs
t|j�S)N)ror�)rRrrr�__bool__+szChainMap.__bool__cCsdj|djtt|j���S)Nz{0.__class__.__name__}({1})z, )r�rArJr;r�)rRrrr�__repr__.szChainMap.__repr__cGs|tj|f|���S)z?Create a ChainMap with a single dict created from the iterable.)�dict�fromkeys)�cls�iterabler�rrrr�3szChainMap.fromkeyscCs$|j|jdj�f|jdd���S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN)�	__class__r��copy)rRrrrr�8sz
ChainMap.copycCs|jif|j��S)z;New ChainMap with a new dict followed by all previous maps.)r�r�)rRrrr�	new_child>szChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rN)r�r�)rRrrr�parentsBszChainMap.parentscCs||jd|<dS)Nr)r�)rRrKrLrrr�__setitem__GszChainMap.__setitem__cCs8y|jd|=Wn"tk
r2tdj|���YnXdS)Nrz(Key not found in the first mapping: {!r})r�r�r�)rRrKrrr�__delitem__JszChainMap.__delitem__cCs0y|jdj�Stk
r*td��YnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)r��popitemr�)rRrrrr�PszChainMap.popitemcGs>y|jdj|f|��Stk
r8tdj|���YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rz(Key not found in the first mapping: {!r}N)r��popr�r�)rRrKr�rrrr�WszChainMap.popcCs|jdj�dS)z'Clear maps[0], leaving maps[1:] intact.rN)r��clear)rRrrrr�^szChainMap.clear)N)r4r5r6rUrTr�r�rHr�r�r�r�r�r��classmethodr�r��__copy__r��propertyr�r�r�r�r�r�rrrrr�s(
r�)�cache_from_sourcecCs0|jd�st�|dkrd}|r$d}nd}||S)Nz.pyT�c�o)ra�AssertionError)rX�debug_override�suffixrrrr�esr�)�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#�Zd8d$d%�Zd&d'�Zd(d)�Zed9d*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Z d4d5�Z!d!S):r�z)Dictionary that remembers insertion ordercOsnt|�dkrtdt|���y
|jWn6tk
r\g|_}||dg|dd�<i|_YnX|j||�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.

            rz$expected at most 1 arguments, got %dN)rIr��_OrderedDict__rootr��_OrderedDict__map�_OrderedDict__update)rRr��kwds�rootrrrrT�s

zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||�dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)r�r�)rRrKrLZdict_setitemr��lastrrrr��s
 zOrderedDict.__setitem__cCs0|||�|jj|�\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)r�r�)rRrKZdict_delitem�	link_prev�	link_nextrrrr��s
zOrderedDict.__delitem__ccs2|j}|d}x||k	r,|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r�)rRr��currrrrr��s


zOrderedDict.__iter__ccs2|j}|d}x||k	r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r�)rRr�r�rrr�__reversed__�s


zOrderedDict.__reversed__cCshyDx|jj�D]}|dd�=qW|j}||dg|dd�<|jj�Wntk
rXYnXtj|�dS)z.od.clear() -> None.  Remove all items from od.N)r��
itervaluesr�r�r�r�)rRZnoder�rrrr��szOrderedDict.clearTcCs||std��|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=tj||�}||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 emptyrrr()r�r�r�r�r�)rRr�r��linkr�r�rKrLrrrr��s 
zOrderedDict.popitemcCst|�S)zod.keys() -> list of keys in od)r�)rRrrr�keys�szOrderedDict.keyscs�fdd��D�S)z#od.values() -> list of values in odcsg|]}�|�qSrr)rbrK)rRrrrf�sz&OrderedDict.values.<locals>.<listcomp>r)rRr)rRr�values�szOrderedDict.valuescs�fdd��D�S)z.od.items() -> list of (key, value) pairs in odcsg|]}|�|f�qSrr)rbrK)rRrrrf�sz%OrderedDict.items.<locals>.<listcomp>r)rRr)rRr�items�szOrderedDict.itemscCst|�S)z0od.iterkeys() -> an iterator over the keys in od)r�)rRrrr�iterkeys�szOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)rR�krrrr��s
zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)rRrrrr�	iteritems�s
zOrderedDict.iteritemscOs�t|�dkr tdt|�f��n|s,td��|d}f}t|�dkrL|d}t|t�rrx^|D]}||||<q\WnDt|d�r�x8|j�D]}||||<q�Wnx|D]\}}|||<q�Wx|j�D]\}}|||<q�WdS)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)rrrN)rIr�rr��hasattrrr)r�r�rR�otherrKrLrrrrQ�s&	


zOrderedDict.updatecCs0||kr||}||=|S||jkr,t|��|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�)rRrKr�r�rrrr�!s
zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)rRrKr�rrr�
setdefault.szOrderedDict.setdefaultcCs^|si}t|�t�f}||kr"dSd||<z&|s>d|jjfSd|jj|j�fS||=XdS)zod.__repr__() <==> repr(od)z...rz%s()z%s(%r)N)r��
_get_identr�r4r)rRZ
_repr_runningZcall_keyrrrr�5szOrderedDict.__repr__cs\�fdd��D�}t��j�}xtt��D]}|j|d�q*W|rP�j|f|fS�j|ffS)z%Return state information for picklingcsg|]}|�|g�qSrr)rbr)rRrrrfEsz*OrderedDict.__reduce__.<locals>.<listcomp>N)�varsr�r�r�r�)rRrZ	inst_dictrr)rRr�
__reduce__CszOrderedDict.__reduce__cCs
|j|�S)z!od.copy() -> a shallow copy of od)r�)rRrrrr�MszOrderedDict.copycCs |�}x|D]}|||<qW|S)z�OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
            and values equal to v (which defaults to None).

            r)r�r�rL�drKrrrr�Qs
zOrderedDict.fromkeyscCs6t|t�r*t|�t|�ko(|j�|j�kStj||�S)z�od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
            while comparison to a regular mapping is order-insensitive.

            )rr�rIrr��__eq__)rRrrrrr\s
 zOrderedDict.__eq__cCs
||kS)Nr)rRrrrr�__ne__eszOrderedDict.__ne__cCst|�S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r�)rRrrr�viewkeysjszOrderedDict.viewkeyscCst|�S)z<od.viewvalues() -> an object providing a view on od's values)r�)rRrrr�
viewvaluesnszOrderedDict.viewvaluescCst|�S)zBod.viewitems() -> a set-like object providing a view on od's items)r�)rRrrr�	viewitemsrszOrderedDict.viewitems)T)N)N)N)"r4r5r6rUrTr�r�r�r�r�r�r�rrrrr�rrQr��objectrr�r	r�rr�r�r�rrrrrrrrrr��s:
	




	r�)�BaseConfigurator�valid_identz^[a-z_][a-z0-9_]*$cCstj|�}|std|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIERr,rG)rr�rrrr|s
rc@s"eZdZdZdd�Zddd�ZdS)�ConvertingDictz A converting dictionary wrapper.cCsJtj||�}|jj|�}||k	rF|||<t|�tttfkrF||_||_	|S)N)
r�r��configurator�convertr�r�ConvertingList�ConvertingTuple�parentrK)rRrKrLr�rrrr��s
zConvertingDict.__getitem__NcCsLtj|||�}|jj|�}||k	rH|||<t|�tttfkrH||_||_	|S)N)
r�rHrrr�rrrrrK)rRrKr�rLr�rrrrH�s
zConvertingDict.get)N)r4r5r6rUr�rHrrrrr�srcCsDtj|||�}|jj|�}||k	r@t|�tttfkr@||_||_	|S)N)
r�r�rrr�rrrrrK)rRrKr�rLr�rrrr��s
r�c@s"eZdZdZdd�Zd	dd�ZdS)
rzA converting list wrapper.cCsJtj||�}|jj|�}||k	rF|||<t|�tttfkrF||_||_	|S)N)
r�r�rrr�rrrrrK)rRrKrLr�rrrr��s
zConvertingList.__getitem__rcCs<tj||�}|jj|�}||k	r8t|�tttfkr8||_|S)N)	r�r�rrr�rrrr)rR�idxrLr�rrrr��s
zConvertingList.popN���)r)r4r5r6rUr�r�rrrrr�src@seZdZdZdd�ZdS)rzA converting tuple wrapper.cCsBtj||�}|jj|�}||k	r>t|�tttfkr>||_||_	|S)N)
�tupler�rrr�rrrrrK)rRrKrLr�rrrr��s
zConvertingTuple.__getitem__N)r4r5r6rUr�rrrrr�src@s�eZdZdZejd�Zejd�Zejd�Zejd�Z	ejd�Z
ddd	�Zee
�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rzQ
        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)rcZcfgcCst|�|_||j_dS)N)r�configr)rRr"rrrrT�s
zBaseConfigurator.__init__c	Cs�|jd�}|jd�}y`|j|�}xP|D]H}|d|7}yt||�}Wq&tk
rl|j|�t||�}Yq&Xq&W|Stk
r�tj�dd�\}}td||f�}|||_	|_
|�YnXdS)zl
            Resolve strings to objects using standard import and attribute
            syntax.
            r7rrNzCannot resolve %r: %s)r9r��importerr�r��ImportErrorrkr|rG�	__cause__�
__traceback__)	rRrrvZused�foundrE�e�tb�vrrr�resolve�s"




zBaseConfigurator.resolvecCs
|j|�S)z*Default converter for the ext:// protocol.)r+)rRrLrrrr szBaseConfigurator.ext_convertcCs|}|jj|�}|dkr&td|��n�||j�d�}|j|j�d}x�|r�|jj|�}|rp||j�d}nd|jj|�}|r�|j�d}|jj|�s�||}n2yt	|�}||}Wnt
k
r�||}YnX|r�||j�d�}qJtd||f��qJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNr,rG�endr"�groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�intr�)rRrL�restr�r
r�nrrrr!s2
zBaseConfigurator.cfg_convertcCs�t|t�r&t|t�r&t|�}||_n�t|t�rLt|t�rLt|�}||_n|t|t�rrt|t�rrt|�}||_nVt|t�r�|j	j
|�}|r�|j�}|d}|jj
|d�}|r�|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�)rrr�rrr�rr�string_types�CONVERT_PATTERNr,�	groupdict�value_convertersrHr�)rRrLr�r
r5Z	converterr�rrrr)s*


zBaseConfigurator.convertcsr�jd�}t|�s|j|�}�jdd�}t�fdd��D��}|f|�}|rnx |j�D]\}}t|||�qVW|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|�r|�|f�qSr)r)rbr)r"rrrfLsz5BaseConfigurator.configure_custom.<locals>.<listcomp>)r�r�r+r�r�setattr)rRr"r�ZpropsrSr�rvrLr)r"r�configure_customEs


z!BaseConfigurator.configure_customcCst|t�rt|�}|S)z0Utility function which converts lists to tuples.)rr�r)rRrLrrr�as_tupleSs
zBaseConfigurator.as_tupleN)r4r5r6rUr*r+r7r,r/r0r1r9�staticmethod�
__import__r#rTr+r r!rr;r<rrrrr�s 




"r)r)rr�)r�)N)N)�Z
__future__rrWr*rkZsslr$�version_inforZ
basestringr6rr��typesrZ	file_typeZ__builtin__�builtinsZConfigParserZconfigparserZ	_backportrrr	r
rrZurllibr
rrrrrrrZurllib2rrrrrr r!r"r#r$ZhttplibZ	xmlrpclibZQueueZqueuer%ZhtmlentitydefsZ	raw_input�	itertoolsr&�filterr'r1r)r/�io�strr0Zurllib.parseZurllib.requestZurllib.errorZhttp.clientZclientZrequestZ
xmlrpc.clientZhtml.parserZ
html.entitiesZentities�inputr2r3rGrFrNrOrrV�F_OK�X_OKZzipfilerwr~rryZBaseZipExtFilerlr�r�r��	NameError�collectionsr�r�r�r��getfilesystemencodingr�r��tokenizer��codecsr�r�r+r�r�Zhtmlr?Zcgir�r�r��reprlibr�r�Zimpr�r�Zthreadr�r
Zdummy_threadZ_abcollr�r�r�r�Zlogging.configrr�Irrr�r�rrrrrrr�<module>s&
$,,0




2+A


		
[
b
w


© 2025 GrazzMean