HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-39.pyc
a

?�f���@sddlmZddlZddlZddlZzddlZWneyFdZYn0ejddk�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<�nddl=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"ddlCmDZ/ddlAmEZ$ddlFmDZ0ddl2Z2ddlGm3Z3ddlHmIZ4eJZ5ddl6m:Z:e8Z8zddlmKZKmLZLWn6e�y�Gdd�deM�ZLdddd�ZNdd�ZKYn0zddl
mOZPWn$e�yGd d!�d!eQ�ZPYn0zdd"lmRZRWn*e�yLejSejTBdfd#d$�ZRYn0dd%lUmVZWeXeWd&��rleWZVn,dd'lUmYZZGd(d)�d)eZ�ZYGd*d+�d+eW�ZVzdd,l[m\Z\Wne�y�d-d.�Z\Yn0zddl]Z]Wn e�y�dd/lm]Z]Yn0ze^Z^Wn(e_�y$dd0l`maZad1d2�Z^Yn0zejbZbejcZcWnFed�y|e�e��pRd3Zfefd4k�rdd5Zgnd6Zgd7d8�Zbd9d:�ZcYn0zdd;lhmiZiWnFe�y�dd<ljmkZkmlZlddlZe�md=�Znd>d?�Zod@dA�ZiYn0zddBlpmqZqWn e�yddBlrmqZqYn0ejddC�dDk�r&e3�jsZsnddElpmsZszddFltmuZuWn`e�y�ddGltmvZvzddHlwmxZyWne�y�dedJdK�ZyYn0GdLdM�dMev�ZuYn0zddNlzm{Z{WnDe�y�zddNl|m{Z{Wne�y�dfdOdP�Z{Yn0Yn0zddQltm}Z}Wn�e�y�zddRl~mZ�Wn e�yJddRl�mZ�Yn0zddSl�m�Z�m�Z�m�Z�Wne�yxYn0GdTdU�dUe��Z}Yn0zddVl�m�Z�m�Z�Wnte�ye�mdWej��Z�dXdY�Z�GdZd[�d[e��Z�dgd\d]�Z�Gd^d_�d_e��Z�Gd`da�dae��Z�Gdbdc�dceQ�Z�Yn0dS)h�)�absolute_importN�)�StringIO)�FileType�)�shutil)�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�>/usr/lib/python3.9/site-packages/pip/_vendor/distlib/compat.pyrs

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

r0)�
TextIOWrapper)	rr	r
r0rrrrr)
rr
rrrr r!r"r#r$)rrr)�filterfalse)�match_hostname�CertificateErrorc@seZdZdS)r4N)�__name__�
__module__�__qualname__rrrrr4^sr4c
Cs�g}|sdS|�d�}|d|dd�}}|�d�}||krNtdt|���|sb|��|��kS|dkrv|�d�n>|�d	�s�|�d	�r�|�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�.rrN�*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)�split�countr4�repr�lower�append�
startswithr+�escape�replacer,�join�
IGNORECASEr-)
Zdn�hostnameZ
max_wildcardsZpats�partsZleftmostZ	remainderZ	wildcards�frag�patrrr�_dnsname_matchbs*


�rHcCs�|std��g}|�dd�}|D]*\}}|dkr t||�r@dS|�|�q |s�|�dd�D]6}|D],\}}|dkrdt||�r�dS|�|�qdq\t|�dkr�td	|d
�tt|��f��n*t|�dkr�td||df��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_REQUIREDZsubjectAltNamerZDNSNZsubjectZ
commonNamerz&hostname %r doesn't match either of %s�, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	�
ValueError�getrHr>�lenr4rB�mapr<)ZcertrDZdnsnamesZsan�key�value�subrrrr3�s2

