Current File : //lib/python3.9/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-39.pyc
a

[��f �@s�ddlZddlmZddlZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZzddlZWney�dZYn0ddlZddlZddlZddlZddlZzddlZWney�ddlZYn0ddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e
�1e2�Z3e
�4d�Z5e
�4d�Z6e
�4d	�Z7e
�4d
�Z8e
�4d�Z9e
�4d�Z:e
�4d
�Z;e
�4d�Z<dd�Z=dd�Z>dd�Z?dd�Z@dd�ZAd�dd�ZBdd�ZCdd�ZDdd �ZEejFd!d"��ZGejFd#d$��ZHejFd�d&d'��ZIGd(d)�d)eJ�ZKd*d+�ZLGd,d-�d-eJ�ZMd.d/�ZNGd0d1�d1eJ�ZOe
�4d2e
jP�ZQd3d4�ZRd�d5d6�ZSd7d8�ZTd9d:�ZUd;d<�ZVd=d>�ZWd?d@�ZXe
�4dAe
jY�ZZe
�4dB�Z[d�dCdD�Z\e
�4dE�Z]dFdG�Z^dHdI�Z_dJdK�Z`dLZadMdN�ZbdOdP�ZcGdQdR�dReJ�ZdGdSdT�dTeJ�ZeGdUdV�dVeJ�ZfdWZgd�dYdZ�Zhd[d\�Zid]ZjGd^d_�d_eJ�Zke
�4d`�Zle
�4da�Zme
�4db�Zndcdd�Zdedf�Zoe�r�ddglmpZqmrZrmsZsGdhdi�die$jt�ZtGdjdk�dkeq�ZpGdldm�dmepe'�Zuejvddn�Zwewdok�rGdpdq�dqe$jx�Zxe�rGdrds�dse$jy�ZyGdtdu�due%jz�Zze�r>Gdvdw�dwe%j{�Z{Gdxdy�dye%j|�Z|dzd{�Z}Gd|d}�d}eJ�Z~Gd~d�de~�ZGd�d��d�e~�Z�Gd�d��d�e(�Z�Gd�d��d�eJ�Z�d�d��Z�Gd�d��d�eJ�Z�d�d��Z�d�d��Z�d�d��Z�d�d�d�d��Z�d�d��Z�dS)��N)�deque)�iglob�)�DistlibException)�string_types�	text_type�shutil�	raw_input�StringIO�cache_from_source�urlopen�urljoin�httplib�	xmlrpclib�	splittype�HTTPHandler�BaseConfigurator�valid_ident�	Container�configparser�URLError�ZipFile�fsdecode�unquote�urlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z	^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6dd����fdd���fdd���fdd���|�S)	ae
    Parse a marker string and return a dictionary containing a marker expression.

    The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in
    the expression grammar, or strings. A string contained in quotes is to be
    interpreted as a literal string, and a string not contained in quotes is a
    variable (such as os_name).
    cSs.t�|�}|r,|��d}||��d�}n�|s:td��n�|d}|dvrVtd|��d�|d�}|dd�}|g}|r�|d|kr��qqt|d|kr�|�|�|dd�}qtt�|�}|s�td|��|�|��d�||��d�}qtd�|�}td|��|�|�d�|�}|dd��	�}||fS)	Nrzunexpected end of inputz'"zinvalid expression: %s�rzerror in string literal: %szunterminated string: %s)
�
IDENTIFIER�match�groups�end�SyntaxError�replace�append�STRING_CHUNK�join�lstrip)�	remaining�m�result�qZoq�parts�s�r,�</usr/lib/python3.9/site-packages/pip/_vendor/distlib/util.py�
marker_varAs:






z parse_marker.<locals>.marker_varcs�|rR|ddkrR�|dd����\}}|ddkr@td|��|dd���}nZ�|�\}}|r�t�|�}|srq�|��d}||��d�}�|�\}}|||d�}q^|}||fS)Nr�(r�)�unterminated parenthesis: %s��op�lhs�rhs)r%r �	MARKER_OPrrr)r&r(r4r'r3r5)�markerr.r,r-�marker_expres 
z!parse_marker.<locals>.marker_exprcsR�|�\}}|rJt�|�}|s qJ||��d�}�|�\}}d||d�}q||fS)N�andr2)�ANDrr�r&r4r'r5)r8r,r-�
marker_andxs
z parse_marker.<locals>.marker_andcsR�|�\}}|rJt�|�}|s qJ||��d�}�|�\}}d||d�}q||fS)N�orr2)�ORrrr;)r<r,r-r7�s
zparse_marker.<locals>.markerr,)Z
marker_stringr,)r7r<r8r.r-�parse_marker8s
	$r?cCs0|��}|r|�d�rdSt�|�}|s4td|��|��d}||��d�}d}}}}|�r:|ddk�r:|�dd�}|dkr�td|��|d|�}	||dd���}g}|	�r0t�|	�}|s�td	|	��|�	|��d�|	|��d�}	|	�s�q0|	dd
k�rtd|	��|	dd���}	q�|�s:d}|�r�|ddk�r�|dd���}t
�|�}|�sztd
|��|��d}t|�}
|
j�r�|
j
�s�td|��||��d���}n�dd�}|ddk�r�||�\}}n�|�dd�}|dk�rtd|��|d|�}	||dd���}t�|	��r@||	�\}}nXt�|	�}|�s\td|	��|��d}
|	|��d���}	|	�r�td|	��d|
fg}|�r�|ddk�r�td|��|dd���}t|�\}}|�r�|ddk�r�td|��|�s|}nd|d�dd�|D��f}t||||||d�S)z�
    Parse a requirement passed in as a string. Return a Container
    whose attributes contain the various parts of the requirement.
    �#Nzname expected: %sr�[�]rzunterminated extra: %szmalformed extra: %s�,zcomma expected in extras: %s�@zinvalid URI: %szInvalid URL: %scSs�t�|�}d}|r�g}|��d}||��d�}t�|�}|sLtd|��|��d}|�||f�||��d�}|r�|ddkr�q�|dd���}|s�q�t�|�}|std|��q|s�d}||fS)z|
                Return a list of operator, version tuples if any are
                specified, else None.
                Nrzinvalid version: %srCr�invalid constraint: %s)�
