U
    ڲg                    @   s  d dl Z d dlmZ d dlZd dlZd dlmZ d dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZzd dlZW n ek
r   dZY nX d dlZd dlZd dlZd dlZd dlZzd dlZW n ek
r   d dlZY nX d dlZddlmZ ddl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*m+Z+m,Z,m-Z-m.Z.m/Z/ e
0e1Z2e3dZ4e3dZ5e3d	Z6e3d
Z7e3dZ8e3dZ9e3dZ:e3dZ;dd Z<dd Z=dd Z>dd Z?dd Z@dddZAdd ZBdd ZCdd  ZDejEd!d" ZFejEd#d$ ZGejEdd&d'ZHG d(d) d)eIZJd*d+ ZKG d,d- d-eIZLd.d/ ZMG d0d1 d1eIZNe3d2ejOZPd3d4 ZQdd5d6ZRd7d8 ZSd9d: ZTd;d< ZUd=d> ZVd?d@ ZWe3dAejXZYe3dBZZddCdDZ[e3dEZ\dFdG Z]dHdI Z^dJdK Z_dLZ`dMdN ZadOdP ZbG dQdR dReIZcG dSdT dTeIZdG dUdV dVeIZedWZfddYdZZgd[d\ Zhd]ZiG d^d_ d_eIZje3d`Zke3daZle3dbZmdcdd Zdedf ZnerddglmoZpmqZqmrZr G dhdi die$jsZsG djdk dkepZoG dldm dmeoe&ZtG dndo doe%juZuerG dpdq dqe%jvZvG drds dse%jwZwdtdu ZxG dvdw dweIZyG dxdy dyeyZzG dzd{ d{eyZ{G d|d} d}e'Z|G d~d deIZ}dd Z~G dd deIZdd Zdd Zdd ZddddZdd ZdS )    N)deque)iglob   )DistlibException)string_types	text_typeshutil	raw_inputStringIOcache_from_sourceurlopenurljoinhttplib	xmlrpclib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\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)c                    s6   dd  fddfddfdd  | 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).
    c                 S   s.  t | }|r,| d }| | d  } n| s:tdn| d }|dkrVtd|  d|d}| dd  } |g}| r| d |krqqt| d |kr|| | dd  } qtt| }|std|  || d  | | d  } qtd|}td| || d|}| dd  	 } || fS )	Nr   zunexpected end of inputz'"zinvalid expression: %s r   zerror in string literal: %szunterminated string: %s)

IDENTIFIERmatchgroupsendSyntaxErrorreplaceappendSTRING_CHUNKjoinlstrip)	remainingmresultqoqpartss r,   0/tmp/pip-unpacked-wheel-mq592sfu/distlib/util.py
marker_varB   s>    






z parse_marker.<locals>.marker_varc                    s   | rR| d dkrR | dd    \}} | d dkr@td|  | dd    } nZ| \}} | rt| }|srq| d }| | d  } | \}} |||d}q^|}|| fS )Nr   (r   )unterminated parenthesis: %soplhsrhs)r$   r   	MARKER_OPr   r   r   )r%   r'   r4   r&   r3   r5   )markerr.   r,   r-   marker_exprg   s     
z!parse_marker.<locals>.marker_exprc                    sR    | \}} | rJt | }|s qJ| | d  }  | \}} d||d}q|| fS )Nandr2   )ANDr   r   r%   r4   r&   r5   )r8   r,   r-   
marker_andz   s    
z parse_marker.<locals>.marker_andc                    sR    | \}} | rJt | }|s qJ| | d  }  | \}} d||d}q|| fS )Norr2   )ORr   r   r;   )r<   r,   r-   r7      s    
zparse_marker.<locals>.markerr,   )marker_stringr,   )r7   r<   r8   r.   r-   parse_marker8   s
    
%r@   c                 C   s0  |   }|r|drdS t|}|s4td| | d }|| d }d } } }}|r:|d dkr:|dd}|dk rtd| |d| }	||d d  }g }|	r0t|	}|std	|	 |	| d  |	| d }	|	sq0|	d d
krtd|	 |	dd  }	q|s:d}|r|d dkr|dd  }t
|}|sztd| | d }t|}
|
jr|
jstd| || d  }ndd }|d dkr||\}}n|dd}|dk rtd| |d| }	||d d  }t|	r@||	\}}nXt|	}|s\td|	 | d }|	| d  }	|	rtd|	 d|fg}|r|d dkrtd| |dd  }t|\}}|r|d dkrtd| |s |}nd|ddd |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.
    #Nzname expected: %sr   []r   zunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %sc                 S   s   t | }d}|rg }| d }| | d } t| }|sLtd|  | d }|||f | | d } | r| d dkrq| dd  } | sqt | }|std|  q|sd}|| fS )z|
                Return a list of operator, version tuples if any are
                specified, else None.
                Nr   zinvalid version: %srD   r   invalid constraint: %s)
COMPARE_OPr   r   r   VERSION_IDENTIFIERr   r!   r$   )ver_remainingr&   versionsr3   vr,   r,   r-   get_versions   s6    


z'parse_requirement.<locals>.get_versionsr/   r0   r1   rF   z~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, c                 S   s   g | ]}d | qS )rN   r,   ).0conr,   r,   r-   
<listcomp>  s     z%parse_requirement.<locals>.<listcomp>)nameextrasconstraintsr7   urlrequirement)strip
startswithr   r   r   r   r   findr$   r!   	NON_SPACEr   schemenetlocrG   rH   r@   r#   r   )reqr%   r&   distnamerT   	mark_exprrJ   uriir+   trL   _rK   rsr,   r,   r-   parse_requirement   s    


"