�
�r3)�SimpleNamespacec@seZdZdZdd�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)r5r6r7�__doc__rYrrrrrR�srR)�whichcs"dd�}tj���r&|�|�r"�SdS|dur>tj�dtj�}|sFdS|�tj�}tj	dkr�tj
|vrt|�dtj
�tj�dd��tj�}t�fd	d
�|D��r��g}q‡fdd�|D�}n�g}t
�}|D]P}tj�|�}||vr�|�|�|D](}	tj�||	�}
||
|�r�|
Sq�q�dS)
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�|�o$t�||�o$tj�|�SrS)�os�path�exists�access�isdir)�fn�moderrr�
_access_check�s�zwhich.<locals>._access_checkN�PATHZwin32rZPATHEXT�c3s |]}����|���VqdSrS)r=�endswith��.0�ext��cmdrr�	<genexpr>��zwhich.<locals>.<genexpr>csg|]}�|�qSrrrgrjrr�
<listcomp>�rmzwhich.<locals>.<listcomp>)r\r]�dirname�environrK�defpathr:�pathsep�sys�platform�curdir�insert�any�set�normcase�addrB)rkrbr]rcZpathext�files�seen�dirZnormdirZthefile�namerrjrr[�s8





r[)�ZipFile�	__enter__)�
ZipExtFilec@s$eZdZdd�Zdd�Zdd�ZdS)r�cCs|j�|j�dSrSrT)rW�baserrrrYszZipExtFile.__init__cCs|SrSr�rWrrrr�szZipExtFile.__enter__cGs|��dSrS��close�rW�exc_inforrr�__exit__szZipExtFile.__exit__N)r5r6r7rYr�r�rrrrr�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)rcCs|SrSrr�rrrr�"szZipFile.__enter__cGs|��dSrSr�r�rrrr�%szZipFile.__exit__cOs tj|g|�Ri|��}t|�SrS)�BaseZipFile�openr�)rW�argsrXr�rrrr�)szZipFile.openN)r5r6r7r�r�r�rrrrr!sr)�python_implementationcCs0dtjvrdStjdkrdStj�d�r,dSdS)z6Return a string identifying the Python implementation.ZPyPy�javaZJythonZ
IronPythonZCPython)rs�versionr\r~r?rrrrr�0s

r�)�	sysconfig)�CallablecCs
t|t�SrS)rr�)�objrrr�callableDsr�r�mbcs�strict�surrogateescapecCs:t|t�r|St|t�r$|�tt�Stdt|�j��dS�Nzexpect bytes or str, not %s)	r�bytes�	text_typer�_fsencoding�	_fserrors�	TypeError�typer5��filenamerrr�fsencodeXs

�r�cCs:t|t�r|St|t�r$|�tt�Stdt|�j��dSr�)	rr�r��decoder�r�r�r�r5r�rrr�fsdecodeas

�r�)�detect_encoding)�BOM_UTF8�lookupzcoding[:=]\s*([-\w.]+)cCsH|dd����dd�}|dks*|�d�r.dS|dvs@|�d�rDd	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�)r=rAr?)�orig_enc�encrrr�_get_normal_namers�r�cs�z�jj�Wnty"d�Yn0d�d}d}�fdd�}��fdd�}|�}|�t�rnd�|d	d�}d
}|sz|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.
        NFrcs"z��WStyYdS0dS)Nrm)�
StopIterationr)�readlinerr�read_or_stop�sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn2ty@d}�dur4d�|��}t|��Yn0t�|�}|sTdSt|d�}zt|�}Wn8ty��dur�d|}nd��|�}t|��Yn0�r�|j	dkrԈdur�d}n
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�msgZmatches�encoding�codec)�	bom_foundr�rr�find_cookie�s8

�

z$detect_encoding.<locals>.find_cookieTrz	utf-8-sig)�__self__r~�AttributeErrorr?r�)r�r��defaultr�r��first�secondr)r�r�r�rr�}s4
&


r�)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)Nc	sLt|�t�f}|�vr�S��|�z�|�}W��|�n��|�0|SrS)�id�	get_identrz�discard)rWrN�result)�	fillvalue�repr_running�
user_functionrr�wrapper�s