COMPARE_OPrrr�VERSION_IDENTIFIERr r"r%)Z
ver_remainingr'�versionsr3�vr,r,r-�get_versions�s.


z'parse_requirement.<locals>.get_versionsr/r0r1rEz~=�;zinvalid requirement: %szunexpected trailing data: %s�%s %s�, cSsg|]}d|�qS)rLr,)�.0Zconr,r,r-�
<listcomp>	�z%parse_requirement.<locals>.<listcomp>)�name�extras�constraintsr7�urlZrequirement)�strip�
startswithrrr rr�findr%r"�	NON_SPACEr�scheme�netlocrFrGr?r$r)�reqr&r'ZdistnamerRZ	mark_exprrH�uri�ir+�trJ�_rIZrsr,r,r-�parse_requirement�s�


 


�r`cCs�dd�}i}|D]�\}}}tj�||�}t|�D]p}tj�||�}	t|	�D]T}
|||
�}|durn|�|d�qJ|||
�}|�tjjd��d�}
|
d|||<qJq0q|S)z%Find destinations for resources filescSsD|�tjjd�}|�tjjd�}|�|�s.J�|t|�d��d�S�N�/)r!�os�path�seprV�lenr%)�rootrdr,r,r-�get_rel_pathsz)get_resources_dests.<locals>.get_rel_pathNrb)rcrdr$r�popr!re�rstrip)Zresources_rootZrulesrhZdestinations�base�suffix�dest�prefixZabs_baseZabs_globZabs_pathZ
resource_fileZrel_pathZrel_destr,r,r-�get_resources_destss

rocCs(ttd�rd}ntjttdtj�k}|S)NZreal_prefixT�base_prefix)�hasattr�sysrn�getattr�r(r,r,r-�in_venv(s
rucCstj}t|t�st|�}|S�N)rr�
executable�
isinstancerrrtr,r,r-�get_executable2s
rycCsN|}t|�}|}|s|r|}|r|d��}||vr6qJ|rd|||f}q|S)Nrz	%c: %s
%s)r	�lower)�promptZ
allowed_charsZerror_prompt�default�pr+�cr,r,r-�proceedDsrcCs8t|t�r|��}i}|D]}||vr||||<q|Srv)rxr�split)�d�keysr(�keyr,r,r-�extract_by_keyTs
r�cCsvtjddkrt�d�|�}|��}t|�}zlt�|�}|ddd}|��D]B\}}|��D]0\}}d||f}t	|�}	|	dus�J�|	||<q`qP|WSt
y�|�dd�Yn0dd	�}
t�
�}z|
||�Wn:tj�y|��t�|�}t|�}|
||�Yn0i}|��D]R}i||<}|�|�D]4\}
}d|
|f}t	|�}	|	du�sbJ�|	||
<�q8�q|S)
Nr��utf-8�
extensionszpython.exports�exportsz%s = %scSs$t|d�r|�|�n
|�|�dS)N�	read_file)rqr�Zreadfp)�cp�streamr,r,r-�read_streamqs
z!read_exports.<locals>.read_stream)rr�version_info�codecs�	getreader�readr
�json�load�items�get_export_entry�	Exception�seekr�ConfigParserZMissingSectionHeaderError�close�textwrap�dedent�sections)r��dataZjdatar(�group�entries�krIr+�entryr�r�r�rQ�valuer,r,r-�read_exports]sD

r�cCs�tjddkrt�d�|�}t��}|��D]l\}}|�|�|��D]P}|j	dur\|j
}nd|j
|j	f}|jr�d|d�|j�f}|�
||j|�qFq,|�|�dS)Nrr�r�z%s:%sz%s [%s]rM)rrr�r��	getwriterrr�r��add_section�valuesrlrn�flagsr$�setrQ�write)r�r�r�r�rIr�r+r,r,r-�
write_exports�s

r�c	cs.t��}z|VWt�|�nt�|�0dSrv)�tempfile�mkdtempr�rmtree)Ztdr,r,r-�tempdir�sr�c	cs8t��}zt�|�dVWt�|�nt�|�0dSrv)rc�getcwd�chdir)r��cwdr,r,r-r��s

r��c	cs8t��}zt�|�dVWt�|�nt�|�0dSrv)�socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor,r,r-�socket_timeout�s

r�c@seZdZdd�Zddd�ZdS)�cached_propertycCs
||_dSrv)�func)�selfr�r,r,r-�__init__�szcached_property.__init__NcCs,|dur|S|�|�}t�||jj|�|Srv)r��object�__setattr__�__name__)r��obj�clsr�r,r,r-�__get__�s

zcached_property.__get__)N)r��
__module__�__qualname__r�r�r,r,r,r-r��sr�cCs~tjdkr|S|s|S|ddkr.td|��|ddkrFtd|��|�d�}tj|vrh|�tj�qP|srtjStjj|�S)a�Return 'pathname' as a name that will work on the native filesystem.

    The path is split on '/' and put back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rbrzpath '%s' cannot be absolute���zpath '%s' cannot end with '/')rcre�
ValueErrorr��curdir�removerdr$)�pathname�pathsr,r,r-�convert_path�s



r�c@s�eZdZd$dd�Zdd�Zdd�Zdd	�Zd%dd�Zd&dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d'dd�Zdd�Zdd�Zd d!�Zd"d#�Zd
S)(�FileOperatorFcCs||_t�|_|��dSrv)�dry_runr��ensured�_init_record)r�r�r,r,r-r��szFileOperator.__init__cCsd|_t�|_t�|_dS�NF)�recordr��
files_written�dirs_created�r�r,r,r-r��szFileOperator._init_recordcCs|jr|j�|�dSrv)r�r��add)r�rdr,r,r-�record_as_written�szFileOperator.record_as_writtencCsHtj�|�s tdtj�|���tj�|�s0dSt�|�jt�|�jkS)a�Tell if the target is newer than the source.

        Returns true if 'source' exists and is more recently modified than
        'target', or if 'source' exists and 'target' doesn't.

        Returns false if both exist and 'target' is the same age or younger
        than 'source'. Raise PackagingFileError if 'source' does not exist.

        Note that this test is not very accurate: files created in the same
        second will have the same "age".
        zfile '%r' does not existT)rcrd�existsr�abspath�stat�st_mtime)r��source�targetr,r,r-�newer�s