rf   c                 C   s   dd }i }|D ]\}}}t j| |}t|D ]p}t j||}	t|	D ]T}
|| |
}|dkrn||d qJ|||
}|t jjdd}|d | ||< qJq0q|S )z%Find destinations for resources filesc                 S   sD   |  tjjd} | tjjd}|| s.t|t| d  dS N/)r    ospathseprY   AssertionErrorlenr$   )rootrj   r,   r,   r-   get_rel_path  s    z)get_resources_dests.<locals>.get_rel_pathNrh   )ri   rj   r#   r   popr    rk   rstrip)resources_rootrulesro   destinationsbasesuffixdestprefixabs_baseabs_globabs_pathresource_filerel_pathrel_destr,   r,   r-   get_resources_dests  s    

r   c                  C   s(   t tdrd} ntjttdtjk} | S )Nreal_prefixTbase_prefix)hasattrsysrx   getattrr'   r,   r,   r-   in_venv2  s    
r   c                  C   s   t j} t| tst| } | S N)r   
executable
isinstancer   r   r   r,   r,   r-   get_executable<  s    
r   c                 C   sN   | }t |}| }|s|r|}|r|d  }||kr6qJ|rd||| f }q|S )Nr   z	%c: %s
%s)r	   lower)promptallowed_charserror_promptdefaultpr+   cr,   r,   r-   proceedN  s    r   c                 C   s8   t |tr| }i }|D ]}|| kr| | ||< q|S r   )r   r   split)dkeysr'   keyr,   r,   r-   extract_by_key^  s    
r   c                 C   sz  t jd dkrtd| } |  }t|} zlt| }|d d d }| D ]B\}}| D ]0\}}d||f }t	|}	|	d k	st
|	||< q`qP|W S  tk
r   | dd Y nX dd	 }
t }z|
||  W n< tjk
r   |   t|}t|} |
||  Y nX i }| D ]R}i  ||< }||D ]4\}}d||f }t	|}	|	d k	sft
|	||< q<q"|S )
Nr      utf-8
extensionszpython.exportsexportsz%s = %sc                 S   s$   t | dr| | n
| | d S )N	read_file)r   r   readfp)cpstreamr,   r,   r-   read_stream|  s    
z!read_exports.<locals>.read_stream)r   version_infocodecs	getreaderreadr
   jsonloaditemsget_export_entryrl   	Exceptionseekr   ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)r   datajdatar'   groupentrieskrK   r+   entryr   r   r   rS   valuer,   r,   r-   read_exportsh  sD    

r   c                 C   s   t jd dkrtd|}t }|  D ]l\}}|| | D ]P}|j	d kr\|j
}nd|j
|j	f }|jrd|d|jf }|||j| qFq,|| d S )Nr   r   r   z%s:%sz%s [%s]rO   )r   r   r   	getwriterr   r   r   add_sectionvaluesrv   rx   flagsr#   setrS   write)r   r   r   r   rK   r   r+   r,   r,   r-   write_exports  s    

r   c               	   c   s$   t  } z
| V  W 5 t|  X d S r   )tempfilemkdtempr   rmtree)tdr,   r,   r-   tempdir  s    
r   c              	   c   s.   t  }zt |  d V  W 5 t | X d S r   )ri   getcwdchdir)r   cwdr,   r,   r-   r     s
    

r      c              	   c   s.   t  }zt |  d V  W 5 t | X d S r   )socketgetdefaulttimeoutsetdefaulttimeout)secondsctor,   r,   r-   socket_timeout  s
    

r   c                   @   s   e Zd Zdd ZdddZdS )cached_propertyc                 C   s
   || _ d S r   )func)selfr   r,   r,   r-   __init__  s    zcached_property.__init__Nc                 C   s,   |d kr| S |  |}t|| j j| |S r   )r   object__setattr____name__)r   objclsr   r,   r,   r-   __get__  s
    
zcached_property.__get__)N)r   
__module____qualname__r   r   r,   r,   r,   r-   r     s   r   c                 C   s~   t jdkr| S | s| S | d dkr.td|  | d dkrFtd|  | d}t j|krh|t j qP|srt jS t jj| 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.
    rh   r   zpath '%s' cannot be absolutezpath '%s' cannot end with '/')ri   rk   
ValueErrorr   curdirremoverj   r#   )pathnamepathsr,   r,   r-   convert_path  s    



r   c                   @   s   e Zd Zd$ddZdd Zdd Zdd	 Zd%ddZd&ddZdd Z	dd Z
dd Zdd Zdd Zd'ddZdd Zdd Zd d! Zd"d# ZdS )(FileOperatorFc                 C   s   || _ t | _|   d S r   )dry_runr   ensured_init_record)r   r   r,   r,   r-   r     s    zFileOperator.__init__c                 C   s   d| _ t | _t | _d S NF)recordr   files_writtendirs_createdr   r,   r,   r-   r     s    zFileOperator._init_recordc                 C   s   | j r| j| d S r   )r   r   add)r   rj   r,   r,   r-   record_as_written  s    zFileOperator.record_as_writtenc                 C   sH   t j|s tdt j| t j|s0dS t |jt |jkS )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".
        zfile '%r' does not existT)ri   rj   existsr   abspathstatst_mtime)r   sourcetargetr,   r,   r-   newer  s    
zFileOperator.newerTc                 C   s   |  tj| td|| | jsd}|rdtj|rDd| }n tj|rdtj	|sdd| }|rtt
|d t|| | | dS )z8Copy a file respecting dry-run and force flags.
        zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten)
ensure_dirri   rj   dirnameloggerinfor   islinkr   isfiler   r   copyfiler   )r   infileoutfilecheckmsgr,   r,   r-   	copy_file  s    
zFileOperator.copy_fileNc                 C   s   t j|rt| t j| td|| | jsv|d krJt	|d}nt
j	|d|d}zt|| W 5 |  X | | d S )NzCopying stream %s to %swbwencoding)ri   rj   isdirrl   r   r   r   r   r   openr   r   r   copyfileobjr   )r   instreamr   r  	outstreamr,   r,   r-   copy_stream'  s    
zFileOperator.copy_streamc              	   C   s\   |  tj| | jsNtj|r.t| t|d}|| W 5 Q R X | 	| d S )Nr   )
r   ri   rj   r   r   r   r   r  r   r   )r   rj   r   fr,   r,   r-   write_binary_file6  s    
zFileOperator.write_binary_filec                 C   s   |  ||| d S r   )r  encode)r   rj   r   r  r,   r,   r-   write_text_file?  s    zFileOperator.write_text_filec                 C   sn   t jdkst jdkrjt jdkrj|D ]F}| jr:td| q"t |j|B |@ }td|| t || q"d S )Nposixjavazchanging mode of %szchanging mode of %s to %o)	ri   rS   _namer   r   r   r   st_modechmod)r   bitsmaskfilesr
  moder,   r,   r-   set_modeB  s    zFileOperator.set_modec                 C   s   |  dd|S )Nim  i  )r  )r+   r
  r,   r,   r-   <lambda>N      zFileOperator.<lambda>c                 C   s|   t j|}|| jkrxt j|sx| j| t j|\}}| | t	d|  | j
sft | | jrx| j| d S )NzCreating %s)ri   rj   r   r   r   r   r   r   r   r   r   mkdirr   r   )r   rj   r   r
  r,   r,   r-   r   P  s    

zFileOperator.ensure_dirc           	      C   s   t || }td|| | js|s0| ||rX|s:d }n||sHt|t|d  }i }|rvtt	drvt	j
j|d< t	j|||df| | | |S )NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT)r   r   r   r   r   rY   rl   rm   r   
py_compiler  CHECKED_HASHcompiler   )	r   rj   optimizeforcerx   hashed_invalidationdpathdiagpathcompile_kwargsr,   r,   r-   byte_compile\  s*    
zFileOperator.byte_compilec                 C   s   t j|rt j|r^t j|s^td| | js@t	| | j
r|| jkr| j| nPt j|rpd}nd}td|| | jst | | j
r|| jkr| j| d S )NzRemoving directory tree at %slinkfilezRemoving %s %s)ri   rj   r   r  r   r   debugr   r   r   r   r   r   r   )r   rj   r+   r,   r,   r-   ensure_removedu  s"    



zFileOperator.ensure_removedc                 C   sD   d}|s@t j|r$t |t j}q@t j|}||kr:q@|}q|S r   )ri   rj   r   accessW_OKr   )r   rj   r'   parentr,   r,   r-   is_writable  s    zFileOperator.is_writablec                 C   s"   | j s
t| j| jf}|   |S )zV
        Commit recorded changes, turn off recording, return
        changes.
        )r   rl   r   r   r   )r   r'   r,   r,   r-   commit  s    
zFileOperator.commitc                 C   s   | j st| jD ]}tj|rt| qt| jdd}|D ]F}t	|}|rz|dgks^t
tj||d }t| t| q>|   d S )NT)reverse__pycache__r   )r   listr   ri   rj   r   r   sortedr   listdirrl   r#   rmdirr   )r   r
  dirsr   flistsdr,   r,   r-   rollback  s    

zFileOperator.rollback)F)T)N)FFNF)r   r   r   r   r   r   r   r   r	  r  r  r  set_executable_moder   r&  r*  r.  r/  r9  r,   r,   r,   r-   r     s(   


	    

r   c                 C   s^   | t jkrt j|  }nt| }|d kr,|}n.|d}t||d}|D ]}t||}qJ|S )N.r   )r   modules
__import__r   r   rp   )module_namedotted_pathmodr'   r*   r   r,   r,   r-   resolve  s    

rA  c                   @   s6   e Zd Zdd Zedd Zdd Zdd Zej	Z	d	S )
ExportEntryc                 C   s   || _ || _|| _|| _d S r   rS   rx   rv   r   )r   rS   rx   rv   r   r,   r,   r-   r     s    zExportEntry.__init__c                 C   s   t | j| jS r   )rA  rx   rv   r   r,   r,   r-   r     s    zExportEntry.valuec                 C   s   d| j | j| j| jf S )Nz<ExportEntry %s = %s:%s %s>rC  r   r,   r,   r-   __repr__  s    
 zExportEntry.__repr__c                 C   sD   t |tsd}n0| j|jko>| j|jko>| j|jko>| j|jk}|S r   )r   rB  rS   rx   rv   r   )r   otherr'   r,   r,   r-   __eq__  s    


zExportEntry.__eq__N)
r   r   r   r   r   r   rD  rF  r   __hash__r,   r,   r,   r-   rB    s   
	rB  z(?P<name>([^\[]\S*))
                      \s*=\s*(?P<callable>(\w+)([:\.]\w+)*)
                      \s*(\[\s*(?P<flags>[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])?
                      c           
      C   s   t | }|s0d }d| ks"d| krtd|  n| }|d }|d }|d}|dkrf|d  }}n"|dkrztd|  |d\}}|d	 }	|	d krd| ksd| krtd|  g }	nd
d |	dD }	t||||	}|S )NrB   rC   zInvalid specification '%s'rS   callable:r   r   r   c                 S   s   g | ]}|  qS r,   rX   )rP   r
  r,   r,   r-   rR     s     z$get_export_entry.<locals>.<listcomp>rD   )ENTRY_REsearchr   	groupdictcountr   rB  )
specificationr&   r'   r   rS   rj   colonsrx   rv   r   r,   r,   r-   r     s8    

r   c                 C   s   | dkrd} t jdkr.dt jkr.t jd}nt jd}t j|rft |t j}|st	
d| n<zt | d}W n( tk
r   t	j
d	|dd
 d}Y nX |st }t	
d| t j|| 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ntLOCALAPPDATAz$localappdata~z(Directory exists but is not writable: %sTzUnable to create %s)exc_infoFz#Default location unusable, using %s)ri   rS   environrj   
expandvars
expanduserr  r+  r,  r   warningmakedirsOSErrorr   r   r#   )rv   r'   usabler,   r,   r-   get_cache_base  s&    

r\  c                 C   sB   t jt j| \}}|r(|dd}|t jd}|| d S )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.
    rI  z---z--z.cache)ri   rj   
splitdriver   r    rk   )rj   r   r   r,   r,   r-   path_to_cache_dir-  s
    
r^  c                 C   s   |  ds| d S | S rg   )endswith)r+   r,   r,   r-   ensure_slash>  s    
r`  c                 C   s`   d  }}d| kr>|  dd\}} d|kr.|}n|dd\}}|rJt|}|rVt|}||| fS )NrE   r   rI  )rsplitr   r   )r]   usernamepasswordrx   r,   r,   r-   parse_credentialsD  s    rd  c                  C   s   t d} t |  | S )N   )ri   umaskr   r,   r,   r-   get_process_umaskS  s    

rg  c                 C   s<   d}d }t | D ]\}}t|tsd} q,q|d k	s8t|S )NTF)	enumerater   r   rl   )seqr'   rb   r+   r,   r,   r-   is_string_sequenceY  s    
rj  z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z-py(\d\.?\d?)c                 C   s   d}d}t | dd} t| }|r@|d}| d|  } |rt| t|d krtt	|d | }|r|
 }| d| | |d d |f}|dkrt| }|r|d|d|f}|S )zw
    Extract name, version, python version from a filename (no extension)

    Return name, version, pyver or None
    N -r   z\br   )r   r    PYTHON_VERSIONrL  r   startrm   rer   escaper   PROJECT_NAME_AND_VERSION)filenameproject_namer'   pyverr&   nr,   r,   r-   split_filenamej  s"    


rv  z-(?P<name>[\w .-]+)\s*\(\s*(?P<ver>[^\s)]+)\)$c                 C   s:   t | }|std|  | }|d   |d fS )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'rS   ver)NAME_VERSION_REr   r   rM  rX   r   )r   r&   r   r,   r,   r-   parse_name_and_version  s
    	
ry  c                 C   s   t  }t | pg } t |pg }d| kr8| d ||O }| D ]x}|dkrT|| q<|dr|dd  }||krtd|  ||kr|| q<||krtd|  || q<|S )N*rl  r   zundeclared extra: %s)r   r   r   rY   r   rX  )	requested	availabler'   runwantedr,   r,   r-   
get_extras  s&    

r  c              
   C   s   i }zNt | }| }|d}|ds8td| ntd|}t	|}W n0 t
k
r } ztd| | W 5 d }~X Y nX |S )NzContent-Typezapplication/jsonz(Unexpected response for JSON request: %sr   z&Failed to get external data for %s: %s)r   r   getrY   r   r)  r   r   r   r   r   	exception)rV   r'   respheadersctreaderer,   r,   r-   _get_external_data  s    

 r  z'https://www.red-dove.com/pypi/projects/c                 C   s*   d| d   | f }tt|}t|}|S )Nz%s/%s/project.jsonr   upperr   _external_data_base_urlr  )rS   rV   r'   r,   r,   r-   get_project_data  s    
r  c                 C   s(   d| d   | |f }tt|}t|S )Nz%s/%s/package-%s.jsonr   r  )rS   versionrV   r,   r,   r-   get_package_data  s    
r  c                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	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.
    c                 C   sP   t j|st | t |jd@ dkr6td| t jt j	|| _
dS )zu
        Initialise an instance.

        :param base: The base directory where the cache should be located.
        ?   r   zDirectory '%s' is not privateN)ri   rj   r  rY  r   r  r   rX  r   normpathru   )r   ru   r,   r,   r-   r     s
    
zCache.__init__c                 C   s   t |S )zN
        Converts a resource prefix to a directory name in the cache.
        )r^  )r   rx   r,   r,   r-   prefix_to_dir  s    zCache.prefix_to_dirc              	   C   s   g }t | jD ]r}t j| j|}z>t j|s>t j|rJt | nt j|r`t	