z=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr6rZr5�__annotations__)rx�getattrr6rZr5r�)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|�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)rWr�rrrrYszChainMap.__init__cCst|��dSrS)�KeyError�rWrNrrr�__missing__szChainMap.__missing__c	Cs8|jD]&}z||WSty*Yq0q|�|�SrS)r�r�r�)rWrN�mappingrrr�__getitem__s
zChainMap.__getitem__NcCs||vr||S|SrSr�rWrNr�rrrrK%szChainMap.getcCstt�j|j��SrS)rLrx�unionr�r�rrr�__len__(szChainMap.__len__cCstt�j|j��SrS)�iterrxr�r�r�rrr�__iter__+szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|vVqdSrSr)rh�m�rNrrrl/rmz(ChainMap.__contains__.<locals>.<genexpr>�rwr�r�rr�r�__contains__.szChainMap.__contains__cCs
t|j�SrSr�r�rrr�__bool__1szChainMap.__bool__cCsd�|d�tt|j���S)Nz{0.__class__.__name__}({1})rI)r�rBrMr<r�r�rrr�__repr__4s�zChainMap.__repr__cGs|tj|g|�R��S)z?Create a ChainMap with a single dict created from the iterable.)�dict�fromkeys)�cls�iterabler�rrrr�9szChainMap.fromkeyscCs&|j|jd��g|jdd��R�S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN)�	__class__r��copyr�rrrr�>sz
ChainMap.copycCs|jig|j�R�S)z;New ChainMap with a new dict followed by all previous maps.�r�r�r�rrr�	new_childDszChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rNr�r�rrr�parentsHszChainMap.parentscCs||jd|<dS)Nr)r�)rWrNrOrrr�__setitem__MszChainMap.__setitem__cCs6z|jd|=Wn ty0td�|���Yn0dS)Nr�(Key not found in the first mapping: {!r})r�r�r�r�rrr�__delitem__PszChainMap.__delitem__cCs0z|jd��WSty*td��Yn0dS)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�r�rrrr�VszChainMap.popitemcGs@z|jdj|g|�R�WSty:td�|���Yn0dS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr�N)r��popr�r�)rWrNr�rrrr�]szChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.rN)r��clearr�rrrr�dszChainMap.clear)N)r5r6r7rZrYr�r�rKr�r�r�r�r�r��classmethodr�r��__copy__r��propertyr�r�r�r�r�r�rrrrr�s.



r�)�cache_from_sourcecCs0|�d�sJ�|durd}|r$d}nd}||S)Nz.pyT�c�o)rf)r]�debug_override�suffixrrrr�nsr�)�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 ordercOspt|�dkrtdt|���z
|jWn4tyZg|_}||dg|dd�<i|_Yn0|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.

            rz$expected at most 1 arguments, got %dN)rLr��_OrderedDict__rootr��_OrderedDict__map�_OrderedDict__update)rWr��kwds�rootrrrrY�s

zOrderedDict.__init__cCsF||vr6|j}|d}|||g|d<|d<|j|<||||�dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rWrNrOZdict_setitemr�lastrrrr��s
 zOrderedDict.__setitem__cCs0|||�|j�|�\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr�)rWrNZdict_delitem�	link_prev�	link_nextrrrr��s
zOrderedDict.__delitem__ccs.|j}|d}||ur*|dV|d}qdS)zod.__iter__() <==> iter(od)rr)N�r�rWrZcurrrrrr��s

zOrderedDict.__iter__ccs.|j}|d}||ur*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rr)Nr	r
rrr�__reversed__�s

zOrderedDict.__reversed__cCsbz@|j��D]}|dd�=q|j}||dg|dd�<|j��WntyRYn0t�|�dS)z.od.clear() -> None.  Remove all items from od.N)r�
itervaluesrr�r�r�)rWZnoderrrrr��szOrderedDict.clearTcCs||std��|j}|r8|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 emptyrrr))r�rrr�r�)rWrr�linkrrrNrOrrrr��s 
zOrderedDict.popitemcCst|�S)zod.keys() -> list of keys in od)r�r�rrr�keys�szOrderedDict.keyscs�fdd��D�S)z#od.values() -> list of values in odcsg|]}�|�qSrr�rhrNr�rrrn�rmz&OrderedDict.values.<locals>.<listcomp>rr�rr�r�values�szOrderedDict.valuescs�fdd��D�S)z.od.items() -> list of (key, value) pairs in odcsg|]}|�|f�qSrrrr�rrrn�rmz%OrderedDict.items.<locals>.<listcomp>rr�rr�r�items�szOrderedDict.itemscCst|�S)z0od.iterkeys() -> an iterator over the keys in od)r�r�rrr�iterkeys�szOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNr�rW�krrrr�szOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrrrrr�	iteritemsszOrderedDict.iteritemscOs�t|�dkr tdt|�f��n|s,td��|d}d}t|�dkrL|d}t|t�rn|D]}||||<qZn<t|d�r�|��D]}||||<q�n|D]\}}|||<q�|��D]\}}|||<q�dS)	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)rrrrN)rLr�rr��hasattrrr)r�rrW�otherrNrOrrrrVs(	�


zOrderedDict.updatecCs0||vr||}||=|S||jur,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�)rWrNr�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�
setdefault7szOrderedDict.setdefaultcCsn|si}t|�t�f}||vr"dSd||<z6|sFd|jjfW||=Sd|jj|��fW||=S||=0dS)zod.__repr__() <==> repr(od)r�rz%s()z%s(%r)N)r��
_get_identr�r5r)rWZ
_repr_runningZcall_keyrrrr�>s��zOrderedDict.__repr__csX�fdd��D�}t����}tt��D]}|�|d�q(|rL�j|f|fS�j|ffS)z%Return state information for picklingcsg|]}|�|g�qSrr�rhrr�rrrnNrmz*OrderedDict.__reduce__.<locals>.<listcomp>N)�varsr�r�r�r�)rWrZ	inst_dictrrr�r�
__reduce__LszOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od)r�r�rrrr�VszOrderedDict.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)r�r�rO�drNrrrr�Zs
zOrderedDict.fromkeyscCs6t|t�r*t|�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.

            )rr�rLrr��__eq__�rWrrrrres
 zOrderedDict.__eq__cCs
||kSrSrr rrr�__ne__nszOrderedDict.__ne__cCst|�S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r�r�rrr�viewkeyssszOrderedDict.viewkeyscCst|�S)z<od.viewvalues() -> an object providing a view on od's values)r�r�rrr�
viewvalueswszOrderedDict.viewvaluescCst|�S)zBod.viewitems() -> a set-like object providing a view on od's items)rr�rrr�	viewitems{szOrderedDict.viewitems)T)N)N)N)"r5r6r7rZrYr�r�r�r�rr�r�rrrrrrrVr�objectrr�rr�rr�r�r�rr!r"r#r$rrrrr��s:
	




	r�)�BaseConfigurator�valid_identz^[a-z_][a-z0-9_]*$cCst�|�}|std|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIERr-rJ)rr�rrrr'�s
r'c@s"eZdZdZdd�Zddd�ZdS)�ConvertingDictz A converting dictionary wrapper.cCsJt�||�}|j�|�}||urF|||<t|�tttfvrF||_||_	|SrS)
r�r��configurator�convertr�r)�ConvertingList�ConvertingTuple�parentrN�rWrNrOr�rrrr��s
�zConvertingDict.__getitem__NcCsLt�|||�}|j�|�}||urH|||<t|�tttfvrH||_||_	|SrS)
r�rKr*r+r�r)r,r-r.rN�rWrNr�rOr�rrrrK�s
�zConvertingDict.get)N)r5r6r7rZr�rKrrrrr)�sr)cCsDt�|||�}|j�|�}||ur@t|�tttfvr@||_||_	|SrS)
r�r�r*r+r�r)r,r-r.rNr0rrrr��s
�r�c@s"eZdZdZdd�Zddd�ZdS)	r,zA converting list wrapper.cCsJt�||�}|j�|�}||urF|||<t|�tttfvrF||_||_	|SrS)
r�r�r*r+r�r)r,r-r.rNr/rrrr��s
�zConvertingList.__getitem__���cCs<t�||�}|j�|�}||ur8t|�tttfvr8||_|SrS)	r�r�r*r+r�r)r,r-r.)rW�idxrOr�rrrr��s
�zConvertingList.popN)r1)r5r6r7rZr�r�rrrrr,�sr,c@seZdZdZdd�ZdS)r-zA converting tuple wrapper.cCsBt�||�}|j�|�}||ur>t|�tttfvr>||_||_	|SrS)
�tupler�r*r+r�r)r,r-r.rNr/rrrr��s
�zConvertingTuple.__getitem__N)r5r6r7rZr�rrrrr-�sr-c@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)r&zQ
        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)riZcfgcCst|�|_||j_dSrS)r)�configr*)rWr6rrrrY�s