�zFileOperator.newerTcCs�|�tj�|��t�d||�|js�d}|rdtj�|�rDd|}n tj�|�rdtj�	|�sdd|}|rtt
|d��t�||�|�
|�dS)z8Copy a file respecting dry-run and force flags.
        zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten)�
ensure_dirrcrd�dirname�logger�infor��islinkr��isfiler�r�copyfiler�)r�Zinfile�outfile�check�msgr,r,r-�	copy_files
zFileOperator.copy_fileNcCs�tj�|�rJ�|�tj�|��t�d||�|js~|durJt|d�}nt	j|d|d�}zt
�||�W|��n
|��0|�
|�dS)NzCopying stream %s to %s�wb�w��encoding)rcrd�isdirr�r�r�r�r��openr�r�copyfileobjr�r�)r�Zinstreamr�r�Z	outstreamr,r,r-�copy_streamszFileOperator.copy_streamcCsp|�tj�|��|jsbtj�|�r.t�|�t|d��}|�|�Wd�n1sX0Y|�	|�dS)Nr�)
r�rcrdr�r�r�r�r�r�r�)r�rdr��fr,r,r-�write_binary_file's
(zFileOperator.write_binary_filecCs|�||�|��dSrv)r��encode)r�rdr�r�r,r,r-�write_text_file0szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:t�d|�q"t�|�j|B|@}t�d||�t�||�q"dS)N�posix�javazchanging mode of %szchanging mode of %s to %o)	rcrQ�_namer�r�r�r��st_mode�chmod)r��bits�mask�filesr��moder,r,r-�set_mode3szFileOperator.set_modecCs|�dd|�S)Nimi�)r�)r+r�r,r,r-�<lambda>?rPzFileOperator.<lambda>cCs|tj�|�}||jvrxtj�|�sx|j�|�tj�|�\}}|�|�t�	d|�|j
sft�|�|jrx|j
�|�dS)NzCreating %s)rcrdr�r�r�r�r�r�r�r�r��mkdirr�r�)r�rdr�r�r,r,r-r�As

zFileOperator.ensure_dirc	Cs�t||�}t�d||�|js�|s0|�||�rX|s:d}n|�|�sHJ�|t|�d�}i}|rvttd�rvtj	j
|d<tj|||dfi|��|�|�|S)NzByte-compiling %s to %s�PycInvalidationMode�invalidation_modeT)
rr�r�r�r�rVrfrq�
py_compiler��CHECKED_HASH�compiler�)	r�rd�optimize�forcernZhashed_invalidationZdpathZdiagpathZcompile_kwargsr,r,r-�byte_compileMs
zFileOperator.byte_compilecCs�tj�|�r�tj�|�r^tj�|�s^t�d|�|js@t�	|�|j
r�||jvr�|j�|�nPtj�|�rpd}nd}t�d||�|js�t�|�|j
r�||j
vr�|j
�|�dS)NzRemoving directory tree at %s�link�filezRemoving %s %s)rcrdr�r�r�r��debugr�rr�r�r�r�r�)r�rdr+r,r,r-�ensure_removed^s"



zFileOperator.ensure_removedcCsDd}|s@tj�|�r$t�|tj�}q@tj�|�}||kr:q@|}q|Sr�)rcrdr��access�W_OKr�)r�rdr(�parentr,r,r-�is_writablesszFileOperator.is_writablecCs"|js
J�|j|jf}|��|S)zV
        Commit recorded changes, turn off recording, return
        changes.
        )r�r�r�r�)r�r(r,r,r-�commits
zFileOperator.commitcCs�|js�t|j�D]}tj�|�rt�|�qt|jdd�}|D]F}t�	|�}|rz|dgks^J�tj�
||d�}t�|�t�|�q>|��dS)NT)�reverse�__pycache__r)
r��listr�rcrdr�r��sortedr��listdirr$�rmdirr�)r�r��dirsr��flist�sdr,r,r-�rollback�s

zFileOperator.rollback)F)T)N)FFNF)r�r�r�r�r�r�r�r�r�r�r�r�Zset_executable_moder�rrrrrr,r,r,r-r��s 


	

r�cCs^|tjvrtj|}nt|�}|dur,|}n.|�d�}t||�d��}|D]}t||�}qJ|S)N�.r)rr�modules�
__import__r�rsri)Zmodule_nameZdotted_path�modr(r*r}r,r,r-�resolve�s

rc@s6eZdZdd�Zedd��Zdd�Zdd�Zej	Z	d	S)
�ExportEntrycCs||_||_||_||_dSrv�rQrnrlr�)r�rQrnrlr�r,r,r-r��szExportEntry.__init__cCst|j|j�Srv)rrnrlr�r,r,r-r��szExportEntry.valuecCsd|j|j|j|jfS)Nz<ExportEntry %s = %s:%s %s>rr�r,r,r-�__repr__�s
�zExportEntry.__repr__cCsDt|t�sd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr�)rxrrQrnrlr�)r��otherr(r,r,r-�__eq__�s

�
�
�zExportEntry.__eq__N)
r�r�r�r�r�r�rr r��__hash__r,r,r,r-r�s