| W q tk
r   || Y qX q|S )z"
        Clear the cache.
        )ri   r4  ru   rj   r#   r   r   r   r  r   r   r   r!   )r   not_removedfnr,   r,   r-   clear  s    zCache.clearN)r   r   r   __doc__r   r  r  r,   r,   r,   r-   r    s   r  c                   @   s:   e Zd ZdZdd ZdddZdd Zd	d
 Zdd ZdS )
EventMixinz1
    A very simple publish/subscribe system.
    c                 C   s
   i | _ d S r   )_subscribersr   r,   r,   r-   r   
  s    zEventMixin.__init__Tc                 C   sD   | j }||krt|g||< n"|| }|r6|| n
|| dS )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)r  r   r!   
appendleft)r   event
subscriberr!   subssqr,   r,   r-   r     s    
zEventMixin.addc                 C   s,   | j }||krtd| || | dS )z
        Remove a subscriber for an event.

        :param event: The name of an event.
        :param subscriber: The subscriber to be removed.
        zNo subscribers: %rN)r  r   r   )r   r  r  r  r,   r,   r-   r   !  s    zEventMixin.removec                 C   s   t | j|dS )z
        Return an iterator for the subscribers for an event.
        :param event: The event to return subscribers for.
        r,   )iterr  r  )r   r  r,   r,   r-   get_subscribers-  s    zEventMixin.get_subscribersc              	   O   sl   g }|  |D ]F}z||f||}W n" tk
