Your IP : 18.226.34.148


Current Path : /opt/alt/python33/lib/python3.3/site-packages/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/__pycache__/pkg_resources.cpython-33.pyc

�
�Re_�cn@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlmZyddl
m
Z
mZWn(ek
r�ddlm
Z
mZYnXyeWn"ek
rddlmZYnXy$edd�ZddlmZWn:ek
rleZdd	lmZeed
d�ZYnXddlmZy&dd
lmZm Z m!Z!e"Z#Wnek
r�e$Z#YnXddlm%Z&ddl'm(Z(m)Z)ej*ddfkoej+j,dkrddl-j.Z/neZ/yddl0Z0Wnek
rGYnXddd�Z1iZ2dd�Z3dd�Z4dd�Z5dd�Z6dd�Z7dd �Z8d!d"�Z9d#d�Z:Z;d$d%�Z<d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjgEZ=GdkdA�dAe>�Z?GdldB�dBe?�Z@GdmdC�dCe?�ZAGdndD�dDe?�ZBiZCejDdd�ZEdZFdoZGdpZHdZIdpZJdqdf�ZKdrd(�ZLgdsdt�ZMdudv�ZNdwdx�ZOejPdy�ZQejPdz�ZReOZSd{dK�ZTd|d'�ZUeUZVd}d)�ZWd~d*�ZXedd+�ZYd�d,�ZZGd�dY�dY�Z[Gd�dZ�dZe[�Z\Gd�d<�d<e]�Z^Gd�d;�d;e]�Z_e_Z`Gd�dE�dEea�ZbGd�d=�d=�Zcd�d:�Zdd�dH�Zed�dI�Zfd�dN�Zgd�dO�Zhid�gd�6d�gd�6d�d�d�gd�6gd�6gd�6gd�6Ziid�d�d�6d�d�d�6d�d�d�6d�d�d�6d�d�d�6d�d�d�6d�d�d�6Zjd�d��Zkd�d��Zld�d��Zmd�dP�Zneid�dQ�Zod�d��Zpd�eq�kr�epZonGd�d`�d`�ZreKe]er�Gd�da�daer�ZsGd�db�dbes�ZteKeue�et�e/ek	r*eKe/jvet�nGd�d^�d^er�Zwew�Zxd�d��ZyGd�dc�dces�ZzeKej{ez�Gd�d[�d[ew�Z|Gd�d\�d\et�Z}Gd�d]�d]ez�Z~e3d�d�i�d�dd�Ze$d�d7�Z�e$d�d��Z�eej{e��e$d�d��Z�ee]e��e$d�d��Z�eej�e��e/ek	raee/j�e��ne3d�d�i�e3d�d�i�d�de�Z�d�d��Z�d�d4�Z�ed�dg�Z�d�d��Z�e�ej�e��e�ej{e��e/ek	r�e�e/j�e��nd�d��Z�e�e]e��d�dS�Z�id�d��Z�d�d��Z�d�dL�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd��j�Z�ejPd�ej�ej�B�j�Z�ejPd�ej��Z�id�d�6d�d�6d�d�6d�d�6d�d�6j�Z�d�d��Z�d�dG�Z�Gd�d@�d@e]�Z�d�d��Z�Gd�d>�d>e]�Z�Gd�d��d�e��Z�ie�d�6e�d�6e�d�6Z�d�d��Z�d�dF�Z�d�d��Z�Gd�d?�d?�Z�id�d�6d�d�6d�d�6d�d�6d�d�6d�d6Z�dd�Z�dd�Z�ddR�Z�ddM�Z�dd�Z�ec�Z�d	d
�Z�e�eq��e3dd5e^��yddl�m�Z�Wnek
r�Yn�Xye�j�e��Wn�e@k
rje^g�Z�x0e�j�e�e��e_��D]Z�e�j�e��qWx0ej�D]%Z�e�e�j�krLe�j�e��nq'We�j�ej�dd�<YnXe�j�Z�e�j�Z�e�j�Z�e�jUZUeUZVe�d
d��ge�_�e�e�e�j�ej���dS(uYPackage resource API
--------------------

A resource is a logical file contained within a package, or a logical
subdirectory thereof.  The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is.  Do not use os.path operations to manipulate resource
names being passed into the API.

The package resource API is designed to work with normal filesystem packages,
.egg files, and unpacked .egg files.  It can also work in a limited way with
.zip files and with custom PEP 302 loaders that support the ``get_data()``
method.
iN(uget_importer(uurlparseu
urlunparse(uImmutableSetcCs
|j�S(N(unext(uo((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>(su<lambda>(uStringIO(uBytesIOcCsY|dkrt�}n|dkr-|}nttt|�j�|d�||�dS(Nuexec(uNoneuglobalsuexecucompileuopenuread(ufnuglobsulocs((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuexecfile-s
	uexecfile(uutime(umkdirurenameuunlink(uopen(uisdirusplitiucpythoni�cCs^tstd��nt|�\}}|rZ|rZt|�rZt|�t||�ndS(Nu*"os.mkdir" not supported on this platform.(u
WRITE_SUPPORTuIOErrorusplituisdiru_bypass_ensure_directoryumkdir(unameumodeudirnameufilename((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_bypass_ensure_directoryKs
u_bypass_ensure_directorycKs>t�}x.|j�D] \}}|||<|t|<qWdS(N(uglobalsuitemsu_state_vars(uvartypeukwugunameuval((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_declare_stateWs	
u_declare_statecCsLi}t�}x6tj�D](\}}|d|||�||<qW|S(Nu_sget_(uglobalsu_state_varsuitems(ustateugukuv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__getstate__]s
	 u__getstate__cCsJt�}x:|j�D],\}}|dt|||||�qW|S(Nu_sset_(uglobalsuitemsu_state_vars(ustateugukuv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__setstate__ds	$u__setstate__cCs
|j�S(N(ucopy(uval((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_sget_dictjsu
_sget_dictcCs|j�|j|�dS(N(uclearuupdate(ukeyuobustate((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_sset_dictms
u
_sset_dictcCs
|j�S(N(u__getstate__(uval((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_sget_objectqsu_sget_objectcCs|j|�dS(N(u__setstate__(ukeyuobustate((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_sset_objecttsu_sset_objectcGsdS(N(uNone(uargs((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>wscCs�t�}tj|�}|dk	r~tjdkr~y3ddjt�dd��|jd�f}Wq~t	k
rzYq~Xn|S(uZReturn this platform's maximum compatible version.

    distutils.util.get_platform() normally reports the minimum version
    of Mac OS X that would be required to *use* extensions produced by
    distutils.  But what we want when checking compatibility is to know the
    version of Mac OS X that we are *running*.  To allow usage of packages that
    explicitly require a newer version of Mac OS X, we must also know the
    current version of the OS.

    If this condition occurs for any other platform with a version in its
    platform strings, this function should be extended accordingly.
    udarwinumacosx-%s-%su.Nii(
uget_build_platformumacosVersionStringumatchuNoneusysuplatformujoinu_macosx_versugroupu
ValueError(uplatum((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_supported_platformzs
	3
uget_supported_platformurequireu
run_scriptuget_provideruget_distributionuload_entry_pointu
get_entry_mapuget_entry_infouiter_entry_pointsuresource_stringuresource_streamuresource_filenameuresource_listdiruresource_existsuresource_isdirudeclare_namespaceuworking_setuadd_activation_listenerufind_distributionsuset_extraction_pathucleanup_resourcesuget_default_cacheuEnvironmentu
WorkingSetuResourceManageruDistributionuRequirementu
EntryPointuResolutionErroruVersionConflictuDistributionNotFounduUnknownExtrauExtractionErroruparse_requirementsu
parse_versionu	safe_nameusafe_versionuget_platformucompatible_platformsuyield_linesusplit_sectionsu
safe_extrauto_filenameuinvalid_markeruevaluate_markeruensure_directoryunormalize_pathuEGG_DISTuBINARY_DISTuSOURCE_DISTu
CHECKOUT_DISTuDEVELOP_DISTuIMetadataProvideruIResourceProvideruFileMetadatauPathMetadatauEggMetadatau
EmptyProvideruempty_provideruNullProvideruEggProvideruDefaultProvideruZipProvideruregister_finderuregister_namespace_handleruregister_loader_typeufixup_namespace_packagesuget_importerurun_mainuAvailableDistributionscBs&|EeZdZdZdd�ZdS(uResolutionErroru.Abstract base for dependency resolution errorscCs|jjt|j�S(N(u	__class__u__name__urepruargs(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__repr__�suResolutionError.__repr__N(u__name__u
__module__u__qualname__u__doc__u__repr__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuResolutionError�scBs|EeZdZdZdS(uVersionConflictuAAn already-installed version conflicts with the requested versionN(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuVersionConflict�scBs|EeZdZdZdS(uDistributionNotFoundu&A requested distribution was not foundN(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuDistributionNotFound�scBs|EeZdZdZdS(uUnknownExtrau>Distribution doesn't have an "extra feature" of the given nameN(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuUnknownExtra�siicCs|t|<dS(uRegister `provider_factory` to make providers for `loader_type`

    `loader_type` is the type or class of a PEP 302 ``module.__loader__``,
    and `provider_factory` is a function that, passed a *module* object,
    returns an ``IResourceProvider`` for that module.
    N(u_provider_factories(uloader_typeuprovider_factory((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuregister_loader_type�sc
Cs�t|t�r2tj|�p1tt|��dSytj|}Wn)tk
rnt	|�tj|}YnXt
|dd�}tt
|�|�S(u?Return an IResourceProvider for the named module or requirementiu
__loader__N(u
isinstanceuRequirementuworking_setufindurequireustrusysumodulesuKeyErroru
__import__ugetattruNoneu
_find_adapteru_provider_factories(umoduleOrRequmoduleuloader((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_provider�s#

cCs�|s�ddl}|j�d}|dkr�ddl}d}tjj|�r�t|d�r�|j|�}d|kr�|d}q�q�q�n|j|j	d��n|dS(Niuu0/System/Library/CoreServices/SystemVersion.plistu	readPlistuProductVersionu.(
uplatformumac_veruplistlibuosupathuexistsuhasattru	readPlistuappendusplit(u_cacheuplatformuversionuplistlibuplistu
plist_content((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_macosx_vers�su_macosx_verscCsidd6dd6j||�S(NuppcuPowerPCuPower_Macintosh(uget(umachine((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_macosx_arch�su_macosx_archcCs�yddlm}Wn"tk
r8ddlm}YnX|�}tjdkr�|jd�r�yTt�}tj	�dj
dd�}dt|d�t|d	�t|�fSWq�t
k
r�Yq�Xn|S(
u�Return this platform's string for platform-specific distributions

    XXX Currently this is the same as ``distutils.util.get_platform()``, but it
    needs some hacks for Linux and Mac OS X.
    i(uget_platformudarwinumacosx-iu u_umacosx-%d.%d-%si(u	sysconfiguget_platformuImportErrorudistutils.utilusysuplatformu
startswithu_macosx_versuosuunameureplaceuintu_macosx_archu
ValueError(uget_platformuplatuversionumachine((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_build_platform�s
		
uget_build_platformumacosx-(\d+)\.(\d+)-(.*)udarwin-(\d+)\.(\d+)\.(\d+)-(.*)c
CsO|d	ks$|d	ks$||kr(d
Stj|�}|rKtj|�}|s�tj|�}|r�t|jd��}d|jd�|jd�f}|dkr�|dks�|dkr�|dkr�d
SndS|jd�|jd�ks|jd�|jd�krdSt|jd��t|jd��krGdSd
SdS(u�Can code for the `provided` platform run on the `required` platform?

    Returns true if either platform is ``None``, or the platforms are equal.

    XXX Needs compatibility checks for Linux and other unixy OSes.
    iu%s.%siiu10.3iu10.4iNTF(uNoneuTrueumacosVersionStringumatchudarwinVersionStringuintugroupuFalse(uprovidedurequiredureqMacuprovMacu
provDarwinudversionumacosversion((u&/tmp/pip-k8wh6o-build/pkg_resources.pyucompatible_platformss*$"*cCsNtjd�j}|d}|j�||d<t|�dj||�dS(u@Locate distribution `dist_spec` and run its `script_name` scriptiu__name__iN(usysu	_getframeu	f_globalsuclearurequireu
run_script(u	dist_specuscript_nameunsuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
run_scriptHs



cCsdt|t�r!tj|�}nt|t�r?t|�}nt|t�s`td|��n|S(u@Return a current distribution object for a Requirement or stringu-Expected string, Requirement, or Distribution(u
isinstanceu
basestringuRequirementuparseuget_provideruDistributionu	TypeError(udist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_distributionRscCst|�j||�S(uDReturn `name` entry point of `group` for `dist` or raise ImportError(uget_distributionuload_entry_point(udistugroupuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuload_entry_pointZscCst|�j|�S(u=Return the entry point map for `group`, or the full entry map(uget_distributionu
get_entry_map(udistugroup((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
get_entry_map^scCst|�j||�S(u<Return the EntryPoint object for `group`+`name`, or ``None``(uget_distributionuget_entry_info(udistugroupuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_entry_infobscBs\|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S(uIMetadataProvidercCsdS(u;Does the package's distribution contain the named metadata?N((uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_metadataisuIMetadataProvider.has_metadatacCsdS(u'The named metadata resource as a stringN((uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadatalsuIMetadataProvider.get_metadatacCsdS(u�Yield named metadata resource as list of non-blank non-comment lines

       Leading and trailing whitespace is stripped from each line, and lines
       with ``#`` as the first non-blank character are omitted.N((uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadata_linesosu$IMetadataProvider.get_metadata_linescCsdS(u>Is the named metadata a directory?  (like ``os.path.isdir()``)N((uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyumetadata_isdirusu IMetadataProvider.metadata_isdircCsdS(u?List of metadata names in the directory (like ``os.listdir()``)N((uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyumetadata_listdirxsu"IMetadataProvider.metadata_listdircCsdS(u=Execute the named script in the supplied namespace dictionaryN((uscript_nameu	namespace((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
run_script{suIMetadataProvider.run_scriptN(	u__name__u
__module__u__qualname__uhas_metadatauget_metadatauget_metadata_linesumetadata_isdirumetadata_listdiru
run_script(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuIMetadataProvidergscBsb|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS(uIResourceProvideru3An object that provides access to package resourcescCsdS(udReturn a true filesystem path for `resource_name`

        `manager` must be an ``IResourceManager``N((umanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_filename�su'IResourceProvider.get_resource_filenamecCsdS(uiReturn a readable file-like object for `resource_name`

        `manager` must be an ``IResourceManager``N((umanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_stream�su%IResourceProvider.get_resource_streamcCsdS(umReturn a string containing the contents of `resource_name`

        `manager` must be an ``IResourceManager``N((umanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_string�su%IResourceProvider.get_resource_stringcCsdS(u,Does the package contain the named resource?N((u
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_resource�suIResourceProvider.has_resourcecCsdS(u>Is the named resource a directory?  (like ``os.path.isdir()``)N((u
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_isdir�su IResourceProvider.resource_isdircCsdS(u?List of resource names in the directory (like ``os.listdir()``)N((u
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_listdir�su"IResourceProvider.resource_listdirN(
u__name__u
__module__u__qualname__u__doc__uget_resource_filenameuget_resource_streamuget_resource_stringuhas_resourceuresource_isdiruresource_listdir(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuIResourceProviderscBs�|EeZdZdZd dd�Zdd�Zdd�Zdd	�Zd d
d�Z	dd
�Z
dd�Zd d!dd�Z
d d dd�Zd d d!dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd S("u
WorkingSetuDA collection of active distributions on sys.path (or a similar list)cCs^g|_i|_i|_g|_|dkr<tj}nx|D]}|j|�qCWdS(u?Create working set from list of path entries (default=sys.path)N(uentriesu
entry_keysuby_keyu	callbacksuNoneusysupathu	add_entry(uselfuentriesuentry((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�s				
uWorkingSet.__init__cCsT|jj|g�|jj|�x*t|d�D]}|j||d�q3WdS(u�Add a path item to ``.entries``, finding any distributions on it

        ``find_distributions(entry, True)`` is used to find distributions
        corresponding to the path entry, and they are added.  `entry` is
        always appended to ``.entries``, even if it is already present.
        (This is because ``sys.path`` can contain the same value more than
        once, and the ``.entries`` of the ``sys.path`` WorkingSet should always
        equal ``sys.path``.)
        NTF(u
entry_keysu
setdefaultuentriesuappendufind_distributionsuTrueuadduFalse(uselfuentryudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	add_entry�s
uWorkingSet.add_entrycCs|jj|j�|kS(u9True if `dist` is the active distribution for its project(uby_keyugetukey(uselfudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__contains__�suWorkingSet.__contains__cCsG|jj|j�}|dk	r?||kr?t||��n|SdS(u�Find a distribution matching requirement `req`

        If there is an active distribution for the requested project, this
        returns it as long as it meets the version requirement specified by
        `req`.  But, if there is an active distribution for the project and it
        does *not* meet the `req` requirement, ``VersionConflict`` is raised.
        If there is no active distribution for the requested project, ``None``
        is returned.
        N(uby_keyugetukeyuNoneuVersionConflict(uselfurequdist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind�s
uWorkingSet.findccsgx`|D]X}|j|�}|dkrGx4|j�D]}|Vq5Wq||kr||VqqWdS(uYield entry point objects from `group` matching `name`

        If `name` is None, yields all entry points in `group` from all
        distributions in the working set, otherwise only ones matching
        both `group` and `name` are yielded (in distribution order).
        N(u
get_entry_mapuNoneuvalues(uselfugroupunameudistuentriesuep((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuiter_entry_points�s
uWorkingSet.iter_entry_pointscCsQtjd�j}|d}|j�||d<|j|�dj||�dS(u?Locate distribution for `requires` and run `script_name` scriptiu__name__iN(usysu	_getframeu	f_globalsuclearurequireu
run_script(uselfurequiresuscript_nameunsuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
run_script�s



uWorkingSet.run_scriptccspi}xc|jD]X}||jkr+qnx:|j|D]+}||kr9d||<|j|Vq9q9WqWdS(u�Yield distributions for non-duplicate projects in the working set

        The yield order is the order in which the items' path entries were
        added to the working set.
        iN(uentriesu
entry_keysuby_key(uselfuseenuitemukey((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__iter__�s
uWorkingSet.__iter__cCs�|r|j|j|�n|dkr4|j}n|jj|g�}|jj|jg�}|j|jkrwdS||j|j<|j|kr�|j|j�n|j|kr�|j|j�n|j	|�dS(u�Add `dist` to working set, associated with `entry`

        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is added to the end of the working
        set's ``.entries`` (if it wasn't already present).

        `dist` is only added to the working set if it's for a project that
        doesn't already have a distribution in the set.  If it's added, any
        callbacks registered with the ``subscribe()`` method will be called.
        N(
u	insert_onuentriesuNoneulocationu
entry_keysu
setdefaultukeyuby_keyuappendu
_added_new(uselfudistuentryuinsertukeysukeys2((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuadd�suWorkingSet.addc	CsVt|�ddd�}i}i}g}x$|rQ|jd�}||krUq.n|j|j�}|dkr|jj|j�}|dkr�|dkr�t|j�}n|j|||�}||j<|dkr�t	|��q�n|j
|�n||krt||��n|j|j
|j�ddd��d||<q.W|S(uList all distributions needed to (recursively) meet `requirements`

        `requirements` must be a sequence of ``Requirement`` objects.  `env`,
        if supplied, should be an ``Environment`` instance.  If
        not supplied, it defaults to all distributions available within any
        entry or distribution in the working set.  `installer`, if supplied,
        will be invoked with each requirement that cannot be met by an
        already-installed distribution; it should return a ``Distribution`` or
        ``None``.
        Niii����i����T(ulistupopugetukeyuNoneuby_keyuEnvironmentuentriesu
best_matchuDistributionNotFounduappenduVersionConflictuextendurequiresuextrasuTrue(	uselfurequirementsuenvu	installeru	processedubestuto_activateurequdist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresolves.	 &uWorkingSet.resolvecCsPt|�}|j�i}i}|dkrJt|j�}||7}n
||}|jg�}	tt|	j|��x�|D]�}
x�||
D]�}|j�g}y|	j	|||�}
Wn9t
k
r�tj�d}|||<|r�w�nPYq�Xtt|	j|
��|j
tj|
��Pq�Wq�Wt|�}|j�||fS(ubFind all activatable distributions in `plugin_env`

        Example usage::

            distributions, errors = working_set.find_plugins(
                Environment(plugin_dirlist)
            )
            map(working_set.add, distributions)  # add plugins+libs to sys.path
            print 'Could not load', errors        # display errors

        The `plugin_env` should be an ``Environment`` instance that contains
        only distributions that are in the project's "plugin directory" or
        directories. The `full_env`, if supplied, should be an ``Environment``
        contains all currently-available distributions.  If `full_env` is not
        supplied, one is created automatically from the ``WorkingSet`` this
        method is called on, which will typically mean that every directory on
        ``sys.path`` will be scanned for distributions.

        `installer` is a standard installer callback as used by the
        ``resolve()`` method. The `fallback` flag indicates whether we should
        attempt to resolve older versions of a plugin if the newest version
        cannot be resolved.

        This method returns a 2-tuple: (`distributions`, `error_info`), where
        `distributions` is a list of the distributions found in `plugin_env`
        that were loadable, along with any other distributions that are needed
        to resolve their dependencies.  `error_info` is a dictionary mapping
        unloadable plugin distributions to an exception instance describing the
        error that occurred. Usually this will be a ``DistributionNotFound`` or
        ``VersionConflict`` instance.
        iN(ulistusortuNoneuEnvironmentuentriesu	__class__umapuadduas_requirementuresolveuResolutionErrorusysuexc_infouupdateudictufromkeys(uselfu
plugin_envufull_envu	installerufallbackuplugin_projectsu
error_infou
distributionsuenvu
shadow_setuproject_nameudisturequ	resolveesuv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind_pluginsAs6"





	
uWorkingSet.find_pluginscGs7|jt|��}x|D]}|j|�qW|S(u�Ensure that distributions matching `requirements` are activated

        `requirements` must be a string or a (possibly-nested) sequence
        thereof, specifying the distributions and versions required.  The
        return value is a sequence of the distributions that needed to be
        activated to fulfill the requirements; all relevant distributions are
        included, even if they were already activated in this working set.
        (uresolveuparse_requirementsuadd(uselfurequirementsuneededudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyurequire�s	
uWorkingSet.requirecCsB||jkrdS|jj|�x|D]}||�q*WdS(uAInvoke `callback` for all distributions (including existing ones)N(u	callbacksuappend(uselfucallbackudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	subscribe�s

uWorkingSet.subscribecCs"x|jD]}||�q
WdS(N(u	callbacks(uselfudistucallback((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_added_new�suWorkingSet._added_newcCs<|jdd�|jj�|jj�|jdd�fS(N(uentriesu
entry_keysucopyuby_keyu	callbacks(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__getstate__�s(uWorkingSet.__getstate__cCsZ|\}}}}|dd�|_|j�|_|j�|_|dd�|_dS(N(uentriesucopyu
entry_keysuby_keyu	callbacks(uselfue_k_b_cuentriesukeysuby_keyu	callbacks((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__setstate__�s
uWorkingSet.__setstate__NT(u__name__u
__module__u__qualname__u__doc__uNoneu__init__u	add_entryu__contains__ufinduiter_entry_pointsu
run_scriptu__iter__uTrueuadduresolveufind_pluginsurequireu	subscribeu
_added_newu__getstate__u__setstate__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
WorkingSet�s"
/McBs�|EeZdZdZde�edd�Zdd�Zdd�Z	ddd	�Z
d
d�Zdd
�Zddd�Z
ddd�Zdd�Zdd�Zdd�ZdS(uEnvironmentu5Searchable snapshot of distributions on a search pathcCs5i|_i|_||_||_|j|�dS(u!Snapshot distributions available on a search path

        Any distributions found on `search_path` are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.

        `platform` is an optional string specifying the name of the platform
        that platform-specific distributions must be compatible with.  If
        unspecified, it defaults to the current platform.  `python` is an
        optional string naming the desired version of Python (e.g. ``'3.3'``);
        it defaults to the current version.

        You may explicitly set `platform` (and/or `python`) to ``None`` if you
        wish to map *all* distributions, not just those compatible with the
        running platform or Python version.
        N(u_distmapu_cacheuplatformupythonuscan(uselfusearch_pathuplatformupython((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�s
				uEnvironment.__init__cCsC|jdks0|jdks0|j|jkoBt|j|j�S(u�Is distribution `dist` acceptable for this environment?

        The distribution must match the platform and python version
        requirements specified when this environment was created, or False
        is returned.
        N(upythonuNoneu
py_versionucompatible_platformsuplatform(uselfudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyucan_add�suEnvironment.can_addcCs|j|jj|�dS(u"Remove `dist` from the environmentN(u_distmapukeyuremove(uselfudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuremove�suEnvironment.removecCsQ|dkrtj}nx2|D]*}x!t|�D]}|j|�q2WqWdS(udScan `search_path` for distributions usable in this environment

        Any distributions found are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.  Only distributions conforming to
        the platform/python version defined at initialization are added.
        N(uNoneusysupathufind_distributionsuadd(uselfusearch_pathuitemudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuscan�s

uEnvironment.scancCs�y|j|SWn1tk
rB|j�}||jkr>gSYnX||jkrw|j|}|j|<t|�n|j|S(uKReturn a newest-to-oldest list of distributions for `project_name`
        (u_cacheuKeyErroruloweru_distmapu_sort_dists(uselfuproject_nameudists((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__getitem__�s
	
uEnvironment.__getitem__cCs|j|�r{|j�r{|jj|jg�}||kr{|j|�|j|jkrxt|j|j�qxq{ndS(u<Add `dist` if we ``can_add()`` it and it isn't already addedN(ucan_adduhas_versionu_distmapu
setdefaultukeyuappendu_cacheu_sort_dists(uselfudistudists((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuadds
uEnvironment.addcCsW|j|�}|dk	r|Sx%||jD]}||kr-|Sq-W|j||�S(u�Find distribution best matching `req` and usable on `working_set`

        This calls the ``find(req)`` method of the `working_set` to see if a
        suitable distribution is already active.  (This may raise
        ``VersionConflict`` if an unsuitable version of the project is already
        active in the specified `working_set`.)  If a suitable distribution
        isn't active, this method returns the newest distribution in the
        environment that meets the ``Requirement`` in `req`.  If no suitable
        distribution is found, and `installer` is supplied, then the result of
        calling the environment's ``obtain(req, installer)`` method will be
        returned.
        N(ufinduNoneukeyuobtain(uselfurequworking_setu	installerudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
best_match
s
uEnvironment.best_matchcCs|dk	r||�SdS(u�Obtain a distribution matching `requirement` (e.g. via download)

        Obtain a distro that matches requirement (e.g. via download).  In the
        base ``Environment`` class, this routine just returns
        ``installer(requirement)``, unless `installer` is None, in which case
        None is returned instead.  This method is a hook that allows subclasses
        to attempt other ways of obtaining a distribution before falling back
        to the `installer` argument.N(uNone(uselfurequirementu	installer((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuobtains	uEnvironment.obtainccs0x)|jj�D]}||r|VqqWdS(u=Yield the unique project names of the available distributionsN(u_distmapukeys(uselfukey((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__iter__+s
uEnvironment.__iter__cCs{t|t�r|j|�nXt|t�rdxF|D](}x||D]}|j|�qFWq5Wntd|f��|S(u2In-place addition of a distribution or environmentuCan't add %r to environment(u
isinstanceuDistributionuadduEnvironmentu	TypeError(uselfuotheruprojectudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__iadd__0s
uEnvironment.__iadd__cCs@|jgdddd�}x||fD]}||7}q(W|S(u4Add an environment or distribution to an environmentuplatformupythonN(u	__class__uNone(uselfuotherunewuenv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__add__<suEnvironment.__add__N(u__name__u
__module__u__qualname__u__doc__uNoneuget_supported_platformuPY_MAJORu__init__ucan_adduremoveuscanu__getitem__uaddu
best_matchuobtainu__iter__u__iadd__u__add__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuEnvironment�s	cBs|EeZdZdZdS(uExtractionErroruTAn error occurred extracting a resource

    The following attributes are available from instances of this exception:

    manager
        The resource manager that raised this exception

    cache_path
        The base directory for resource extraction

    original_error
        The exception instance that caused extraction to fail
    N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuExtractionErrorGs
cBs�|EeZdZdZdZdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
fdd�Zedd��Zdd�Zdd�Zddd�ZdS(uResourceManageru'Manage resource extraction and packagescCs
i|_dS(N(ucached_files(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__[suResourceManager.__init__cCst|�j|�S(uDoes the named resource exist?(uget_provideruhas_resource(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_exists^suResourceManager.resource_existscCst|�j|�S(u,Is the named resource an existing directory?(uget_provideruresource_isdir(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_isdirbsuResourceManager.resource_isdircCst|�j||�S(u4Return a true filesystem path for specified resource(uget_provideruget_resource_filename(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_filenamehsu!ResourceManager.resource_filenamecCst|�j||�S(u9Return a readable file-like object for specified resource(uget_provideruget_resource_stream(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_streamnsuResourceManager.resource_streamcCst|�j||�S(u%Return specified resource as a string(uget_provideruget_resource_string(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_stringtsuResourceManager.resource_stringcCst|�j|�S(u1List the contents of the named resource directory(uget_provideruresource_listdir(uselfupackage_or_requirementu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_listdirzsu ResourceManager.resource_listdircCs]tj�d}|jpt�}td||f�}||_||_||_|�dS(u5Give an error message for problems extracting file(s)iu}Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  %s

The Python egg cache directory is currently set to:

  %s

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
N(usysuexc_infouextraction_pathuget_default_cacheuExtractionErrorumanageru
cache_pathuoriginal_error(uselfuold_excu
cache_pathuerr((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuextraction_error�s			u ResourceManager.extraction_errorc
Cso|jpt�}tjj||d|�}yt|�Wn|j�YnX|j|�d|j|<|S(u�Return absolute location in cache for `archive_name` and `names`

        The parent directory of the resulting path will be created if it does
        not already exist.  `archive_name` should be the base filename of the
        enclosing egg (which may not be the name of the enclosing zipfile!),
        including its ".egg" extension.  `names`, if provided, should be a
        sequence of path name parts "under" the egg's extraction location.

        This method should only be called by resource providers that need to
        obtain an extraction location, and only for names they intend to
        extract, as it tracks the generated names for possible cleanup later.
        u-tmpi(	uextraction_pathuget_default_cacheuosupathujoinu_bypass_ensure_directoryuextraction_erroru_warn_unsafe_extraction_pathucached_files(uselfuarchive_nameunamesuextract_pathutarget_path((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_cache_path�s


uResourceManager.get_cache_pathcCswtjdkr*|jtjd�r*dStj|�j}|tj@sV|tj@rsd|}tj	|t
�ndS(uN
        If the default extraction path is overridden and set to an insecure
        location, such as /tmp, it opens up an opportunity for an attacker to
        replace an extracted file with an unauthorized payload. Warn the user
        if a known insecure location is used.

        See Distribute #375 for more details.
        untuwindirNu�%s is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).(uosunameu
startswithuenvironustatust_modeuS_IWOTHuS_IWGRPuwarningsuwarnuUserWarning(upathumodeumsg((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_warn_unsafe_extraction_path�s
&u,ResourceManager._warn_unsafe_extraction_pathcCs@tjdkr<tj|�jdBd@}tj||�ndS(u4Perform any platform-specific postprocessing of `tempname`

        This is where Mac header rewrites should be done; other platforms don't
        have anything special they should do.

        Resource providers should call this method ONLY after successfully
        extracting a compressed resource.  They must NOT call it on resources
        that are already in the filesystem.

        `tempname` is the current (temporary) name of the file, and `filename`
        is the name it will be renamed to by the caller after this routine
        returns.
        uposiximi�N(uosunameustatust_modeuchmod(uselfutempnameufilenameumode((u&/tmp/pip-k8wh6o-build/pkg_resources.pyupostprocess�suResourceManager.postprocesscCs%|jrtd��n||_dS(u�Set the base path where resources will be extracted to, if needed.

        If you do not call this routine before any extractions take place, the
        path defaults to the return value of ``get_default_cache()``.  (Which
        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various
        platform-specific fallbacks.  See that routine's documentation for more
        details.)

        Resources are extracted to subdirectories of this path based upon
        information given by the ``IResourceProvider``.  You may set this to a
        temporary directory, but then you must call ``cleanup_resources()`` to
        delete the extracted files when done.  There is no guarantee that
        ``cleanup_resources()`` will be able to remove all extracted files.

        (Note: you may not change the extraction path for a given resource
        manager once resources have been extracted, unless you first call
        ``cleanup_resources()``.)
        u5Can't change extraction path, files already extractedN(ucached_filesu
ValueErroruextraction_path(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuset_extraction_path�s	u#ResourceManager.set_extraction_pathcCsdS(uB
        Delete all extracted resource files and directories, returning a list
        of the file and directory names that could not be successfully removed.
        This function does not have any concurrency protection, so it should
        generally only be called when the extraction path is a temporary
        directory exclusive to a single process.  This method is not
        automatically called; you must call it explicitly or register it as an
        ``atexit`` function if you wish to ensure cleanup of a temporary
        directory used for extractions.
        N((uselfuforce((u&/tmp/pip-k8wh6o-build/pkg_resources.pyucleanup_resources�su!ResourceManager.cleanup_resourcesNF(u__name__u
__module__u__qualname__u__doc__uNoneuextraction_pathu__init__uresource_existsuresource_isdiruresource_filenameuresource_streamuresource_stringuresource_listdiruextraction_erroruget_cache_pathustaticmethodu_warn_unsafe_extraction_pathupostprocessuset_extraction_pathuFalseucleanup_resources(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuResourceManagerWscCsytjdSWntk
r#YnXtjdkrCtjjd�Sd}dd|fd|fd|fdd|fg}x�|D]�\}}d}xn|D]5}|tjkr�tjj|tj|�}q�Pq�W|r�tjj||�}ntjj|d�Sq�Wtd
��dS(uDetermine the default cache location

    This returns the ``PYTHON_EGG_CACHE`` environment variable, if set.
    Otherwise, on Windows, it returns a "Python-Eggs" subdirectory of the
    "Application Data" directory.  On all other systems, it's "~/.python-eggs".
    uPYTHON_EGG_CACHEuntu~/.python-eggsuApplication DatauAPPDATAuUSERPROFILEu	HOMEDRIVEuHOMEPATHuHOMEuWINDIRuuPython-Eggsu3Please set the PYTHON_EGG_CACHE enviroment variableN(uAPPDATA((uAPPDATAN(uUSERPROFILE(u	HOMEDRIVEuHOMEPATH(uHOMEPATH(uHOME((uHOMEN(uWINDIR(	uosuenvironuKeyErrorunameupathu
expanduseruNoneujoinuRuntimeError(uapp_datau	app_homesukeysusubdirudirnameukey((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_default_caches0
			
cCstjdd|�S(u�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    u[^A-Za-z0-9.]+u-(ureusub(uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	safe_name0scCs%|jdd�}tjdd|�S(u�Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    u u.u[^A-Za-z0-9.]+u-(ureplaceureusub(uversion((u&/tmp/pip-k8wh6o-build/pkg_resources.pyusafe_version8scCstjdd|�j�S(u�Convert an arbitrary string to a standard 'extra' name

    Any runs of non-alphanumeric characters are replaced with a single '_',
    and the result is always lowercased.
    u[^A-Za-z0-9.]+u_(ureusubulower(uextra((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
safe_extraBscCs|jdd�S(u|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    u-u_(ureplace(uname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuto_filenameKsunameuosuplatformusysuversionumachineupython_implementationupython_versionupython_full_versionuextracCstjS(N(uosuname(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>Ysuos_namecCstjS(N(usysuplatform(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>Zsusys_platformcCstjj�dS(Ni(usysuversionusplit(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>[scCsdtjdtjdfS(Nu%s.%sii(usysuversion_info(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>\scCs
td�S(Nuversion(u	_platinfo(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>]suplatform_versioncCs
td�S(Numachine(u	_platinfo(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>^suplatform_machinecCstd�pt�S(Nupython_implementation(u	_platinfou_pyimp(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>_sc
CsByddl}Wntk
r(dSYnXt||dd���S(NiucSsdS(Nu((((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>gsu_platinfo.<locals>.<lambda>(uplatformuImportErrorugetattr(uattruplatform((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	_platinfobs

	u	_platinfocCsDtjdkrdStjjd�r)dSdtjkr<dSdSdS(Nucliu
IronPythonujavauJythonu__pypy__uPyPyuCPython(usysuplatformu
startswithubuiltin_module_names(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_pyimpisu_pyimpcCsEidd6dd6}d|_d|_|j|j|j�|_|S(u�
    Given a SyntaxError from a marker evaluation, normalize the error message:
     - Remove indications of filename and line number.
     - Replace platform-specific error messages with standard error messages.
    uinvalid syntaxuunexpected EOF while parsinguparenthesis is never closedN(uNoneufilenameulinenougetumsg(uexcusubs((u&/tmp/pip-k8wh6o-build/pkg_resources.pyunormalize_exceptionss
		unormalize_exceptioncCs;yt|�Wn&tk
r6ttj�d�SYnXdS(uHValidate text as a PEP 426 environment marker; return exception or FalseiF(uevaluate_markeruSyntaxErrorunormalize_exceptionusysuexc_infouFalse(utext((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuinvalid_marker�s

csf�sddlm�m�ddl�ddl�ddl���fdd�}��fdd�}��fdd	�}���fd
d�}�ji|�j6|�j6|�j6|�j	6dd
�d6dd
�d6�j
d6�jd6�t�d�r|��j
<qn��fdd����fdd���tj|�jd�d�S(uV
    Evaluate a PEP 426 environment marker on CPython 2.4+.
    Return a boolean indicating the marker result in this environment.
    Raise SyntaxError if marker is invalid.

    This implementation uses the 'parser' module, which is not implemented on
    Jython and has been superseded by the 'ast' module in Python 2.6 and
    later.
    i(uNAMEuSTRINGNcs;tj�j��fdd�tdt��d�D��S(Ncs g|]}��|��qS(((u.0ui(u	interpretunodelist(u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>�s	u5evaluate_marker.<locals>.and_test.<locals>.<listcomp>ii(u	functoolsureduceuand_urangeulen(unodelist(u	interpretuoperator(unodelistu&/tmp/pip-k8wh6o-build/pkg_resources.pyuand_test�su!evaluate_marker.<locals>.and_testcs;tj�j��fdd�tdt��d�D��S(Ncs g|]}��|��qS(((u.0ui(u	interpretunodelist(u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>�s	u1evaluate_marker.<locals>.test.<locals>.<listcomp>ii(u	functoolsureduceuor_urangeulen(unodelist(u	interpretuoperator(unodelistu&/tmp/pip-k8wh6o-build/pkg_resources.pyutest�suevaluate_marker.<locals>.testcsa|dd}|�jkrQ|dd�jkrCtd��n�|d�Std��dS(NiiiuEmpty parenthesesu5Language feature not supported in environment markers(uLPARuRPARuSyntaxError(unodelistut(u	interpretutoken(u&/tmp/pip-k8wh6o-build/pkg_resources.pyuatom�suevaluate_marker.<locals>.atomc
s�t|�dkr!td��n|dd}|d}|d�kr�t|d�dkr�|dkrtd}q}d	}q�ny�|}Wn(tk
r�tt|�d
��YnX|�|d��|d��S(Niu5Chained comparison not allowed in environment markersiiiiunotunot inuis notu, operator not allowed in environment markers(ulenuSyntaxErroruKeyErrorurepr(unodelistucompucop(uNAMEu_opsuevaluate(u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
comparison�s
	
u#evaluate_marker.<locals>.comparisoncSs
||kS(N((uxuy((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�su!evaluate_marker.<locals>.<lambda>unot incSs
||kS(N((uxuy((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�suinu==u!=uor_testcs{x t|�dkr"|d}qWy�|d}Wn9tk
rptd��td�j|d��YnX||�S(Niiiu)Comparison or logical expression expectedu7Language feature not supported in environment markers: (ulenuKeyErroruSyntaxErrorusym_name(unodelistuop(u_opsusymbol(u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	interpret�s
 u"evaluate_marker.<locals>.interpretcsx t|�dkr"|d}qW|d}|d}|�kr}yt|}Wn"tk
rutd|��YnX|�S|�kr�|d}|dd�dks�|jd�s�|jd�s�d|kr�td	��n|dd�Std
��dS(NiiiuUnknown name %ru'"u"""u'''u\u1Only plain strings allowed in environment markersu5Language feature not supported in environment markersi����(ulenu_marker_valuesuKeyErroruSyntaxErroru
startswith(unodelistukindunameuopus(uNAMEuSTRING(u&/tmp/pip-k8wh6o-build/pkg_resources.pyuevaluate�s$



4u!evaluate_marker.<locals>.evaluatei(utokenuNAMEuSTRINGusymboluoperatoruupdateutestuand_testuatomu
comparisonuequneuhasattruor_testuparseruexprutotuple(utextuextrau_opsuand_testutestuatomu
comparison((uNAMEuSTRINGu_opsuevaluateu	interpretuoperatorusymbolutokenu&/tmp/pip-k8wh6o-build/pkg_resources.pyuevaluate_marker�s$	%	cCs�ddl}|j�}x9|j�D]+}|jdd�}|j|�||<q%Wy|j||�}Wn5tk
r�tj�d}t	|j
d��YnX|S(u�
    Evaluate a PEP 426 environment marker using markerlib.
    Return a boolean indicating the marker result in this environment.
    Raise SyntaxError if marker is invalid.
    iNu.u_i(u
_markerlibudefault_environmentukeysureplaceupopu	interpretu	NameErrorusysuexc_infouSyntaxErroruargs(utextu
_markerlibuenvukeyunew_keyuresultue((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_markerlib_evaluate�s
u_markerlib_evaluateuparsercBs"|EeZdZdZd(Zd(Zd(Zdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
ejd)kr�dd�Zndd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(S(*uNullProvideruETry to implement resources and metadata for arbitrary PEP 302 loaderscCs:t|dd�|_tjjt|dd��|_dS(Nu
__loader__u__file__u(ugetattruNoneuloaderuosupathudirnameumodule_path(uselfumodule((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__suNullProvider.__init__cCs|j|j|�S(N(u_fnumodule_path(uselfumanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_filename	su"NullProvider.get_resource_filenamecCst|j||��S(N(uBytesIOuget_resource_string(uselfumanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_streamsu NullProvider.get_resource_streamcCs|j|j|j|��S(N(u_getu_fnumodule_path(uselfumanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_stringsu NullProvider.get_resource_stringcCs|j|j|j|��S(N(u_hasu_fnumodule_path(uselfu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_resourcesuNullProvider.has_resourcecCs%|jo$|j|j|j|��S(N(uegg_infou_hasu_fn(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_metadatasuNullProvider.has_metadataicCs)|js
dS|j|j|j|��S(Nu(uegg_infou_getu_fn(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadatas	uNullProvider.get_metadatacCs2|js
dS|j|j|j|��jd�S(Nuuutf-8(uegg_infou_getu_fnudecode(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadatas	cCst|j|��S(N(uyield_linesuget_metadata(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadata_lines#suNullProvider.get_metadata_linescCs|j|j|j|��S(N(u_isdiru_fnumodule_path(uselfu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_isdir&suNullProvider.resource_isdircCs%|jo$|j|j|j|��S(N(uegg_infou_isdiru_fn(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyumetadata_isdir)suNullProvider.metadata_isdircCs|j|j|j|��S(N(u_listdiru_fnumodule_path(uselfu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuresource_listdir,suNullProvider.resource_listdircCs)|jr%|j|j|j|��SgS(N(uegg_infou_listdiru_fn(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyumetadata_listdir/s	uNullProvider.metadata_listdircCs�d|}|j|�s,td|��n|j|�jdd�}|jdd�}|j|j|�}||d<tjj|�r�t	|||�nWddl
m}t|�d|j
d�|f||<t||d	�}t|||�dS(
Nuscripts/uNo script named %ru
u
u
u__file__i(ucacheuexec(uhas_metadatauResolutionErroruget_metadataureplaceu_fnuegg_infouosupathuexistsuexecfileu	linecacheucacheulenusplitucompileuexec(uselfuscript_nameu	namespaceuscriptuscript_textuscript_filenameucacheuscript_code((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
run_script4s

%uNullProvider.run_scriptcCstd��dS(Nu9Can't perform this operation for unregistered loader type(uNotImplementedError(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_hasFsuNullProvider._hascCstd��dS(Nu9Can't perform this operation for unregistered loader type(uNotImplementedError(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_isdirKsuNullProvider._isdircCstd��dS(Nu9Can't perform this operation for unregistered loader type(uNotImplementedError(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_listdirPsuNullProvider._listdircCs&|r"tjj||jd��S|S(Nu/(uosupathujoinusplit(uselfubaseu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_fnUsuNullProvider._fncCs2t|jd�r"|jj|�Std��dS(Nuget_datau=Can't perform this operation for loaders without 'get_data()'(uhasattruloaderuget_datauNotImplementedError(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_getZsuNullProvider._getN(i(u__name__u
__module__u__qualname__u__doc__uNoneuegg_nameuegg_infouloaderu__init__uget_resource_filenameuget_resource_streamuget_resource_stringuhas_resourceuhas_metadatausysuversion_infouget_metadatauget_metadata_linesuresource_isdirumetadata_isdiruresource_listdirumetadata_listdiru
run_scriptu_hasu_isdiru_listdiru_fnu_get(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuNullProvider�s0cBs2|EeZdZdZdd�Zdd�ZdS(uEggProvideru&Provider based on a virtual filesystemcCstj||�|j�dS(N(uNullProvideru__init__u
_setup_prefix(uselfumodule((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__gsuEggProvider.__init__cCs�|j}d}x}||kr�|j�jd�rmtjj|�|_tjj|d�|_	||_
Pn|}tjj|�\}}qWdS(Nu.egguEGG-INFO(umodule_pathuNoneuloweruendswithuosupathubasenameuegg_nameujoinuegg_infouegg_rootusplit(uselfupathuoldubase((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_setup_prefixks		uEggProvider._setup_prefixN(u__name__u
__module__u__qualname__u__doc__u__init__u
_setup_prefix(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuEggProviderdscBsV|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS(
uDefaultProvideru6Provides access to package resources in the filesystemcCstjj|�S(N(uosupathuexists(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_has|suDefaultProvider._hascCstjj|�S(N(uosupathuisdir(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_isdirsuDefaultProvider._isdircCs
tj|�S(N(uosulistdir(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_listdir�suDefaultProvider._listdircCst|j|j|�d�S(Nurb(uopenu_fnumodule_path(uselfumanageru
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_stream�su#DefaultProvider.get_resource_streamc
Cs/t|d�}z|j�SWd|j�XdS(Nurb(uopenureaduclose(uselfupathustream((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_get�suDefaultProvider._getN(	u__name__u
__module__u__qualname__u__doc__u_hasu_isdiru_listdiruget_resource_streamu_get(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuDefaultProvideryscBsT|EeZdZdZdd�ZZdd�Zdd�ZdZ	dd�Z
dS(	u
EmptyProvideru.Provider that returns nothing for all requestscCsdS(NF(uFalse(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�suEmptyProvider.<lambda>cCsdS(Nu((uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�scCsgS(N((uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�scCsdS(N((uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�suEmptyProvider.__init__N(u__name__u
__module__u__qualname__u__doc__u_isdiru_hasu_getu_listdiruNoneumodule_pathu__init__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
EmptyProvider�sc
Cs�t�}tj|�}zYxR|j�D]D}|jdtj�}|j|�||<||dk	s(t	�q(WWd|j
�X|S(uf
    This builds a similar dictionary to the zipimport directory
    caches.  However instead of tuples, ZipInfo objects are stored.

    The translation of the tuple is as follows:
      * [0] - zipinfo.filename on stock pythons this needs "/" --> os.sep
              on pypy it is the same (one reason why distribute did work
              in some cases on pypy and win32).
      * [1] - zipinfo.compress_type
      * [2] - zipinfo.compress_size
      * [3] - zipinfo.file_size
      * [4] - len(utf-8 encoding of filename) if zipinfo & 0x800
              len(ascii encoding of filename) otherwise
      * [5] - (zipinfo.date_time[0] - 1980) << 9 |
               zipinfo.date_time[1] << 5 | zipinfo.date_time[2]
      * [6] - (zipinfo.date_time[3] - 1980) << 11 |
               zipinfo.date_time[4] << 5 | (zipinfo.date_time[5] // 2)
      * [7] - zipinfo.CRC
    u/N(udictuzipfileuZipFileunamelistureplaceuosusepugetinfouNoneuAssertionErroruclose(upathuzipinfouzfileuzitemuzpath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyubuild_zipmanifest�s	ubuild_zipmanifestcBs�|EeZdZdZdZdd�Zdd�Zdd�Zdd	�Z	e
d
d��Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS(uZipProvideru"Resource support for zips and eggscCs?tj||�t|jj�|_|jjtj|_dS(N(	uEggProvideru__init__ubuild_zipmanifestuloaderuarchiveuzipinfouosusepuzip_pre(uselfumodule((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�suZipProvider.__init__cCsF|j|j�r)|t|j�d�Std||jf��dS(Nu%s is not a subpath of %s(u
startswithuzip_preulenuAssertionError(uselfufspath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_zipinfo_name�suZipProvider._zipinfo_namecCsj|j|}|j|jtj�rM|t|j�dd�jtj�Std||jf��dS(Niu%s is not a subpath of %s(uzip_preu
startswithuegg_rootuosusepulenusplituAssertionError(uselfuzip_pathufspath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_parts�s

'uZipProvider._partscCs�|jstd��n|j|�}|j�}dj|j|��|kr~x*|D]}|j||j|��qXWn|j||�S(Nu5resource_filename() only supported for .egg, not .zipu/(uegg_nameuNotImplementedErroru_resource_to_zipu_get_eager_resourcesujoinu_partsu_extract_resourceu
_eager_to_zip(uselfumanageru
resource_nameuzip_pathueagersuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_resource_filename�s	
 u!ZipProvider.get_resource_filenamecCs/|j}|jd}tj|�}||fS(Niii����(iii����(u	file_sizeu	date_timeutimeumktime(uzip_statusizeu	date_timeu	timestamp((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_get_date_and_size�s	
uZipProvider._get_date_and_sizec
Cs�||j�kr^x9|j�|D]'}|j|tjj||��}q#Wtjj|�S|j|j|�\}}ts�t	d��ny)|j
|j|j|��}|j
||�r�|Stddtjj|��\}}	tj||jj|��tj|�t|	||f�|j|	|�yt|	|�Wnmtjk
r�tjj|�r�|j
||�r�|Stjdkr�t|�t|	|�|Sn�YnXWntjk
r�|j�YnX|S(Nu>"os.rename" and "os.unlink" are not supported on this platformu	.$extractudirunt(u_indexu_extract_resourceuosupathujoinudirnameu_get_date_and_sizeuzipinfou
WRITE_SUPPORTuIOErroruget_cache_pathuegg_nameu_partsu_is_currentu_mkstempuwriteuloaderuget_dataucloseuutimeupostprocessurenameuerroruisfileunameuunlinkuextraction_error(
uselfumanageruzip_pathunameulastu	timestampusizeu	real_pathuoutfutmpnam((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_extract_resource�s@$


uZipProvider._extract_resourcec	Cs�|j|j|�\}}tjj|�s2dStj|�}|j|ks_|j|krcdS|j	j
|�}t|d�}|j�}|j
�||kS(uK
        Return True if the file_path is current for this zip_path
        urbF(u_get_date_and_sizeuzipinfouosupathuisfileuFalseustatust_sizeust_mtimeuloaderuget_datauopenureaduclose(	uselfu	file_pathuzip_pathu	timestampusizeustatuzip_contentsufu
file_contents((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_is_current&s
uZipProvider._is_currentcCsa|jdkrZg}x6dD].}|j|�r|j|j|��qqW||_n|jS(Nunative_libs.txtueager_resources.txt(unative_libs.txtueager_resources.txt(ueagersuNoneuhas_metadatauextenduget_metadata_lines(uselfueagersuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_get_eager_resources7s
u ZipProvider._get_eager_resourcescCs�y|jSWn�tk
r�i}x�|jD]y}|jtj�}x^|r�tjj|dd��}||kr�||j|d�PqF|j�g||<qFWq+W||_|SYnXdS(Nii����i����(	u	_dirindexuAttributeErroruzipinfousplituosusepujoinuappendupop(uselfuindupathupartsuparent((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_index@s
		uZipProvider._indexcCs.|j|�}||jkp-||j�kS(N(u
_zipinfo_nameuzipinfou_index(uselfufspathuzip_path((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_hasQsuZipProvider._hascCs|j|�|j�kS(N(u
_zipinfo_nameu_index(uselfufspath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_isdirUsuZipProvider._isdircCs%t|j�j|j|�f��S(N(ulistu_indexugetu
_zipinfo_name(uselfufspath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_listdirXsuZipProvider._listdircCs|j|j|j|��S(N(u
_zipinfo_nameu_fnuegg_root(uselfu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_eager_to_zip[suZipProvider._eager_to_zipcCs|j|j|j|��S(N(u
_zipinfo_nameu_fnumodule_path(uselfu
resource_name((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_resource_to_zip^suZipProvider._resource_to_zipN(u__name__u
__module__u__qualname__u__doc__uNoneueagersu__init__u
_zipinfo_nameu_partsuget_resource_filenameustaticmethodu_get_date_and_sizeu_extract_resourceu_is_currentu_get_eager_resourcesu_indexu_hasu_isdiru_listdiru
_eager_to_zipu_resource_to_zip(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuZipProvider�s 		
1	cBsJ|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S(uFileMetadatau*Metadata handler for standalone PKG-INFO files

    Usage::

        metadata = FileMetadata("/path/to/PKG-INFO")

    This provider rejects all data and metadata requests except for PKG-INFO,
    which is treated as existing, and will be the contents of the file at
    the provided location.
    cCs
||_dS(N(upath(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__psuFileMetadata.__init__cCs
|dkS(NuPKG-INFO((uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_metadatassuFileMetadata.has_metadatacCsH|dkr8t|jd�}|j�}|j�|Std��dS(NuPKG-INFOurUu(No metadata except PKG-INFO is available(uopenupathureaducloseuKeyError(uselfunameufumetadata((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadatavs
uFileMetadata.get_metadatacCst|j|��S(N(uyield_linesuget_metadata(uselfuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_metadata_lines~suFileMetadata.get_metadata_linesN(u__name__u
__module__u__qualname__u__doc__u__init__uhas_metadatauget_metadatauget_metadata_lines(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuFileMetadatads

cBs&|EeZdZdZdd�ZdS(uPathMetadatauqMetadata provider for egg directories

    Usage::

        # Development eggs:

        egg_info = "/path/to/PackageName.egg-info"
        base_dir = os.path.dirname(egg_info)
        metadata = PathMetadata(base_dir, egg_info)
        dist_name = os.path.splitext(os.path.basename(egg_info))[0]
        dist = Distribution(basedir,project_name=dist_name,metadata=metadata)

        # Unpacked egg directories:

        egg_path = "/path/to/PackageName-ver-pyver-etc.egg"
        metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))
        dist = Distribution.from_filename(egg_path, metadata=metadata)
    cCs||_||_dS(N(umodule_pathuegg_info(uselfupathuegg_info((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�s	uPathMetadata.__init__N(u__name__u
__module__u__qualname__u__doc__u__init__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuPathMetadata�scBs&|EeZdZdZdd�ZdS(uEggMetadatau Metadata provider for .egg filescCsrt|j�|_|jtj|_||_|jrXtjj	|j|j�|_
n|j|_
|j�dS(u-Create a metadata provider from a zipimporterN(ubuild_zipmanifestuarchiveuzipinfouosusepuzip_preuloaderuprefixupathujoinumodule_pathu
_setup_prefix(uselfuimporter((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�s		!uEggMetadata.__init__N(u__name__u
__module__u__qualname__u__doc__u__init__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuEggMetadata�sudictu_distribution_finderscCs|t|<dS(uxRegister `distribution_finder` to find distributions in sys.path items

    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `distribution_finder` is a callable that, passed a path
    item and the importer instance, yields ``Distribution`` instances found on
    that path item.  See ``pkg_resources.find_on_path`` for an example.N(u_distribution_finders(u
importer_typeudistribution_finder((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuregister_finder�scCs+t|�}tt|�}||||�S(u.Yield distributions accessible via `path_item`(uget_importeru
_find_adapteru_distribution_finders(u	path_itemuonlyuimporterufinder((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind_distributions�sccs�t|�}|jd�r2tj|d|�Vn|r<dSxf|jd�D]U}|jd�rLtjj||�}x(t	t
j|�|�D]}|Vq�WqLqLWdS(NuPKG-INFOumetadatau/u.egg(uEggMetadatauhas_metadatauDistributionu
from_filenameuresource_listdiruendswithuosupathujoinufind_in_zipu	zipimportuzipimporter(uimporteru	path_itemuonlyumetadatausubitemusubpathudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind_in_zip�sufind_in_zipcCsfS(N((uimporteru	path_itemuonly((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind_nothing�sufind_nothingccst|�}tjj|�rtj|tj�r|j�jd�rwtj	|dt
|tjj|d���Vqx�tj|�D]}}|j�}|jd�s�|jd�rtjj||�}tjj|�r�t
||�}nt
|�}tj|||dt�Vq�|r]|jd�r]x�ttjj||��D]}|VqKWq�|r�|jd�r�ttjj||��}z|j�}	Wd|j�XxU|	D]J}
|
j�s�q�nx.ttjj||
j���D]}|Vq�WPq�Wq�q�WndS(	u6Yield distributions accessible on a sys.path directoryu.eggumetadatauEGG-INFOu	.egg-infou
.dist-infou
precedenceu	.egg-linkN(u_normalize_cacheduosupathuisdiruaccessuR_OKuloweruendswithuDistributionu
from_filenameuPathMetadataujoinulistdiruFileMetadatau
from_locationuDEVELOP_DISTufind_distributionsuopenu	readlinesucloseustripurstrip(uimporteru	path_itemuonlyuentryulowerufullpathumetadataudistu
entry_fileuentry_linesulineuitem((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufind_on_path�s:'	 "
(	ufind_on_pathu_namespace_handlersu_namespace_packagescCs|t|<dS(u�Register `namespace_handler` to declare namespace packages

    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `namespace_handler` is a callable like this::

        def namespace_handler(importer,path_entry,moduleName,module):
            # return a path_entry to use for child packages

    Namespace handlers are only called if the importer object has already
    agreed that it can handle the relevant path item, and they should only
    return a subpath if the module __path__ does not already contain an
    equivalent subpath.  For an example namespace handler, see
    ``pkg_resources.file_ns_handler``.
    N(u_namespace_handlers(u
importer_typeunamespace_handler((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuregister_namespace_handler�scCs
t|�}|dkrdS|j|�}|dkr;dStjj|�}|dkr�tj|�}tj|<g|_t	|�n!t
|d�s�td|��ntt
|�}|||||�}|dk	r	|j}|j|�|j|�||_n|S(uEEnsure that named package includes a subpath of path_item (if needed)u__path__uNot a package:N(uget_importeruNoneufind_moduleusysumodulesugetuimpu
new_moduleu__path__u_set_parent_nsuhasattru	TypeErroru
_find_adapteru_namespace_handlersuappenduload_module(upackageNameu	path_itemuimporteruloaderumoduleuhandlerusubpathupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_handle_nss*	
	

u
_handle_nscCstj�z�|tkrdStjd}}d|kr�dj|jd�dd��}t|�|tkr~t	|�nytj
|j}Wq�tk
r�t
d|��Yq�Xntj|g�j|�tj|g�x|D]}t||�q�WWdtj�XdS(u9Declare that package 'packageName' is a namespace packageNu.iuNot a package:i����(uimpuacquire_locku_namespace_packagesusysupathuNoneujoinusplitudeclare_namespaceu
__import__umodulesu__path__uAttributeErroru	TypeErroru
setdefaultuappendu
_handle_nsurelease_lock(upackageNameupathuparentu	path_item((u&/tmp/pip-k8wh6o-build/pkg_resources.pyudeclare_namespace(s&
"



c
Csbtj�zFx?tj|f�D]+}t||�}|r t||�q q WWdtj�XdS(uDEnsure that previously-declared namespace packages include path_itemN(uimpuacquire_locku_namespace_packagesugetu
_handle_nsufixup_namespace_packagesurelease_lock(u	path_itemuparentupackageusubpath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufixup_namespace_packagesHs
cCs`tjj||jd�d�}t|�}x+|jD]}t|�|kr8Pq8q8W|SdS(uBCompute an ns-package subpath for a filesystem or zipfile importeru.iNi����(uosupathujoinusplitu_normalize_cachedu__path__(uimporteru	path_itemupackageNameumoduleusubpathu
normalizeduitem((u&/tmp/pip-k8wh6o-build/pkg_resources.pyufile_ns_handlerRs"ufile_ns_handlercCsdS(N(uNone(uimporteru	path_itemupackageNameumodule((u&/tmp/pip-k8wh6o-build/pkg_resources.pyunull_ns_handleresunull_ns_handlercCstjjtjj|��S(u1Normalize a file/dir name for comparison purposes(uosupathunormcaseurealpath(ufilename((u&/tmp/pip-k8wh6o-build/pkg_resources.pyunormalize_pathkscCs=y||SWn*tk
r8t|�||<}|SYnXdS(N(uKeyErrorunormalize_path(ufilenameu_cacheuresult((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_normalize_cachedos

u_normalize_cachedcCsU|jd�}|j�}|rQdj|�}ttj||tj|�ndS(Nu.(usplitupopujoinusetattrusysumodules(upackageNameupartsunameuparent((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_set_parent_nsvs
u_set_parent_nsccs�t|t�rSxn|j�D]0}|j�}|r|jd�r|VqqWn-x*|D]"}xt|�D]}|VqmWqZWdS(uAYield non-empty/non-comment lines of a ``basestring`` or sequenceu#N(u
isinstanceu
basestringu
splitlinesustripu
startswithuyield_lines(ustrsususs((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuyield_lines~s
u
\s*(#.*)?$u\s*\\\s*(#.*)?$u\s*((\w|[-.])+)u!\s*(<=?|>=?|==|!=)\s*((\w|[-.])+)u\s*,u\s*\[u\s*\]u\w+(\.\w+)*$uL(?P<name>[^-]+)( -(?P<ver>[^-]+) (-py(?P<pyver>[^-]+) (-(?P<plat>.+))? )? )?u(\d+ | [a-z]+ | \.| -)ucupreupreviewufinal-u-urcu@udevccs{xotj|�D]^}t||�}|s|dkr>qn|dd�dkre|jd�Vqd|VqWdVdS(Nu.iu
0123456789iu*u*final(ucomponent_reusplitureplaceuzfill(usupart((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_parse_version_parts�s
u_parse_version_partscCs�g}x�t|j��D]�}|jd�r�|dkrdx'|r`|ddkr`|j�q=Wnx'|r�|ddkr�|j�qgWn|j|�qWt|�S(u�Convert a version string to a chronologically-sortable key

    This is a rough cross between distutils' StrictVersion and LooseVersion;
    if you give it versions that would work with StrictVersion, then it behaves
    the same; otherwise it acts like a slightly-smarter LooseVersion. It is
    *possible* to create pathological version coding schemes that will fool
    this parser, but they should be very rare in practice.

    The returned value will be a tuple of strings.  Numeric portions of the
    version are padded to 8 digits so they will compare numerically, but
    without relying on how numbers compare relative to strings.  Dots are
    dropped, but dashes are retained.  Trailing zeros between alpha segments
    or dashes are suppressed, so that e.g. "2.4.0" is considered the same as
    "2.4". Alphanumeric parts are lower-cased.

    The algorithm assumes that strings like "-" and any alpha string that
    alphabetically follows "final"  represents a "patch level".  So, "2.4-1"
    is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is
    considered newer than "2.4-1", which in turn is newer than "2.4".

    Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that
    come before "final" alphabetically) are assumed to be pre-release versions,
    so that the version "2.4" is considered newer than "2.4a1".

    Finally, to handle miscellaneous cases, the strings "pre", "preview", and
    "rc" are treated as if they were "c", i.e. as though they were release
    candidates, and therefore are not as new as a version string that does not
    contain them, and "dev" is replaced with an '@' so that it sorts lower than
    than any other pre-release tag.
    u*u*finaliu*final-u00000000i����i����(u_parse_version_partsuloweru
startswithupopuappendutuple(usupartsupart((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
parse_version�scBs�|EeZdZdZffddd�Zdd�Zdd�Zddddd	�Z	ddd
d�Z
ddd
�Zee�Zddd�Z
ee
�Z
ddd�Zee�ZdS(u
EntryPointu3Object representing an advertised importable objectcCsnt|�std|��n||_||_t|�|_tjddj|��j	|_	||_
dS(NuInvalid module nameux[%s]u,(uMODULEu
ValueErrorunameumodule_nameutupleuattrsuRequirementuparseujoinuextrasudist(uselfunameumodule_nameuattrsuextrasudist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__�s		"uEntryPoint.__init__cCsfd|j|jf}|jr<|ddj|j�7}n|jrb|ddj|j�7}n|S(Nu%s = %su:u.u [%s]u,(unameumodule_nameuattrsujoinuextras(uselfus((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__str__�s		uEntryPoint.__str__cCsdt|�S(NuEntryPoint.parse(%r)(ustr(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__repr__�suEntryPoint.__repr__cCs�|r|j||�nt|jt�t�dg�}xO|jD]D}yt||�}WqDtk
r�td||f��YqDXqDW|S(Nu__name__u%r has no %r attribute(urequireu
__import__umodule_nameuglobalsuattrsugetattruAttributeErroruImportError(uselfurequireuenvu	installeruentryuattr((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuload�s!
uEntryPoint.loadcCs]|jr%|jr%td|��ntttjtj|jj|j�||���dS(Nu&Can't require() without a distribution(	uextrasudistuUnknownExtraulistumapuworking_setuadduresolveurequires(uselfuenvu	installer((u&/tmp/pip-k8wh6o-build/pkg_resources.pyurequire�suEntryPoint.requirecCsy�f}}|jdd�\}}d|krz|jdd�\}}tjd|�}|jrnt�n|j}nd|kr�|jdd�\}}t|j��s�t�n|j�jd�}nWn!tk
r�td|��Yn#X||j�|j�|||�SdS(	uParse a single entry point from string `src`

        Entry point syntax follows the form::

            name = some.module:some.attr [extra1,extra2]

        The entry name and module name are required, but the ``:attrs`` and
        ``[extras]`` parts are optional
        u=iu[ux[u:u.u9EntryPoint must be in 'name=module:attrs [extras]' formatN(	usplituRequirementuparseuspecsu
ValueErroruextrasuMODULEurstripustrip(uclsusrcudistuattrsuextrasunameuvalueureq((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuparse�s&

			
uEntryPoint.parsecCs�t|�std|��ni}xZt|�D]L}|j||�}|j|krptd||j��n|||j<q1W|S(uParse an entry point groupuInvalid group nameuDuplicate entry point(uMODULEu
ValueErroruyield_linesuparseuname(uclsugroupulinesudistuthisulineuep((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuparse_groupsuEntryPoint.parse_groupcCs�t|t�r|j�}nt|�}i}x~|D]v\}}|dkrj|s[q7ntd��n|j�}||kr�td|��n|j|||�||<q7W|S(u!Parse a map of entry point groupsu%Entry points must be listed in groupsuDuplicate group nameN(u
isinstanceudictuitemsusplit_sectionsuNoneu
ValueErrorustripuparse_group(uclsudataudistumapsugroupulines((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	parse_map)suEntryPoint.parse_mapNT(u__name__u
__module__u__qualname__u__doc__uNoneu__init__u__str__u__repr__uTrueuloadurequireuparseuclassmethoduparse_groupu	parse_map(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
EntryPoint�s	
cCsE|s
dSt|�}|djd�rAt|dd�d�S|S(Nuiumd5=i����i����(u(uurlparseu
startswithu
urlunparse(ulocationuparsed((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_remove_md5_fragment>su_remove_md5_fragmentc	Bs|EeZdZdZdZdAdAdAdAedAedd�ZdAdd�Z	e
e	�Z	edd��Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zee�Zdd�Zee�Zdd�Zee�Zdd�Zee�Zfdd �Zd!d"�ZdAd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdAd-d.�Ze
e�Zd/d0�Z d1d2�Z!dAd3d4�Z"d5d6�Z#dAd7d8�Z$d9d:�Z%d;d<�Z&d=d>�Z'd?d@�Z(ee(�Z(dAS(BuDistributionu5Wrap an actual or potential sys.path entry w/metadatauPKG-INFOcCsjt|pd�|_|dk	r3t|�|_n||_||_||_||_|p`t	|_
dS(NuUnknown(u	safe_nameuproject_nameuNoneusafe_versionu_versionu
py_versionuplatformulocationu
precedenceuempty_provideru	_provider(uselfulocationumetadatauproject_nameuversionu
py_versionuplatformu
precedence((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__Ks				uDistribution.__init__cKs�dgd\}}}}tjj|�\}}	|	j�tkr�t|�}
|
r||
jdddd�\}}}}nt|	j�}n|||d|d|d|d	||�S(
Niunameuverupyveruplatuproject_nameuversionu
py_versionuplatform(uNoneuosupathusplitextuloweru_distributionImpluEGG_NAMEugroup(uclsulocationubasenameumetadataukwuproject_nameuversionu
py_versionuplatformuextumatch((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
from_locationXs!uDistribution.from_locationcCs7t|df�|j|jt|j�|j|jfS(Nuparsed_version(ugetattru
precedenceukeyu_remove_md5_fragmentulocationu
py_versionuplatform(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>jsuDistribution.<lambda>cCs
t|j�S(N(uhashuhashcmp(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__hash__ssuDistribution.__hash__cCs|j|jkS(N(uhashcmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__lt__tsuDistribution.__lt__cCs|j|jkS(N(uhashcmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__le__vsuDistribution.__le__cCs|j|jkS(N(uhashcmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__gt__xsuDistribution.__gt__cCs|j|jkS(N(uhashcmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__ge__zsuDistribution.__ge__cCs&t||j�sdS|j|jkS(NF(u
isinstanceu	__class__uFalseuhashcmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__eq__|suDistribution.__eq__cCs||kS(N((uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__ne__�suDistribution.__ne__cCs>y|jSWn,tk
r9|jj�|_}|SYnXdS(N(u_keyuAttributeErroruproject_nameulower(uselfukey((u&/tmp/pip-k8wh6o-build/pkg_resources.pyukey�s

uDistribution.keycCs>y|jSWn,tk
r9t|j�|_}|SYnXdS(N(u_parsed_versionuAttributeErroru
parse_versionuversion(uselfupv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuparsed_version�s

uDistribution.parsed_versioncCs�y|jSWn�tk
r�xq|j|j�D]G}|j�jd�r.t|jdd�dj��|_|jSq.Wt	d|j|��YnXdS(Nuversion:u:iu(Missing 'Version:' header and/or %s file(
u_versionuAttributeErroru
_get_metadatauPKG_INFOuloweru
startswithusafe_versionusplitustripu
ValueError(uselfuline((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuversion�s
%uDistribution.versioncCs�y|jSWn�tk
r�igd6}|_x�dD]�}x�t|j|��D]�\}}|r�d|kr�|jdd�\}}t|�r�g}q�t|�s�g}q�nt|�p�d}n|j	|g�j
t|��qRWq6W|SYnXdS(Nurequires.txtudepends.txtu:i(urequires.txtudepends.txt(u_Distribution__dep_mapuAttributeErroruNoneusplit_sectionsu
_get_metadatausplituinvalid_markeruevaluate_markeru
safe_extrau
setdefaultuextenduparse_requirements(uselfudmunameuextraureqsumarker((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_dep_map�s 

"	'uDistribution._dep_mapcCs�|j}g}|j|jdf��xT|D]L}y|j|t|��Wq/tk
rztd||f��Yq/Xq/W|S(u@List of Requirements needed for this distro if `extras` are usedu%s has no such extra feature %rN(u_dep_mapuextendugetuNoneu
safe_extrauKeyErroruUnknownExtra(uselfuextrasudmudepsuext((u&/tmp/pip-k8wh6o-build/pkg_resources.pyurequires�s	

uDistribution.requiresccs5|j|�r1x|j|�D]}|VqWndS(N(uhas_metadatauget_metadata_lines(uselfunameuline((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_get_metadata�suDistribution._get_metadatacCsd|dkrtj}n|j|�|tjkr`t|j�ttt|j	d���ndS(u>Ensure distribution is importable on `path` (default=sys.path)unamespace_packages.txtN(
uNoneusysupathu	insert_onufixup_namespace_packagesulocationulistumapudeclare_namespaceu
_get_metadata(uselfupath((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuactivate�s

uDistribution.activatecCsOdt|j�t|j�|jp'tf}|jrK|d|j7}n|S(u@Return what this distribution's standard .egg filename should beu
%s-%s-py%su-(uto_filenameuproject_nameuversionu
py_versionuPY_MAJORuplatform(uselfufilename((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuegg_name�s	uDistribution.egg_namecCs(|jrd||jfSt|�SdS(Nu%s (%s)(ulocationustr(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__repr__�s	uDistribution.__repr__cCsNyt|dd�}Wntk
r0d}YnX|p:d}d|j|fS(Nuversionu[unknown version]u%s %s(ugetattruNoneu
ValueErroruproject_name(uselfuversion((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__str__�s
uDistribution.__str__cCs.|jd�rt|��nt|j|�S(uADelegate all unrecognized public attributes to .metadata provideru_(u
startswithuAttributeErrorugetattru	_provider(uselfuattr((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__getattr__�suDistribution.__getattr__cKs(|jt|�tjj|�||�S(N(u
from_locationu_normalize_cacheduosupathubasename(uclsufilenameumetadataukw((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
from_filename�suDistribution.from_filenamecCstjd|j|jf�S(u?Return a ``Requirement`` that matches this distribution exactlyu%s==%s(uRequirementuparseuproject_nameuversion(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuas_requirement�suDistribution.as_requirementcCsD|j||�}|dkr:td||ff��n|j�S(u=Return the `name` entry point of `group` or raise ImportErroruEntry point %r not foundN(uget_entry_infouNoneuImportErroruload(uselfugroupunameuep((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuload_entry_point	suDistribution.load_entry_pointcCsdy
|j}Wn4tk
rCtj|jd�|�}|_YnX|dk	r`|j|i�S|S(u=Return the entry point map for `group`, or the full entry mapuentry_points.txtN(u_ep_mapuAttributeErroru
EntryPointu	parse_mapu
_get_metadatauNoneuget(uselfugroupuep_map((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
get_entry_map		s

!uDistribution.get_entry_mapcCs|j|�j|�S(u<Return the EntryPoint object for `group`+`name`, or ``None``(u
get_entry_mapuget(uselfugroupuname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuget_entry_info	suDistribution.get_entry_infoc	CsM|p|j}|sdSt|�}tjj|�}dd�|D�}x�t|�D]w\}}||krsPqW||krW|jtkrW|tjkr�|j	�n|j
||�|j
||�PqWqWW|tjkr�|j	�n|j|�dSxGy|j||d�}Wnt
k
r1PYqX||=||=|}qdS(u@Insert self.location in path before its nearest parent directoryNcSs(g|]}|rt|�p!|�qS((u_normalize_cached(u.0up((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>"	s	u*Distribution.insert_on.<locals>.<listcomp>i(ulocationu_normalize_cacheduosupathudirnameu	enumerateu
precedenceuEGG_DISTusysucheck_version_conflictuinsertuappenduindexu
ValueError(	uselfupathulocunlocubdirunpathupuitemunp((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	insert_on	s6



	uDistribution.insert_onc
Cs�|jdkrdStj|jd��}t|j�}x�|jd�D]�}|tjksJ||ksJ|tkr}qJn|dkr�qJnt	tj|dd�}|r�t|�j|�sJ|j|j�r�qJntd|||jf�qJWdS(	Nu
setuptoolsunamespace_packages.txtu
top_level.txtu
pkg_resourcesusiteu__file__uIModule %s was already imported from %s, but %s is being added to sys.path(u
pkg_resourcesu
setuptoolsusite(
ukeyudictufromkeysu
_get_metadataunormalize_pathulocationusysumodulesu_namespace_packagesugetattruNoneu
startswithu
issue_warning(uselfunspulocumodnameufn((u&/tmp/pip-k8wh6o-build/pkg_resources.pyucheck_version_conflict@	s"u#Distribution.check_version_conflictcCs<y|jWn*tk
r7tdt|��dSYnXdS(NuUnbuilt egg for FT(uversionu
ValueErroru
issue_warningurepruFalseuTrue(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuhas_versionU	s
	uDistribution.has_versioncKsMx*dD]"}|j|t||d	��qW|jd|j�|j|�S(
u@Copy this distribution, substituting in any changed keyword argsuproject_nameuversionu
py_versionuplatformulocationu
precedenceumetadata(uproject_nameuversionu
py_versionuplatformulocationu
precedenceN(u
setdefaultugetattruNoneu	_provideru	__class__(uselfukwuattr((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuclone]	s
 uDistribution.clonecCsdd�|jD�S(NcSsg|]}|r|�qS(((u.0udep((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>i	s	u'Distribution.extras.<locals>.<listcomp>(u_dep_map(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuextrash	suDistribution.extrasN()u__name__u
__module__u__qualname__u__doc__uPKG_INFOuNoneuPY_MAJORuEGG_DISTu__init__u
from_locationuclassmethodupropertyuhashcmpu__hash__u__lt__u__le__u__gt__u__ge__u__eq__u__ne__ukeyuparsed_versionuversionu_dep_mapurequiresu
_get_metadatauactivateuegg_nameu__repr__u__str__u__getattr__u
from_filenameuas_requirementuload_entry_pointu
get_entry_mapuget_entry_infou	insert_onucheck_version_conflictuhas_versionucloneuextras(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuDistributionGsV			'cBsk|EeZdZdZdZejd�Zedd��Z	edd��Z
dd	�Zd
d�ZdS(
uDistInfoDistributionuGWrap an actual or potential sys.path entry w/metadata, .dist-info styleuMETADATAu([\(,])\s*(\d.*?)\s*([,\)])cCs\y|jSWnJtk
rWddlm}|�j|j|j��|_|jSYnXdS(uParse and cache metadatai(uParserN(u	_pkg_infouAttributeErroruemail.parseruParseruparsestruget_metadatauPKG_INFO(uselfuParser((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_parsed_pkg_infor	s
!u%DistInfoDistribution._parsed_pkg_infocCs:y|jSWn(tk
r5|j�|_|jSYnXdS(N(u_DistInfoDistribution__dep_mapuAttributeErroru_compute_dependencies(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_dep_map|	s

uDistInfoDistribution._dep_mapcCsy|jdd�dg}|dj�}|dj�}tj|jd|�}|jdd�jdd�}||fS(u�Convert 'Foobar (1); baz' to ('Foobar ==1', 'baz')
        Split environment marker, add == prefix to version specifiers as
        necessary, and remove parenthesis.
        u;iuiu\1==\2\3u(u)(usplitustripureusubuEQEQureplace(uselfu
requires_distupartsudistversumark((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_preparse_requirement�	su*DistInfoDistribution._preparse_requirementc
sddlm}igd6}|_g�xc|jjd�pBgD]I}|j|�\}}tt|��}||�|_	�j
|�qCW�fdd�}t|d��}|dj|�xR|jjd�p�gD]8}	t
|	j��}	tt||	��|�||	<q�W|S(u+Recompute this distribution's dependencies.i(ucompileu
Requires-Distc3s6x/�D]'}|jdi|d6�r|VqqWdS(Nuoverrideuextra(u	marker_fn(uextraureq(ureqs(u&/tmp/pip-k8wh6o-build/pkg_resources.pyureqs_for_extra�	s
uBDistInfoDistribution._compute_dependencies.<locals>.reqs_for_extrauProvides-ExtraN(u
_markerlibucompileuNoneu_DistInfoDistribution__dep_mapu_parsed_pkg_infouget_allu_preparse_requirementunextuparse_requirementsu	marker_fnuappendu	frozensetuextendu
safe_extraustripulist(
uselfucompile_markerudmurequdistversumarkuparsedureqs_for_extraucommonuextra((ureqsu&/tmp/pip-k8wh6o-build/pkg_resources.pyu_compute_dependencies�	s$u*DistInfoDistribution._compute_dependenciesN(
u__name__u
__module__u__qualname__u__doc__uPKG_INFOureucompileuEQEQupropertyu_parsed_pkg_infou_dep_mapu_preparse_requirementu_compute_dependencies(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuDistInfoDistributionm	s
uDistInfoDistributionu.eggu	.egg-infou
.dist-infoc
Os|d}t�}y-x&tj|�j|kr:|d7}qWWntk
rPYnXddlm}|d|d||�dS(Nii(uwarnu
stacklevel(uglobalsusysu	_getframeu	f_globalsu
ValueErroruwarningsuwarn(uargsukwuleveluguwarn((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
issue_warning�	s	
u
issue_warningc#stt|����fdd�}x��D]�}t|�}|sUtd|��n|jd�}|j�}g}t||�}|r�|j�}|tt||dd�\}}}n|tt	||dd�\}}}dd	�|D�}t
|||�Vq+Wd
S(
u�Yield ``Requirement`` objects for each specification in `strs`

    `strs` must be an instance of ``basestring``, or a (possibly-nested)
    iterable thereof.
    csLg}x|||�st||�rayt��}d}Wqatk
r]td��YqaXn|||�}|s�td|d|d||d���n|j|j|��|j�}t||�}|r�|j�}q	|||�s	td|d||d���q	q	W|||�}|r?|j�}n|||fS(Niu+\ must not appear on the last nonblank lineu	Expected u inuatuExpected ',' or end-of-list in(uCONTINUEunextu
StopIterationu
ValueErroruappendugroupuenduCOMMA(uITEMu
TERMINATORulineupugroupsu	item_nameuitemsumatch(ulines(u&/tmp/pip-k8wh6o-build/pkg_resources.pyu	scan_list�	s0

*#u%parse_requirements.<locals>.scan_listuMissing distribution speciu'extra' nameiuversion speccSs(g|]\}}|t|�f�qS((usafe_version(u.0uopuval((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>�	s	u&parse_requirements.<locals>.<listcomp>N(i(ii(uiteruyield_linesuDISTROu
ValueErrorugroupuenduOBRACKETuCBRACKETuVERSIONuLINE_ENDuRequirement(ustrsu	scan_listulineumatchuproject_nameupuextrasuspecs((ulinesu&/tmp/pip-k8wh6o-build/pkg_resources.pyuparse_requirements�	s"!
$$cCsAdd�|D�}|j�dd�|D�|ddd�<dS(NcSsg|]}|j|f�qS((uhashcmp(u.0udist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>
s	u_sort_dists.<locals>.<listcomp>cSsg|]\}}|�qS(((u.0uhcud((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>
s	ii����(usort(udistsutmp((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_sort_dists�	s
u_sort_distscBst|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
e	�Z	dS(uRequirementcCs�|t|�|_}||j�|_|_dd�|D�}|j�dd�|D�|_|ttt	|��|_
|_|jtdd�|D��t|j�f|_
t|j
�|_dS(u>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!cSs2g|](\}}t|�t|||f�qS((u
parse_versionu
state_machine(u.0uopuv((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>

s	u(Requirement.__init__.<locals>.<listcomp>cSs(g|]\}}}}||f�qS(((u.0uparsedutransuopuver((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>
s	cSs(g|]\}}}}||f�qS(((u.0uparsedutransuopuver((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>
s	N(u	safe_nameuunsafe_nameuloweruproject_nameukeyusortuspecsutupleumapu
safe_extrauindexuextrasu	frozensetuhashCmpuhashu_Requirement__hash(uselfuproject_nameuspecsuextrasuindex((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__init__
s
"uRequirement.__init__cCsXdjdd�|jD��}dj|j�}|rDd|}nd|j||fS(Nu,cSsg|]}dj|��qS(u(ujoin(u.0us((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
<listcomp>
s	u'Requirement.__str__.<locals>.<listcomp>u[%s]u%s%s%s(ujoinuspecsuextrasuproject_name(uselfuspecsuextras((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__str__
s

uRequirement.__str__cCst|t�o|j|jkS(N(u
isinstanceuRequirementuhashCmp(uselfuother((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__eq__
suRequirement.__eq__c	Cst|t�r=|j|jkr%dS|jr[|j}q[nt|t�r[t|�}nd}dd�}x�|jD]{\}}}}||||�}|dkr�dS|dkr�dS|dkr�d}qw|dks�|dkrwd}qwqwW|dkrd}n|S(	NcSs||k||kS(N((uaub((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>$
su*Requirement.__contains__.<locals>.<lambda>uFuTu+u-FT(
u
isinstanceuDistributionukeyuFalseuindexuparsed_versionu
basestringu
parse_versionuNoneuTrue(	uselfuitemulastucompareuparsedutransuopuveruaction((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__contains__
s,		
	uRequirement.__contains__cCs|jS(N(u_Requirement__hash(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__hash__1
suRequirement.__hash__cCsdt|�S(NuRequirement.parse(%r)(ustr(uself((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu__repr__4
suRequirement.__repr__cCsWtt|��}|rDt|�dkr2|dStd|��ntd|��dS(NiiuExpected only one requirementuNo requirements found(ulistuparse_requirementsulenu
ValueError(usureqs((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuparse7
suRequirement.parseN(u__name__u
__module__u__qualname__u__init__u__str__u__eq__u__contains__u__hash__u__repr__uparseustaticmethod(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuRequirement
su--Tu<uT-Tu<=uF+Fu>uT+Fu>=uT..u==uF++u!=cCs@t|t�s9Gdd�d|t�}|jdd�S|jS(u&Get an mro for a type or classic classcBs|EeZdZdS(u_get_mro.<locals>.clsN(u__name__u
__module__u__qualname__(u
__locals__((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuclsO
suclsiN(u
isinstanceutypeuobjectu__mro__(ucls((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_get_mroL
su_get_mrocCsAx:tt|dt|���D]}||kr||SqWdS(u2Return an adapter factory for `ob` from `registry`u	__class__N(u_get_mrougetattrutype(uregistryuobut((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu
_find_adapterS
s%u
_find_adaptercCs8tjj|�}tjj|�s4tj|�ndS(u1Ensure that the parent directory of `path` existsN(uosupathudirnameuisdirumakedirs(upathudirname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyuensure_directoryZ
sccs�d}g}x�t|�D]|}|jd�r�|jd�rv|sI|rW||fVn|dd�j�}g}q�td|��q|j|�qW||fVdS(urSplit a string or iterable thereof into (section,content) pairs

    Each ``section`` is a stripped version of the section header ("[section]")
    and each ``content`` is a list of stripped lines excluding blank lines and
    comment-only lines.  If there are any such lines before the first section
    header, they're returned in a first ``section`` of ``None``.
    u[u]iuInvalid section headingNi����(uNoneuyield_linesu
startswithuendswithustripu
ValueErroruappend(ususectionucontentuline((u&/tmp/pip-k8wh6o-build/pkg_resources.pyusplit_sections`
s	cOsDddlm}tj}ztt_|||�SWd|t_XdS(Ni(umkstemp(utempfileumkstempuosuopenuos_open(uargsukwumkstempuold_open((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_mkstempy
s		u_mkstempcCs@x9tt�D]+}|jd�s
tt|�||<q
q
WdS(Nu_(udiru_manageru
startswithugetattr(uguname((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu_initialize�
su_initializeuobject(u__requires__cCs
|j�S(N(uactivate(udist((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<lambda>�
s(�u__doc__usysuosutimeureuimpuzipfileu	zipimportuwarningsustatu	functoolsupkgutiluget_importeruurlparseu
urlunparseuImportErroruurllib.parseu	frozensetu	NameErrorusetsuImmutableSetu
basestringunextu	cStringIOuStringIOuBytesIOustruiouNoneuexecfileuutimeumkdirurenameuunlinkuTrueu
WRITE_SUPPORTuFalseuopenuos_openuos.pathuisdirusplituversion_infouimplementationunameuimportlib._bootstrapu
_bootstrapuimportlib_bootstrapuparseru_bypass_ensure_directoryu_state_varsu_declare_stateu__getstate__u__setstate__u
_sget_dictu
_sset_dictu_sget_objectu_sset_objectu
_sget_noneu
_sset_noneuget_supported_platformu__all__u	ExceptionuResolutionErroruVersionConflictuDistributionNotFounduUnknownExtrau_provider_factoriesuversionuPY_MAJORuEGG_DISTuBINARY_DISTuSOURCE_DISTu
CHECKOUT_DISTuDEVELOP_DISTuregister_loader_typeuget_provideru_macosx_versu_macosx_archuget_build_platformucompileumacosVersionStringudarwinVersionStringuget_platformucompatible_platformsu
run_scripturun_mainuget_distributionuload_entry_pointu
get_entry_mapuget_entry_infouIMetadataProvideruIResourceProvideruobjectu
WorkingSetuEnvironmentuAvailableDistributionsuRuntimeErroruExtractionErroruResourceManageruget_default_cacheu	safe_nameusafe_versionu
safe_extrauto_filenameu
_marker_namesu_marker_valuesu	_platinfou_pyimpunormalize_exceptionuinvalid_markeruevaluate_markeru_markerlib_evaluateuglobalsuNullProvideruEggProvideruDefaultProviderutypeuSourceFileLoaderu
EmptyProvideruempty_providerubuild_zipmanifestuZipProvideruzipimporteruFileMetadatauPathMetadatauEggMetadatauregister_finderufind_distributionsufind_in_zipufind_nothingufind_on_pathuImpImporteru
FileFinderuregister_namespace_handleru
_handle_nsudeclare_namespaceufixup_namespace_packagesufile_ns_handlerunull_ns_handlerunormalize_pathu_normalize_cachedu_set_parent_nsuyield_linesumatchuLINE_ENDuCONTINUEuDISTROuVERSIONuCOMMAuOBRACKETuCBRACKETuMODULEuVERBOSEu
IGNORECASEuEGG_NAMEucomponent_reugetureplaceu_parse_version_partsu
parse_versionu
EntryPointu_remove_md5_fragmentuDistributionuDistInfoDistributionu_distributionImplu
issue_warninguparse_requirementsu_sort_distsuRequirementu
state_machineu_get_mrou
_find_adapteruensure_directoryusplit_sectionsu_mkstempu_manageru_initializeu__main__u__requires__uworking_seturequireuresolveudistuaddupathuentryuentriesu	add_entryuiter_entry_pointsu	subscribeuadd_activation_listenerulistumap(((u&/tmp/pip-k8wh6o-build/pkg_resources.pyu<module>s�




'

									1���)
	






Z	c
	!�

( 

,)n	�'?
><
	


						

?>