rz�(?P<name>(\w|[-.+])+)
                      \s*=\s*(?P<callable>(\w+)([:\.]\w+)*)
                      \s*(\[\s*(?P<flags>[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])?
                      c
Cs�t�|�}|s0d}d|vs"d|vr�td|��n�|��}|d}|d}|�d�}|dkrf|d}}n"|dkrztd|��|�d�\}}|d	}	|	dur�d|vs�d|vr�td|��g}	nd
d�|	�d�D�}	t||||	�}|S)
NrArBzInvalid specification '%s'rQ�callable�:rrr�cSsg|]}|���qSr,�rU)rNr�r,r,r-rO�rPz$get_export_entry.<locals>.<listcomp>rC)�ENTRY_RE�searchr�	groupdict�countr�r)
Z
specificationr'r(r�rQrdZcolonsrnrlr�r,r,r-r��s8
�
��r�cCs�|durd}tjdkr.dtjvr.tj�d�}ntj�d�}tj�|�rft�|tj�}|s�t	�
d|�n:zt�|�d}Wn&ty�t	j
d	|dd
�d}Yn0|s�t
��}t	�
d|�tj�||�S)
a�
    Return the default base location for distlib caches. If the directory does
    not exist, it is created. Use the suffix provided for the base directory,
    and default to '.distlib' if it isn't provided.

    On Windows, if LOCALAPPDATA is defined in the environment, then it is
    assumed to be a directory, and will be the parent directory of the result.
    On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home
    directory - using os.expanduser('~') - will be the parent directory of
    the result.

    The result is just the directory '.distlib' in the parent directory as
    determined above, or with the name specified with ``suffix``.
    Nz.distlib�ntZLOCALAPPDATAz
$localappdata�~z(Directory exists but is not writable: %sTzUnable to create %s)�exc_infoFz#Default location unusable, using %s)rcrQ�environrd�
expandvars�
expanduserr�rr	r��warning�makedirs�OSErrorr�r�r$)rlr(Zusabler,r,r-�get_cache_base�s&

r2cCsBtj�tj�|��\}}|r(|�dd�}|�tjd�}||dS)a
    Convert an absolute path to a directory name for use in a cache.

    The algorithm used is:

    #. On Windows, any ``':'`` in the drive is replaced with ``'---'``.
    #. Any occurrence of ``os.sep`` is replaced with ``'--'``.
    #. ``'.cache'`` is appended.
    r#z---z--z.cache)rcrd�
splitdriver�r!re)rdr�r}r,r,r-�path_to_cache_dirs

r4cCs|�d�s|dS|Sra)�endswith)r+r,r,r-�ensure_slash$s
r6cCs`d}}d|vr>|�dd�\}}d|vr.|}n|�dd�\}}|rJt|�}|rVt|�}|||fS)NrDrr#)�rsplitr�r)rZ�username�passwordrnr,r,r-�parse_credentials*sr:cCst�d�}t�|�|S)N�)rc�umaskrtr,r,r-�get_process_umask9s

r=cCs<d}d}t|�D]\}}t|t�sd}q,q|dus8J�|S)NTF)�	enumeraterxr)�seqr(r]r+r,r,r-�is_string_sequence>s
r@z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z
-py(\d\.?\d?)cCs�d}d}t|��dd�}t�|�}|r@|�d�}|d|���}|r�t|�t|�dkr�t�t�	|�d|�}|r�|�
�}|d|�||dd�|f}|dur�t�|�}|r�|�d�|�d�|f}|S)zw
    Extract name, version, python version from a filename (no extension)

    Return name, version, pyver or None
    N� �-rz\br�)rr!�PYTHON_VERSIONr&r��startrf�rer�escaper�PROJECT_NAME_AND_VERSION)�filenameZproject_namer(Zpyverr'�nr,r,r-�split_filenameMs"


rJz-(?P<name>[\w .-]+)\s*\(\s*(?P<ver>[^\s)]+)\)$cCs:t�|�}|std|��|��}|d����|dfS)z�
    A utility method used to get name and version from a string.

    From e.g. a Provides-Dist value.

    :param p: A value in a form 'foo (1.0)'
    :return: The name and version as a tuple.
    z$Ill-formed name/version string: '%s'rQZver)�NAME_VERSION_RErrr'rUrz)r}r'r�r,r,r-�parse_name_and_versionis
	
rLcCs�t�}t|pg�}t|pg�}d|vr8|�d�||O}|D]x}|dkrT|�|�q<|�d�r�|dd�}||vr�t�d|�||vr�|�|�q<||vr�t�d|�|�|�q<|S)N�*rBrzundeclared extra: %s)r�r�r�rVr�r/)Z	requestedZ	availabler(�rZunwantedr,r,r-�
get_extrasxs&

rOc
Cs�i}zNt|�}|��}|�d�}|�d�s8t�d|�nt�d�|�}t�	|�}Wn2t
y�}zt�d||�WYd}~n
d}~00|S)NzContent-Typezapplication/jsonz(Unexpected response for JSON request: %sr�z&Failed to get external data for %s: %s)rr��getrVr�rr�r�r�r�r��	exception)rTr(ZrespZheadersZct�reader�er,r,r-�_get_external_data�s

$rTz'https://www.red-dove.com/pypi/projects/cCs*d|d��|f}tt|�}t|�}|S)Nz%s/%s/project.jsonr��upperr
�_external_data_base_urlrT)rQrTr(r,r,r-�get_project_data�s
rXcCs(d|d��||f}tt|�}t|�S)Nz%s/%s/package-%s.jsonrrU)rQ�versionrTr,r,r-�get_package_data�s
rZc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Cachez�
    A class implementing a cache for resources that need to live in the file system
    e.g. shared libraries. This class was moved from resources to here because it
    could be used by other modules, e.g. the wheel module.
    cCsPtj�|�st�|�t�|�jd@dkr6t�d|�tj�tj�	|��|_
dS)zu
        Initialise an instance.

        :param base: The base directory where the cache should be located.
        �?rzDirectory '%s' is not privateN)rcrdr�r0r�r�r�r/r��normpathrk)r�rkr,r,r-r��s

zCache.__init__cCst|�S)zN
        Converts a resource prefix to a directory name in the cache.
        )r4)r�rnr,r,r-�
prefix_to_dir�szCache.prefix_to_dirc	Cs�g}t�|j�D]p}tj�|j|�}z>tj�|�s>tj�|�rJt�|�ntj�|�r`t	�
|�Wqty~|�|�Yq0q|S)z"
        Clear the cache.
        )