rH   td d}Y nX || qt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)r  r   r   r  r!   r)  )r   r  argskwargsr'   r  r   r,   r,   r-   publish4  s    

  zEventMixin.publishN)T)	r   r   r   r  r   r   r   r  r  r,   r,   r,   r-   r    s   
r  c                   @   s^   e Zd Zdd Zdd ZdddZdd	 Zd
d Zdd Zdd Z	e
dd Ze
dd ZdS )	Sequencerc                 C   s   i | _ i | _t | _d S r   )_preds_succsr   _nodesr   r,   r,   r-   r   Q  s    zSequencer.__init__c                 C   s   | j | d S r   )r  r   r   noder,   r,   r-   add_nodeV  s    zSequencer.add_nodeFc                 C   s   || j kr| j | |rt| j|dD ]}| || q,t| j|dD ]}| || qPt| j D ]\}}|sp| j|= qpt| j D ]\}}|s| j|= qd S )Nr,   )r  r   r   r  r  r  r2  r   )r   r  edgesr   r+   r   rK   r,   r,   r-   remove_nodeY  s    

zSequencer.remove_nodec                 C   s<   ||kst | j|t | | j|t | d S r   )rl   r  
setdefaultr   r   r  )r   predsuccr,   r,   r-   r   i  s    zSequencer.addc                 C   s   ||kst z| j| }| j| }W n  tk
rD   td| Y nX z|| || W n$ tk
r   td||f Y nX d S )Nz%r not a successor of anythingz%r not a successor of %r)rl   r  r  KeyErrorr   r   )r   r  r  predssuccsr,   r,   r-   r   n  s    