zBaseConfigurator.__init__c		Cs�|�d�}|�d�}z\|�|�}|D]F}|d|7}zt||�}Wq$tyh|�|�t||�}Yq$0q$|WSty�t��dd�\}}td||f�}|||_	|_
|�Yn0dS)zl
            Resolve strings to objects using standard import and attribute
            syntax.
            r8rrNzCannot resolve %r: %s)r:r��importerr�r��ImportErrorrsr�rJ�	__cause__�
__traceback__)	rWrr~Zused�foundrF�e�tb�vrrr�resolve�s"



zBaseConfigurator.resolvecCs
|�|�S)z*Default converter for the ext:// protocol.)r?�rWrOrrrr4szBaseConfigurator.ext_convertcCs�|}|j�|�}|dur&td|��n�||��d�}|j|��d}|r�|j�|�}|rn||��d}nb|j�|�}|r�|��d}|j�|�s�||}n0zt	|�}||}Wnt
y�||}Yn0|r�||��d�}qHtd||f��qH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNr-rJ�endr6�groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�intr�)rWrO�restr�rr2�nrrrr5s4
�zBaseConfigurator.cfg_convertcCs�t|t�s$t|t�r$t|�}||_n�t|t�sHt|t�rHt|�}||_nzt|t�slt|t�rlt|�}||_nVt|t�r�|j	�
|�}|r�|��}|d}|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�)rr)r�r*r,r�r-r3�string_types�CONVERT_PATTERNr-�	groupdict�value_convertersrKr�)rWrOr�rrJZ	converterr�rrrr+2s,
�

zBaseConfigurator.convertcsr��d�}t|�s|�|�}��dd�}t�fdd��D��}|fi|��}|rn|��D]\}}t|||�qX|S)z1Configure an object with a user-supplied factory.z()r8Ncs g|]}t|�r|�|f�qSr)r'r�r6rrrnUrmz5BaseConfigurator.configure_custom.<locals>.<listcomp>)r�r�r?r�r�setattr)rWr6r�ZpropsrXr�r~rOrrOr�configure_customNs

z!BaseConfigurator.configure_customcCst|t�rt|�}|S)z0Utility function which converts lists to tuples.)rr�r3r@rrr�as_tuple\s
zBaseConfigurator.as_tupleN)r5r6r7rZr+r,rLrArDrErFrN�staticmethod�
__import__r7rYr?r4r5r+rQrRrrrrr&�s"




�"r&)r)r�)N)N)�Z
__future__rr\r+rsZsslr8�version_inforZ
basestringrKrr��typesrZ	file_typeZ__builtin__�builtinsZConfigParserZconfigparserZ	_backportrrr	r
rrZurllibr
rrrrrrrZurllib2rrrrr r!r"r#r$r%ZhttplibZ	xmlrpclibZQueueZqueuer&ZhtmlentitydefsZ	raw_input�	itertoolsr'�filterr(r2r*r0�io�strr1�urllib.parseZurllib.requestZurllib.errorZhttp.clientZclientZrequestZ
xmlrpc.clientZhtml.parserZ
html.entitiesZentities�inputr3r4rJrHrQrRr%r[�F_OK�X_OKZzipfilerr�rr�ZBaseZipExtFilertr�r�r��	NameError�collections.abcr�r�r�r��getfilesystemencodingr�r��tokenizer��codecsr�r�r,r�r�Zhtmlr@Zcgir��collectionsr�r��reprlibr�r��importlib.utilr�Zimpr��threadr�rZdummy_threadZ_abcollr�r�rr�Zlogging.configr&r'�Ir(r)r�r�r,r3r-rrrr�<module>s,
$,,0
2+A


		
[
b
w