rcrrkrdr$r�r�r�r�rr�r�r")r�Znot_removed�fnr,r,r-�clear�szCache.clearN)r�r�r��__doc__r�r^r`r,r,r,r-r[�sr[c@s:eZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�
EventMixinz1
    A very simple publish/subscribe system.
    cCs
i|_dSrv)�_subscribersr�r,r,r-r��szEventMixin.__init__TcCsD|j}||vrt|g�||<n"||}|r6|�|�n
|�|�dS)a`
        Add a subscriber for an event.

        :param event: The name of an event.
        :param subscriber: The subscriber to be added (and called when the
                           event is published).
        :param append: Whether to append or prepend the subscriber to an
                       existing subscriber list for the event.
        N)rcrr"�
appendleft)r��event�
subscriberr"�subs�sqr,r,r-r��s
zEventMixin.addcCs,|j}||vrtd|��||�|�dS)z�
        Remove a subscriber for an event.

        :param event: The name of an event.
        :param subscriber: The subscriber to be removed.
        zNo subscribers: %rN)rcr�r�)r�rerfrgr,r,r-r��szEventMixin.removecCst|j�|d��S)z�
        Return an iterator for the subscribers for an event.
        :param event: The event to return subscribers for.
        r,)�iterrcrP)r�rer,r,r-�get_subscribersszEventMixin.get_subscribersc	Ospg}|�|�D]J}z||g|�Ri|��}Wn tyLt�d�d}Yn0|�|�qt�d||||�|S)a^
        Publish a event and return a list of values returned by its
        subscribers.

        :param event: The event to publish.
        :param args: The positional arguments to pass to the event's
                     subscribers.
        :param kwargs: The keyword arguments to pass to the event's
                       subscribers.
        z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rjr�r�rQr"r)r�re�args�kwargsr(rfr�r,r,r-�publish
s

�zEventMixin.publishN)T)	r�r�r�rar�r�r�rjrmr,r,r,r-rb�s
rbc@s^eZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
dd��Ze
dd��ZdS)�	SequencercCsi|_i|_t�|_dSrv)�_preds�_succsr��_nodesr�r,r,r-r�(szSequencer.__init__cCs|j�|�dSrv)rqr��r��noder,r,r-�add_node-szSequencer.add_nodeFcCs�||jvr|j�|�|r�t|j�|d��D]}|�||�q,t|j�|d��D]}|�||�qPt|j���D]\}}|sp|j|=qpt|j���D]\}}|s�|j|=q�dS)Nr,)rqr�r�rorPrprr�)r�rsZedgesr}r+r�rIr,r,r-�remove_node0s

zSequencer.remove_nodecCs<||ksJ�|j�|t���|�|j�|t���|�dSrv)ro�
setdefaultr�r�rp)r��pred�succr,r,r-r�@sz
Sequencer.addcCs�||ksJ�z|j|}|j|}WntyBtd|��Yn0z|�|�|�|�Wn"ty~td||f��Yn0dS)Nz%r not a successor of anythingz%r not a successor of %r)rorp�KeyErrorr�r�)r�rwrx�predsZsuccsr,r,r-r�Es

zSequencer.removecCs||jvp||jvp||jvSrv)rorprq)r��stepr,r,r-�is_stepRs�zSequencer.is_stepcCs�|�|�std|��g}g}t�}|�|�|r�|�d�}||vrb||kr�|�|�|�|�q.|�|�|�|�|j�|d�}|�	|�q.t
|�S)NzUnknown: %rrr,)r|r�r�r"rir�r�rorP�extend�reversed)r��finalr(Ztodo�seenr{rzr,r,r-�	get_stepsVs"





zSequencer.get_stepscsRdg�g�i�i�g�|j��������fdd���D]}|�vr8�|�q8�S)Nrcs��d�|<�d�|<�dd7<��|�z�|}WntyTg}Yn0|D]J}|�vr��|�t�|�|��|<qZ|�vrZt�|�|��|<qZ�|�|kr�g}���}|�|�||kr�q�q�t|�}��|�dS)Nrr)r"r��minri�tuple)rsZ
successors�	successorZconnected_componentZ	component�Zgraph�indexZ
index_counterZlowlinksr(�stack�
strongconnectr,r-r�zs*


z3Sequencer.strong_connections.<locals>.strongconnect)rprrr,r�r-�strong_connectionsos"
zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|�d||f�qq|jD]}|�d|�q>|�d�d�|�S)Nzdigraph G {z  %s -> %s;z  %s;�}�
)ror"rqr$)r�r(rxrzrwrsr,r,r-�dot�s



z
Sequencer.dotN)F)
r�r�r�r�rtrur�r�r|r��propertyr�r�r,r,r,r-rn's


2rn)�.tar.gz�.tar.bz2�.tar�.zip�.tgz�.tbz�.whlTcsh��fdd�}tj����t���d}|dur�|�d�r>d}nH|�d�rRd}d}n4|�d�rfd	}d
}n |�d�rzd}d
}ntd|��z�|dkr�t|d
�}|r�|��}|D]}||�q�n*t�	||�}|r�|�
�}|D]}||�q�|dk�r*tjddk�r*|�
�D]"}	t|	jt��s|	j�d�|	_�qdd�}
|
|_|���W|�rd|��n|�rb|��0dS)NcsRt|t�s|�d�}tj�tj��|��}|���rB|�tjkrNt	d|��dS)Nr�zpath outside destination: %r)
rxr�decodercrdr�r$rVrer�)rdr}��dest_dir�plenr,r-�
check_path�s


zunarchive.<locals>.check_path)r�r��zip)r�r�Ztgzzr:gz)r�r�Ztbzzr:bz2r��tarrNzUnknown format for %rrr�r�c
SsFzt�||�WStjy@}ztt|���WYd}~n
d}~00dS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)�tarfileZ
tar_filterZFilterErrorr��str)�memberrd�excr,r,r-�extraction_filter�sz$unarchive.<locals>.extraction_filter)rcrdr�rfr5r�rZnamelistr�r�Zgetnamesrrr�Z
getmembersrxrQrr�r��
extractallr�)Zarchive_filenamer��formatr�r��archiver��namesrQ�tarinfor�r,r�r-�	unarchive�sP






�r�cCs�t��}t|�}t|d��d}t�|�D]H\}}}|D]8}tj�||�}||d�}	tj�|	|�}
|�||
�q4q&Wd�n1s�0Y|S)z*zip a directory tree into a BytesIO objectr�N)	�io�BytesIOrfrrc�walkrdr$r�)Z	directoryr(Zdlen�zfrgrr�rQZfull�relrmr,r,r-�zip_dir�s.r�)r�K�M�G�T�Pc@sreZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Ze	dd��Z
e	dd��Zdd�Ze	dd��Z
e	dd��ZdS)�ProgressZUNKNOWNr�dcCs<|dus||ksJ�||_|_||_d|_d|_d|_dS)NrF)r��cur�max�started�elapsed�done)r�ZminvalZmaxvalr,r,r-r�szProgress.__init__cCsV|j|ksJ�|jdus&||jks&J�||_t��}|jdurF||_n||j|_dSrv)r�r�r��timer�r�)r�ZcurvalZnowr,r,r-�updates
zProgress.updatecCs |dksJ�|�|j|�dS�Nr)r�r�)r�Zincrr,r,r-�	increment!szProgress.incrementcCs|�|j�|Srv)r�r�r�r,r,r-rD%szProgress.startcCs |jdur|�|j�d|_dS)NT)r�r�r�r�r,r,r-�stop)s
z
Progress.stopcCs|jdur|jS|jSrv)r��unknownr�r,r,r-�maximum.szProgress.maximumcCsD|jrd}n4|jdurd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)r�r�r�r�)r�r(rIr,r,r-�
percentage2s
zProgress.percentagecCs:|dkr|jdus|j|jkr$d}nt�dt�|��}|S)Nrz??:??:??z%H:%M:%S)r�r�r�r��strftime�gmtime)r�Zdurationr(r,r,r-�format_duration=szProgress.format_durationcCs�|jrd}|j}n^d}|jdur&d}nJ|jdks<|j|jkrBd}n.t|j|j�}||j|j}|d|j}d||�|�fS)NZDonezETA r�rrz%s: %s)r�r�r�r�r��floatr�)r�rnr^r,r,r-�ETAFs
zProgress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgi�g@�@z%d %sB/s)r�r�r��UNITS)r�r(Zunitr,r,r-�speedYs

zProgress.speedN)rr�)r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r,r,r,r-r�s




	
r�z\{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t�|�rd}t||��t�|�r4d}t||��t|�S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')�_CHECK_RECURSIVE_GLOBr&r��_CHECK_MISMATCH_SET�_iglob)�	path_globr�r,r,r-rns

rccst�|d�}t|�dkrht|�dks,J|��|\}}}|�d�D]$}td�|||f��D]
}|VqXq@n�d|vr�t|�D]
}|Vqxn~|�dd�\}}|dkr�d}|dkr�d}n|�d�}|�d	�}t�|�D]4\}}}	tj	�
|�}ttj	�||��D]
}
|
Vq�q�dS)
Nrr�rCrz**rrMrb�\)�	RICH_GLOBr�rfr�r$�	std_iglobr%rcr�rdr])r�Zrich_path_globrnr�rl�itemrdZradical�dirr�r_r,r,r-r�ys*



r�)�HTTPSHandler�match_hostname�CertificateErrorc@seZdZdZdZdd�ZdS)�HTTPSConnectionNTcCs^t�|j|jf|j�}t|dd�r0||_|��tt	d�sp|j
rHt	j}nt	j}t	j
||j|j|t	j|j
d�|_n�t	�t	j�}tt	d�r�|jt	jO_|jr�|�|j|j�i}|j
r�t	j|_|j|j
d�tt	dd�r�|j|d<|j
|fi|��|_|j
�rZ|j�rZz$t|j��|j�t�d	|j�Wn.t�yX|j�tj�|j���Yn0dS)
NZ_tunnel_hostF�
SSLContext)�	cert_reqsZssl_version�ca_certs�OP_NO_SSLv2)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) r�Zcreate_connection�host�port�timeoutrs�sockZ_tunnelrq�sslr�Z
CERT_REQUIREDZ	CERT_NONEZwrap_socketZkey_fileZ	cert_fileZPROTOCOL_SSLv23r��optionsr�Zload_cert_chainZverify_modeZload_verify_locations�check_domainr�Zgetpeercertr�rr�ZshutdownZ	SHUT_RDWRr�)r�r�r��contextrlr,r,r-�connect�sB
�



zHTTPSConnection.connect)r�r�r�r�r�r�r,r,r,r-r��sr�c@s&eZdZd	dd�Zdd�Zdd�ZdS)
r�TcCst�|�||_||_dSrv)�BaseHTTPSHandlerr�r�r�)r�r�r�r,r,r-r��s
zHTTPSHandler.__init__cOs(t|i|��}|jr$|j|_|j|_|S)a
            This is called to create a connection instance. Normally you'd
            pass a connection class to do_open, but it doesn't actually check for
            a class, and just expects a callable. As long as we behave just as a
            constructor would have, we should be OK. If it ever changes so that
            we *must* pass a class, we'll create an UnsafeHTTPSConnection class
            which just sets check_domain to False in the class definition, and
            choose which one to pass to do_open.
            )r�r�r�)r�rkrlr(r,r,r-�_conn_maker�s

zHTTPSHandler._conn_makerc
CsZz|�|j|�WStyT}z,dt|j�vr>td|j��n�WYd}~n
d}~00dS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openr�rr��reasonr�r�)r�r[rSr,r,r-�
https_open�s�zHTTPSHandler.https_openN)T)r�r�r�r�r�r�r,r,r,r-r��s
r�c@seZdZdd�ZdS)�HTTPSOnlyHandlercCstd|��dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)r�r[r,r,r-�	http_open�s�zHTTPSOnlyHandler.http_openN)r�r�r�r�r,r,r,r-r��sr���r��c@seZdZddd�ZdS)�HTTPrNcKs*|dkrd}|�|j||fi|���dSr���_setupZ_connection_class�r�r�r�rlr,r,r-r��sz
HTTP.__init__)rN�r�r�r�r�r,r,r,r-r��sr�c@seZdZddd�ZdS)�HTTPSrNcKs*|dkrd}|�|j||fi|���dSr�r�r�r,r,r-r�szHTTPS.__init__)rNr�r,r,r,r-r�sr�c@seZdZddd�Zdd�ZdS)�	TransportrcCs||_tj�||�dSrv)r�rr�r��r�r��use_datetimer,r,r-r�
szTransport.__init__cCs`|�|�\}}}tdkr(t||jd�}n4|jr<||jdkrR||_|t�|�f|_|jd}|S)Nr�)r�rr)�
get_host_info�	_ver_infor�r��_connection�_extra_headersrZHTTPConnection)r�r��h�ehZx509r(r,r,r-�make_connections
zTransport.make_connectionN)r�r�r�r�r�r�r,r,r,r-r�s
r�c@seZdZddd�Zdd�ZdS)�
SafeTransportrcCs||_tj�||�dSrv)r�rr�r�r�r,r,r-r�szSafeTransport.__init__cCs�|�|�\}}}|si}|j|d<tdkr>t|dfi|��}n>|jrR||jdkrr||_|tj|dfi|��f|_|jd}|S)Nr�r�rr)r�r�r�r�r�r�rr�)r�r�r�r�rlr(r,r,r-r�"s
�

zSafeTransport.make_connectionN)rr�r,r,r,r-r�s
r�c@seZdZdd�ZdS)�ServerProxycKsx|�dd�|_}|dur^t|�d}|�dd�}|dkr@t}nt}|||d�|d<}||_tjj	||fi|��dS)Nr�rr��https)r��	transport)
rir�rrPr�r�r�rr�r�)r�r\rlr�rYr�Ztclsr^r,r,r-r�3szServerProxy.__init__Nr�r,r,r,r-r�2sr�cKs:tjddkr|d7}nd|d<d|d<t||fi|��S)Nrr��br�newliner�r�)rrr�r�)r_r�rlr,r,r-�	_csv_openHs