zSequencer.removec                 C   s   || j kp|| jkp|| jkS r   )r  r  r  )r   stepr,   r,   r-   is_step{  s    zSequencer.is_stepc                 C   s   |  |std| g }g }t }|| |r|d}||krb||kr|| || q.|| || | j|d}|	| q.t
|S )NzUnknown: %rr   r,   )r  r   r   r!   rp   r   r   r  r  extendreversed)r   finalr'   todoseenr  r  r,   r,   r-   	get_steps  s"    





zSequencer.get_stepsc                    sR   dgg i i g | j   fdd D ]}|kr8| q8S )Nr   c                    s   d | < d | < d  d7  <  |  z |  }W n tk
rV   g }Y nX |D ]J}|kr| t|  | | < q\|kr\t|  | | < q\|  |  krg } }| | || krqqt|} | d S Nr   r   )r!   r   minrp   tuple)r  
successors	successorconnected_component	componentgraphindexindex_counterlowlinksr'   stackstrongconnectr,   r-   r    s,    


z3Sequencer.strong_connections.<locals>.strongconnect)r  r  r,   r  r-   strong_connections  s    #
zSequencer.strong_connectionsc                 C   sf   dg}| j D ]*}| j | }|D ]}|d||f  qq| jD ]}|d|  q>|d d|S )Nzdigraph G {z  %s -> %s;z  %s;}
)r  r!   r  r#   )r   r'   r  r  r  r  r,   r,   r-   dot  s    



zSequencer.dotN)F)r   r   r   r   r  r  r   r   r  r  propertyr  r  r,   r,   r,   r-   r  O  s   

3r  ).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc                    sZ   fdd}t j  t d }|d kr| dr>d}nH| drRd}d}n4| drfd	}d
}n | drzd}d}ntd|  z|dkrt| d}|r| }|D ]}|| qn*t	
| |}|r| }|D ]}|| q|dkr*tjd dk r*| D ]"}	t|	jts|	jd|	_qdd }
|
|_|  W 5 |rT|  X d S )Nc                    sR   t | ts| d} tjtj | }| rB| tjkrNt	d| d S )Nr   zpath outside destination: %r)
r   r   decoderi   rj   r   r#   rY   rk   r   )rj   r   dest_dirplenr,   r-   
check_path  s
    

zunarchive.<locals>.check_path)r  r  zip)r  r  tgzzr:gz)r  r  tbzzr:bz2r  tarr}  zUnknown format for %rr   r   r   c              
   S   sD   zt | |W S  t jk
r> } ztt|W 5 d}~X Y nX dS )z9Run tarfile.tar_filter, but raise the expected ValueErrorN)tarfileZ
tar_filterZFilterErrorr   str)memberrj   excr,   r,   r-   extraction_filter  s    z$unarchive.<locals>.extraction_filter)ri   rj   r   rm   r_  r   r   r   namelistr  r  getnamesr   r   
getmembersr   rS   r   r  r  
extractall)archive_filenamer  formatr   r  archiver  namesrS   tarinfor  r,   r  r-   	unarchive  sL    





r  c              	   C   s~   t  }t| }t|dZ}t| D ]H\}}}|D ]8}tj||}||d }	tj|	|}
|||
 q4q&W 5 Q R X |S )z*zip a directory tree into a BytesIO objectr  N)	ioBytesIOrm   r   ri   walkrj   r#   r   )	directoryr'   dlenzfrn   r6  r  rS   fullrelrw   r,   r,   r-   zip_dir%  s    r  )r   KMGTPc                   @   sr   e Zd ZdZdddZdd Zdd	 Zd