rc@s4eZdZed�ed�ed�d�Zdd�Zdd�Zd	S)
�CSVBaserC�"r�)Z	delimiterZ	quotecharZlineterminatorcCs|Srvr,r�r,r,r-�	__enter__ZszCSVBase.__enter__cGs|j��dSrv)r�r�)r�r+r,r,r-�__exit__]szCSVBase.__exit__N)r�r�r�r��defaultsrrr,r,r,r-rSs�rc@s(eZdZdd�Zdd�Zdd�ZeZdS)�	CSVReadercKs`d|vr4|d}tjddkr,t�d�|�}||_nt|dd�|_tj|jfi|j��|_dS)Nr�rr�r�rdrN)	rrr�r�r�r�r�csvrRr)r�rlr�r,r,r-r�bszCSVReader.__init__cCs|Srvr,r�r,r,r-�__iter__mszCSVReader.__iter__cCsFt|j�}tjddkrBt|�D] \}}t|t�s |�d�||<q |S�Nrr�r�)�nextrRrrr�r>rxrr�)r�r(r]r�r,r,r-rps

zCSVReader.nextN)r�r�r�r�r
r�__next__r,r,r,r-rasrc@seZdZdd�Zdd�ZdS)�	CSVWritercKs(t|d�|_tj|jfi|j��|_dS)Nr�)rr�r	�writerr)r�r_rlr,r,r-r�{szCSVWriter.__init__cCsNtjddkr>g}|D]"}t|t�r.|�d�}|�|�q|}|j�|�dSr)rrr�rxrr�r"r�writerow)r��rowrNr�r,r,r-rs