d Zdd Ze	dd Z
e	dd Zdd Ze	dd Ze	dd ZdS )ProgressUNKNOWNr   d   c                 C   s<   |d ks||kst | | _| _|| _d | _d| _d| _d S )Nr   F)rl   r  curmaxstartedelapseddone)r   minvalmaxvalr,   r,   r-   r   =  s    zProgress.__init__c                 C   sV   | j |kst| jd ks&|| jks&t|| _t }| jd krF|| _n|| j | _d S r   )r  rl   r  r  timer  r  )r   curvalnowr,   r,   r-   updateE  s    
zProgress.updatec                 C   s    |dkst | | j|  d S )Nr   )rl   r  r  )r   incrr,   r,   r-   	incrementO  s    zProgress.incrementc                 C   s   |  | j | S r   )r  r  r   r,   r,   r-   rn  S  s    zProgress.startc                 C   s    | j d k	r| | j  d| _d S )NT)r  r  r   r   r,   r,   r-   stopW  s    
zProgress.stopc                 C   s   | j d kr| jS | j S r   )r  unknownr   r,   r,   r-   maximum\  s    zProgress.maximumc                 C   sD   | j rd}n4| jd krd}n$d| j| j  | j| j  }d| }|S )Nz100 %z ?? %g      Y@z%3d %%)r   r  r  r  )r   r'   rK   r,   r,   r-   
percentage`  s    
zProgress.percentagec                 C   s:   |dkr| j d ks| j| jkr$d}ntdt|}|S )Nr   z??:??:??z%H:%M:%S)r  r  r  r  strftimegmtime)r   durationr'   r,   r,   r-   format_durationk  s    zProgress.format_durationc                 C   s   | j rd}| j}n^d}| jd kr&d}nJ| jdks<| j| jkrBd}n.t| j| j }|| j| j  }|d | j }d|| |f S )NDonezETA r   r   r   z%s: %s)r   r  r  r  r  floatr  )r   rx   rc   r,   r,   r-   ETAt  s    
zProgress.ETAc                 C   sL   | j dkrd}n| j| j | j  }tD ]}|dk r6 q@|d }q&d||f S )Nr   g        i  g     @@z%d %sB/s)r  r  r  UNITS)r   r'   unitr,   r,   r-   speed  s    

zProgress.speedN)r   r  )r   r   r   r
  r   r  r  rn  r	  r  r  r  r  r  r  r,   r,   r,   r-   r  :  s   




	
r  z\{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$c                 C   s<   t | rd}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_GLOBrL  r   _CHECK_MISMATCH_SET_iglob)	path_globr   r,   r,   r-   r     s    

r   c                 c   s  t | d}t|dkrht|dks,t||\}}}|dD ]$}td|||fD ]
}|V  qXq@nd| krt| D ]
}|V  qxn~| dd\}}|dkrd}|dkrd}n|d}|d	}t	|D ]4\}}}	tj
|}ttj
||D ]
}
|
V  qqd S )
Nr   r   rD   r   z**r;  rz  rh   \)	RICH_GLOBr   rm   rl   r  r#   	std_iglobr$   ri   r  rj   r  )r  rich_path_globrx   r   rv   itemrj   radicaldirr  r  r,   r,   r-   r    s*    



r  )HTTPSHandlermatch_hostnameCertificateErrorc                   @   s   e Zd ZdZdZdd ZdS )HTTPSConnectionNTc                 C   s"  t | j| jf| j}t| ddr0|| _|   t	tj
}ttdrV| jtjO  _t| dd rr|| j| j i }| jrtj|_|j| jd ttddr| j|d< |j|f|| _| jr| jrz$t| j | j td| j W n0 tk
r   | jt j | j   Y nX d S )	N_tunnel_hostFOP_NO_SSLv2	cert_file)cafileHAS_SNIserver_hostnamezHost verified: %s)r   create_connectionhostporttimeoutr   sock_tunnelssl
SSLContextPROTOCOL_SSLv23r   optionsr'  load_cert_chainr(  key_fileca_certsCERT_REQUIREDverify_modeload_verify_locationswrap_socketcheck_domainr#  getpeercertr   r)  r$  shutdown	SHUT_RDWRr   )r   r0  contextr  r,   r,   r-   connect  s4    


zHTTPSConnection.connect)r   r   r   r8  r=  rB  r,   r,   r,   r-   r%    s   r%  c                   @   s&   e Zd Zd	ddZdd Zdd ZdS )
r"  Tc                 C   s   t |  || _|| _d S r   )BaseHTTPSHandlerr   r8  r=  )r   r8  r=  r,   r,   r-   r     s    
zHTTPSHandler.__init__c                 O   s$   t ||}| jr | 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%  r8  r=  )r   r  r  r'   r,   r,   r-   _conn_maker  s
    

zHTTPSHandler._conn_makerc              
   C   sX   z|  | j|W S  tk
rR } z$dt|jkr@td|j n W 5 d }~X Y nX d S )Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openrD  r   r  reasonr$  r-  )r   r^   r  r,   r,   r-   
https_open  s    zHTTPSHandler.https_openN)T)r   r   r   r   rD  rG  r,   r,   r,   r-   r"    s   
r"  c                   @   s   e Zd Zdd ZdS )HTTPSOnlyHandlerc                 C   s   t d| d S )NzAUnexpected HTTP request on what should be a secure connection: %s)r   )r   r^   r,   r,   r-   	http_open  s
    zHTTPSOnlyHandler.http_openN)r   r   r   rI  r,   r,   r,   r-   rH    s   rH  c                   @   s   e Zd ZdddZdd ZdS )	Transportr   c                 C   s   || _ tj| | d S r   )r/  r   rJ  r   r   r/  use_datetimer,   r,   r-   r   &  s    zTransport.__init__c                 C   sD   |  |\}}}| jr$|| jd kr:|| _|t|f| _| jd S r  )get_host_info_connection_extra_headersr   HTTPConnection)r   r-  hehx509r,   r,   r-   make_connection*  s
    zTransport.make_connectionN)r   r   r   r   r   rT  r,   r,   r,   r-   rJ  $  s   
rJ  c                   @   s   e Zd ZdddZdd ZdS )SafeTransportr   c                 C   s   || _ tj| | d S r   )r/  r   rV  r   rK  r,   r,   r-   r   6  s    zSafeTransport.__init__c                 C   s\   |  |\}}}|si }| j|d< | jr6|| jd krR|| _|tj|d f|f| _| jd S )Nr/  r   r   )rM  r/  rN  rO  r   r%  )r   r-  rQ  rR  r  r,   r,   r-   rT  :  s    
 zSafeTransport.make_connectionN)r   rU  r,   r,   r,   r-   rV  4  s   
rV  c                   @   s   e Zd Zdd ZdS )ServerProxyc                 K   st   | dd  | _}|d k	r^t|d }|dd}|dkr@t}nt}|||d |d< }|| _tjj	| |f| d S )Nr/  r   rL  https)rL  	transport)
rp   r/  r   r  rV  rJ  rY  r   rW  r   )r   ra   r  r/  r\   rL  tclsrc   r,   r,   r-   r   H  s    zServerProxy.__init__N)r   r   r   r   r,   r,   r,   r-   rW  F  s   rW  c                 K   s6   t jd dk r|d7 }nd|d< d|d< t| |f|S )Nr   r   br   newliner   r  )r   r   r  )r  r  r  r,   r,   r-   	_csv_open_  s
    
r]  c                   @   s4   e Zd ZedededdZdd Zdd Zd	S )
CSVBaserD   "r  )	delimiter	quotecharlineterminatorc                 C   s   | S r   r,   r   r,   r,   r-   	__enter__q  s    zCSVBase.__enter__c                 G   s   | j   d S r   )r   r   )r   rT  r,   r,   r-   __exit__t  s    zCSVBase.__exit__N)r   r   r   r  defaultsrc  rd  r,   r,   r,   r-   r^  j  s   r^  c                   @   s(   e Zd Zdd Zdd Zdd ZeZdS )	CSVReaderc                 K   s\   d|kr4|d }t jd dkr,td|}|| _nt|d d| _tj| jf| j| _d S )Nr   r   r   r   rj   r}  )	r   r   r   r   r   r]  csvr  re  )r   r  r   r,   r,   r-   r   z  s    zCSVReader.__init__c                 C   s   | S r   r,   r   r,   r,   r-   __iter__  s    zCSVReader.__iter__c                 C   sF   t | j}tjd dk rBt|D ] \}}t|ts |d||< q |S Nr   r   r   )nextr  r   r   rh  r   r   r  )r   r'   rb   r  r,   r,   r-   rj    s    

zCSVReader.nextN)r   r   r   r   rh  rj  __next__r,   r,   r,   r-   rf  x  s   rf  c                   @   s   e Zd Zdd Zdd ZdS )	CSVWriterc                 K   s$   t |d| _tj| jf| j| _d S )Nr  )r]  r   rg  writerre  )r   r  r  r,   r,   r-   r     s    zCSVWriter.__init__c                 C   sN   t jd dk r>g }|D ]"}t|tr.|d}|| q|}| j| d S ri  )r   r   r   r   r  r!   rm  writerow)r   rowr}  r  r,   r,   r-   rn    s    

zCSVWriter.writerowN)r   r   r   r   rn  r,   r,   r,   r-   rl    s   rl  c                       sH   e Zd ZeejZded< d fdd	Zdd Zdd	 Zd
d Z	  Z
S )Configuratorinc_convertincNc                    s"   t t| | |pt | _d S r   )superrp  r   ri   r   ru   )r   configru   	__class__r,   r-   r     s    zConfigurator.__init__c           
         s   fdd  d}t|s*|}  dd }  dd}|r\tfdd|D } fd	d D }t|}|||}|r| D ]\}}	t|||	 q|S )
Nc                    sv   t | ttfr*t|  fdd| D }nHt | trhd| krH| }qri }| D ]} | | ||< qPn
| }|S )Nc                    s   g | ]} |qS r,   r,   )rP   rb   convertr,   r-   rR     s     zBConfigurator.configure_custom.<locals>.convert.<locals>.<listcomp>())r   r2  r  typedictconfigure_customrx  )or'   r   )rx  r   r,   r-   rx    s    

z.Configurator.configure_custom.<locals>.convertry  r;  z[]r,   c                    s   g | ]} |qS r,   r,   )rP   r}  rw  r,   r-   rR     s     z1Configurator.configure_custom.<locals>.<listcomp>c                    s$   g | ]}t |r| | fqS r,   )r   )rP   r   )rt  rx  r,   r-   rR     s      )rp   rH  rA  r  r{  r   setattr)
r   rt  r   propsr  r   r  r'   ru  rK   r,   )rt  rx  r   r-   r|    s    


zConfigurator.configure_customc                 C   s4   | j | }t|tr0d|kr0| | | j |< }|S )Nry  )rt  r   r{  r|  )r   r   r'   r,   r,   r-   __getitem__  s    
zConfigurator.__getitem__c              	   C   sF   t j|st j| j|}tj|ddd}t|}W 5 Q R X |S )z*Default converter for the inc:// protocol.r}  r   r  )	ri   rj   isabsr#   ru   r   r  r   r   )r   r   r
  r'   r,   r,   r-   rq    s
    zConfigurator.inc_convert)N)r   r   r   r{  r   value_convertersr   r|  r  rq  __classcell__r,   r,   ru  r-   rp    s   
 rp  c                   @   s*   e Zd ZdZd
ddZdd Zdd	 ZdS )SubprocessMixinzC
    Mixin for running subprocesses and capturing their output
    FNc                 C   s   || _ || _d S r   )verboseprogress)r   r  r  r,   r,   r-   r     s    zSubprocessMixin.__init__c                 C   sj   | j }| j}| }|sq^|dk	r.||| q|s@tjd ntj|d tj  q|  dS )z
        Read lines from a subprocess' output stream and either pass to a progress
        callable (if specified) or write progress information to sys.stderr.
        Nr;  r   )	r  r  readliner   stderrr   r  flushr   )r   r   rA  r  r  r+   r,   r,   r-   r    s    zSubprocessMixin.readerc                 K   s   t j|ft jt jd|}tj| j|jdfd}|  tj| j|jdfd}|  |	  |
  |
  | jd k	r| dd n| jrtjd |S )N)stdoutr  r  )r   r  r  zdone.mainzdone.
)
subprocessPopenPIPE	threadingThreadr  r  rn  r  waitr#   r  r  r   r   )r   cmdr  r   t1t2r,   r,   r-   run_command  s$    
zSubprocessMixin.run_command)FN)r   r   r   r  r   r  r  r,   r,   r,   r-   r    s   
r  c                 C   s   t dd|  S )z,Normalize a python package name a la PEP 503z[-_.]+rl  )ro  subr   )rS   r,   r,   r-   normalize_name  s    r  c                   @   s.   e Zd ZdZdZd
ddZdd Zdd	 ZdS )
PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNc                 C   s.   |d krt jt jdd}|| _|| _d S )NrS  z.pypirc)ri   rj   r#   rW  rr  rV   )r   r  rV   r,   r,   r-   r   (  s    zPyPIRCFile.__init__c           
      C   s  i }t j| jr|| jp| j}t }|| j |	 }d|kr*|
dd}dd |dD }|g kr~d|kr|dg}n|D ]}d|i}|
|d|d< d	| jfd
| jfdfD ].\}}	|||r|
||||< q|	||< q|dkr
|| jdfkr
| j|d	< q|d |kr|d	 |kri }qnRd|kr|d}||d	rT|
|d	}n| j}|
|d|
|d||| jd}|S )N	distutilszindex-serversc                 S   s    g | ]}|  d kr|  qS )r   rJ  )rP   serverr,   r,   r-   rR   :  s   z#PyPIRCFile.read.<locals>.<listcomp>r  r  r  rb  
repositoryrealm)rc  Nzserver-loginrc  )rb  rc  r  r  r  )ri   rj   r   rr  rV   DEFAULT_REPOSITORYr   RawConfigParserr   r   r  r   DEFAULT_REALM
has_option)
r   r'   r  rt  r   index_servers_serversr  r   r   r,   r,   r-   r   .  s\    





zPyPIRCFile.readc              	   C   sl   t  }| j}|| |ds,|d |dd| |dd| t|d}|| W 5 Q R X d S )Nr  rb  rc  r  )	r   r  rr  r   has_sectionr   r   r  r   )r   rb  rc  rt  r  r
  r,   r,   r-   r  j  s    


zPyPIRCFile.update)NN)r   r   r   r  r  r   r   r  r,   r,   r,   r-   r  #  s
   
<r  c                 C   s   t | jd S )zG
    Read the PyPI access configuration as supported by distutils.
    )rV   )r  rV   r   r  r,   r,   r-   _load_pypircw  s    r  c                 C   s   t  | j| j d S r   )r  r  rb  rc  r  r,   r,   r-   _store_pypirc~  s    r  c                  C   s  t jdkrFdtj krdS dtj kr.dS dtj kr@dS tjS dt jkrZt jd S t jd	ksntt d
sttjS t  \} }}}}|  	dd} |	dd	dd}| dd dkrd| |f S | dd dkr(|d dkrd} dt
|d d |dd f }ddd}|d|tj  7 }n| dd dkrLdd lm} | S | dd! d"krd"} td#tj}||}|r| }nd| dd! d$krddl}	zdd%lm}
 W n tk
r   ddl}
Y nX |	|
 | ||\} }}d&| ||f S )'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'.

    rQ  amd64	win-amd64z(arm)	win-arm32z(arm64)z	win-arm64_PYTHON_HOST_PLATFORMr  unamerh   r   rk  rd   rl  N   linuxz%s-%ssunosr   5solarisz%d.%sr      32bit64bit)il    z.%saix)aix_platform   cygwinz[\d.]+darwin)	sysconfigz%s-%s-%s)ri   rS   r   r  r   platformrU  r   r  r    intmaxsizeZ_aix_supportr  ro  r  ASCIIr   r   _osx_supportr  r  ImportErrorget_platform_osxget_config_vars)osnamer-  releaser  machinebitnessr  rel_rer&   r  r  r,   r,   r-   get_host_platform  sZ    


 


   
r  win32r  r  )x86x64armc                  C   s2   t jdkrt S t jd} | tkr*t S t|  S )NrQ  VSCMD_ARG_TGT_ARCH)ri   rS   r  rU  r  _TARGET_TO_PLAT)Zcross_compilation_targetr,   r,   r-   get_platform  s    
r  )NN)r   )N)N)NT)r   collectionsr   
contextlibrg  globr   r  r  r   loggingri   r  ro  r   r2  r  r  r   r  r   r   r  Zdummy_threadingr  r   r   compatr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   	getLoggerr   r   r  r   rH   rG   r6   r>   r:   r[   r"   r@   rf   r   r   r   r   r   r   r   contextmanagerr   r   r   r   r   r   r   rA  rB  VERBOSErK  r   r\  r^  r`  rd  rg  rj  Irq  rm  rv  rx  ry  r  r  r  r  r  r  r  r  ARCHIVE_EXTENSIONSr  r  r  r  r  r  r  r  r"  rC  r#  r$  r%  rH  rJ  rV  rW  r]  r^  rf  rl  rp  r  r  r  r  r  r  r  r  r,   r,   r,   r-   <module>   s   
X








[ 


/

		 B
)


,J 
D^


"+81T
U