zCSVWriter.writerowN)r�r�r�r�rr,r,r,r-rzsrcsHeZdZeej�Zded<d�fdd�	Zdd�Zdd	�Zd
d�Z	�Z
S)
�Configurator�inc_convertZincNcs"tt|��|�|pt��|_dSrv)�superrr�rcr�rk)r��configrk��	__class__r,r-r��szConfigurator.__init__c
s���fdd����d�}t|�s*��|�}��dd�}��dd�}|r\t�fdd�|D��}��fd	d��D�}t|�}||i|��}|r�|��D]\}}	t||�|	��q�|S)
Ncsvt|ttf�r*t|��fdd�|D��}nHt|t�rhd|vrH��|�}qri}|D]}�||�||<qPn
��|�}|S)Ncsg|]}�|��qSr,r,)rNr]��convertr,r-rO�rPzBConfigurator.configure_custom.<locals>.convert.<locals>.<listcomp>�())rxrr��type�dict�configure_customr)�or(r�)rr�r,r-r�s

z.Configurator.configure_custom.<locals>.convertrrz[]r,csg|]}�|��qSr,r,)rNrrr,r-rO�rPz1Configurator.configure_custom.<locals>.<listcomp>cs$g|]}t|�r|��|�f�qSr,)r)rNr�)rrr,r-rO�rP)rir"rr�rr��setattr)
r�rr~Zpropsrkr�rlr(rIrIr,)rrr�r-r�s

zConfigurator.configure_customcCs4|j|}t|t�r0d|vr0|�|�|j|<}|S)Nr)rrxrr)r�r�r(r,r,r-�__getitem__�s
zConfigurator.__getitem__cCsZtj�|�stj�|j|�}tj|ddd��}t�|�}Wd�n1sL0Y|S)z*Default converter for the inc:// protocol.rNr�r�N)	rcrd�isabsr$rkr�r�r�r�)r�r�r�r(r,r,r-r�s
(zConfigurator.inc_convert)N)r�r�r�rrZvalue_convertersr�rr r�
__classcell__r,r,rr-r�s
rc@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)�SubprocessMixinzC
    Mixin for running subprocesses and capturing their output
    FNcCs||_||_dSrv)�verbose�progress)r�r$r%r,r,r-r��szSubprocessMixin.__init__cCsj|j}|j}|��}|sq^|dur.|||�q|s@tj�d�ntj�|�d��tj��q|��dS)z�
        Read lines from a subprocess' output stream and either pass to a progress
        callable (if specified) or write progress information to sys.stderr.
        Nrr�)	r%r$�readlinerr�stderrr�r��flushr�)r�r�r�r%r$r+r,r,r-rR�szSubprocessMixin.readercKs�tj|ftjtjd�|��}tj|j|jdfd�}|��tj|j|jdfd�}|��|�	�|�
�|�
�|jdur�|�dd�n|jr�t
j�d�|S)N)�stdoutr'r))r�rkr'zdone.�mainzdone.
)�
subprocess�Popen�PIPE�	threading�ThreadrRr)rDr'�waitr$r%r$rrr�)r��cmdrlr}�t1�t2r,r,r-�run_command�s"��
zSubprocessMixin.run_command)FN)r�r�r�rar�rRr4r,r,r,r-r#�s
r#cCst�dd|���S)z,Normalize a python package name a la PEP 503z[-_.]+rB)rE�subrz)rQr,r,r-�normalize_name�sr6c@s.eZdZdZdZd
dd�Zdd�Zdd	�ZdS)�
PyPIRCFilezhttps://upload.pypi.org/legacy/�pypiNcCs.|durtj�tj�d�d�}||_||_dS)Nr*z.pypirc)rcrdr$r.rHrT)r�r_rTr,r,r-r�szPyPIRCFile.__init__c
Cs�i}tj�|j��r||jp|j}t��}|�|j�|�	�}d|v�r*|�
dd�}dd�|�d�D�}|gkr~d|vr|dg}n�|D]�}d|i}|�
|d�|d<d	|jfd
|jfdfD].\}}	|�
||�r�|�
||�||<q�|	||<q�|dk�r
||jdfv�r
|j|d	<q�|d|kr�|d	|kr�i}q�nRd|v�r|d}|�
|d	��rT|�
|d	�}n|j}|�
|d�|�
|d
�|||jd�}|S)N�	distutilsz
index-serverscSs g|]}|��dkr|���qS)rr$)rN�serverr,r,r-rOs�z#PyPIRCFile.read.<locals>.<listcomp>r�r8r:r8�
repository�realm)r9Nzserver-loginr9)r8r9r;r:r<)rcrdr�rHrT�DEFAULT_REPOSITORYr�RawConfigParserr�r�rPr��
DEFAULT_REALMZ
has_option)
r�r(r;rr�Z
index_serversZ_serversr:r�r|r,r,r-r�sX
��

�
�


�zPyPIRCFile.readcCs�t��}|j}|�|�|�d�s,|�d�|�dd|�|�dd|�t|d��}|�|�Wd�n1sr0YdS)Nr8r8r9r�)	rr>rHr�Zhas_sectionr�r�r�r�)r�r8r9rr_r�r,r,r-r�Fs


zPyPIRCFile.update)NN)r�r�r�r=r?r�r�r�r,r,r,r-r7s

:r7cCst|jd���S)zG
    Read the PyPI access configuration as supported by distutils.
    )rT)r7rTr��r�r,r,r-�_load_pypircRsrAcCst��|j|j�dSrv)r7r�r8r9r@r,r,r-�
_store_pypircXsrBcCs�tjdkrFdtj��vrdSdtj��vr.dSdtj��vr@dStjSdtjvrZtjdStjd	ksnttd
�sttjSt��\}}}}}|���	dd�}|�	d
d��	dd�}|dd�dkr�d||fS|dd�dk�r(|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLdd lm
}|�S|dd!�d"k�r�d"}t�d#tj�}|�|�}|�r�|��}n>|dd!�d$k�r�ddl}	ddl}
|	�|
j��|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    r)Zamd64�	win-amd64z(arm)�	win-arm32z(arm64)z	win-arm64Z_PYTHON_HOST_PLATFORMr��unamerbrrAr_rBN�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr�r�Z32bitZ64bit)i���l����z.%sZaix)�aix_platformr��cygwinz[\d.]+�darwinz%s-%s-%s)rcrQrrrYrz�platformr,rqrEr!�int�maxsizeZ_aix_supportrHrEr�ASCIIrr��_osx_supportZdistutils.sysconfigZget_platform_osxZ	sysconfigZget_config_vars)Zosnamer��releaserY�machineZbitnessrHZrel_rer'rOr9r,r,r-�get_host_platform`sN


 


�
rR�win32rCrD)Zx86Zx64ZarmcCs2tjdkrt�Stj�d�}|tvr*t�St|S)Nr)ZVSCMD_ARG_TGT_ARCH)rcrQrRr,rP�_TARGET_TO_PLAT)Zcross_compilation_targetr,r,r-�get_platform�s
rU)NN)r�)N)N)NT)�r��collectionsr�
contextlibr	�globrr�r�r�Zloggingrcr�rEr�r��ImportErrorr+rrr�r�r�r.Zdummy_threadingr�rr�compatrrrr	r
rrr
rrrrrrrrrrrrrZ	getLoggerr�r�rrrGrFr6r>r:rXr#r?r`roruryrr�r�r��contextmanagerr�r�r�r�r�r�r�rr�VERBOSEr%r�r2r4r6r:r=r@�IrGrCrJrKrLrOrTrWrXrZr[rbrnZARCHIVE_EXTENSIONSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr#r6r7rArBrRrTrUr,r,r,r-�<module>s�
\








Y}

	/

		8�
)
�


,H
C]


+)	
7.QR