MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/cwd/proc/2/root/proc/2/root/usr/lib/python2.4/site-packages/pkg_resources.pyc
m
k8HcC@sdZdkZdkZdkZdkZdkZdkZdkZdkl	Z	dkl
Z
lZlZdkl
ZdZdddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHgCZd!efdIYZd"efdJYZd#efdKYZd$efdLYZhZeidM ZdMZdNZdOZdPZdQZdRZdSZgdTZ dUZ!dVZ"ei#dWZ$ei#dXZ%e"Z&dYZ'dZZ(e(Z)d[Z*d\Z+e,d]Z-d^Z.d7fd_YZ/d8e/fd`YZ0de1fdaYZ2de1fdbYZ3e3Z4d%e5fdcYZ6dfddYZ7deZ8dfZ9dgZ:dhZ;diZ<d>fdjYZ=ee1e=d?e=fdkYZ>d@e>fdlYZ?ee@e,e?d<e=fdmYZAeAZBdAe>fdnYZCeeiDeCd9eAfdoYZEd:e?fdpYZFd;eCfdqYZGdrfdsYZHdtfduYZIdvZJydwkKlJZJlLZLWneMj
onXeLZH[I[LhZNdxZOePdyZQePdzZReOeiDeRd{aSePd|ZTeOe1eTePd}ZUeOeHeUhZVhZWd~ZXdZYdZZe,dZ[dZ\eXeHe\eXeiDe\dZ]eXe1e]dZ^hdZ_dZ`dZaei#dibZcei#dibZdei#dibZeei#dibZfei#dibZgei#dibZhei#dibZiei#dibZjei#deikeilBibZmei#deikZnhdd<dd<dd<dd<dd<ioZpdZqdZrd e1fdYZsde1fdYZtdZudZvdZwdfdYZxhdd<dd<dd<dd<dd<dd<ZydZzdZ{dZ|dZ}dZ~e7ZdZeee2ZydklZWneMj
onXyeieWnej
oe2gZx0eievee3D]ZeieqWx2eiD]'ZeeijoeienqWeiei(nXeiZeiZeiZei(Z(e(Z)edge_eeieidS(sYPackage 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.
N(sImmutableSet(sutimesrenamesunlink(sopencCst}ti|}|dj	oWtidjoGy-ddit	d |i
df}Wq|tj
oq|Xn|S(sZReturn 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.
    tdarwinsmacosx-%s-%st.iiN(tget_build_platformtplattmacosVersionStringtmatchtmtNonetsystplatformtjoint_macosx_verstgroupt
ValueError(RR((t1/usr/lib/python2.4/site-packages/pkg_resources.pytget_supported_platforms-	trequiret
run_scripttget_providertget_distributiontload_entry_pointt
get_entry_maptget_entry_infotiter_entry_pointstresource_stringtresource_streamtresource_filenametresource_listdirtresource_existstresource_isdirtdeclare_namespacetworking_settadd_activation_listenertfind_distributionstset_extraction_pathtcleanup_resourcestget_default_cachetEnvironmentt
WorkingSettResourceManagertDistributiontRequirementt
EntryPointtResolutionErrortVersionConflicttDistributionNotFoundtUnknownExtratExtractionErrortparse_requirementst
parse_versiont	safe_nametsafe_versiontget_platformtcompatible_platformstyield_linestsplit_sectionst
safe_extratto_filenametensure_directorytnormalize_pathtEGG_DISTtBINARY_DISTtSOURCE_DISTt
CHECKOUT_DISTtDEVELOP_DISTtIMetadataProvidertIResourceProvidertFileMetadatatPathMetadatatEggMetadatat
EmptyProvidertempty_providertNullProvidertEggProvidertDefaultProvidertZipProvidertregister_findertregister_namespace_handlertregister_loader_typetfixup_namespace_packagestget_importertrun_maintAvailableDistributionscBstZdZdZRS(s.Abstract base for dependency resolution errorscCs|iit|iS(N(tselft	__class__t__name__treprtargs(RS((Rt__repr__Us(RUt
__module__t__doc__RX(((RR+SscBstZdZRS(sAAn already-installed version conflicts with the requested version(RURYRZ(((RR,WscBstZdZRS(s&A requested distribution was not found(RURYRZ(((RR-ZscBstZdZRS(s>Distribution doesn't have an "extra feature" of the given name(RURYRZ(((RR.]siiiiicCs|t|<dS(sRegister `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(tprovider_factoryt_provider_factoriestloader_type(R]R[((RRNgscCst|to(ti|ptt|dSnyti|}Wn*t
j
ot|ti|}nXt|dd}tt||S(s?Return an IResourceProvider for the named module or requirementit
__loader__N(t
isinstancetmoduleOrReqR)RtfindRtstrRtmodulestmoduletKeyErrort
__import__tgetattrRtloadert
_find_adapterR\(R`RdRh((RRps(
cCs|ptidii}xa|D]L}|idd\}}|djo!|i|iidPq)q)Wt
dn|dS(Ns/usr/bin/sw_versisProductVersion:RsWhat?!i(t_cachetostpopentreadt
splitlinestinfotlinetsplitRtkeytvaluetappendtstripR
(RjRoRsRrRp((RR|s
	
cCs"hdd<dd<i||S(NtPowerPCtppctPower_Macintosh(tgettmachine(Rz((Rt_macosx_archscCsdkl}|}tidjo|idonyTt}ti	di
dd}dt|dt|d	t
|fSWqtj
oqXn|S(sReturn 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.
    (sget_platformRsmacosx-it t_smacosx-%d.%d-%siiN(tdistutils.utilR4RRR	t
startswithRtversionRktunametreplaceRztintR{R
(RzRRR4((RRs
	!	/	smacosx-(\d+)\.(\d+)-(.*)sdarwin-(\d+)\.(\d+)\.(\d+)-(.*)cCsu|d	jp|d	jp
||jotSnti|}|o,ti|}|pti|}|owt
|id}d|id|idf}|djo
|djp|djo|djotSqntSn|id|idjp|id|idjotSnt
|idt
|idjotSntSntS(
sCan 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.
    is%s.%siis10.3is10.4iN(tprovidedRtrequiredtTrueRRtreqMactprovMactdarwinVersionStringt
provDarwinRRtdversiontmacosversiontFalse(RRRRRRR((RR5s('"4>+cCsNtidi}|d}|i||d<t|di||dS(s@Locate distribution `dist_spec` and run its `script_name` scriptiRUiN(
Rt	_getframet	f_globalstnstnametclearRt	dist_specRtscript_name(RRRR((RRs


cCsjt|toti|}nt|tot|}nt|tptd|n|S(s@Return a current distribution object for a Requirement or strings-Expected string, Requirement, or DistributionN(R_tdistt
basestringR)tparseRR(t	TypeError(R((RRscCst|i||S(sDReturn `name` entry point of `group` for `dist` or raise ImportErrorN(RRRRR(RRR((RRscCst|i|S(s=Return the entry point map for `group`, or the full entry mapN(RRRR(RR((RRscCst|i||S(s<Return the EntryPoint object for `group`+`name`, or ``None``N(RRRRR(RRR((RRscBs>tZdZdZdZdZdZdZRS(NcCsdS(s;Does the package's distribution contain the named metadata?N((R((Rthas_metadatascCsdS(s'The named metadata resource as a stringN((R((Rtget_metadatascCsdS(sYield 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((R((Rtget_metadata_linesscCsdS(s>Is the named metadata a directory?  (like ``os.path.isdir()``)N((R((Rtmetadata_isdirscCsdS(s?List of metadata names in the directory (like ``os.listdir()``)N((R((Rtmetadata_listdirscCsdS(s=Execute the named script in the supplied namespace dictionaryN((Rt	namespace((RRs(RURYRRRRRR(((RRAs					cBsDtZdZdZdZdZdZdZdZRS(s3An object that provides access to package resourcescCsdS(sdReturn a true filesystem path for `resource_name`

        `manager` must be an ``IResourceManager``N((tmanagert
resource_name((Rtget_resource_filename#scCsdS(siReturn a readable file-like object for `resource_name`

        `manager` must be an ``IResourceManager``N((RR((Rtget_resource_stream(scCsdS(smReturn a string containing the contents of `resource_name`

        `manager` must be an ``IResourceManager``N((RR((Rtget_resource_string-scCsdS(s,Does the package contain the named resource?N((R((Rthas_resource2scCsdS(s>Is the named resource a directory?  (like ``os.path.isdir()``)N((R((RR5scCsdS(s?List of resource names in the directory (like ``os.listdir()``)N((R((RR8s(	RURYRZRRRRRR(((RRB s					cBstZdZedZdZdZdZedZdZ	dZ
eedZeed	Z
eeed
ZdZdZd
ZRS(sDA collection of active distributions on sys.path (or a similar list)cCs`g|_h|_h|_g|_|djo
ti}nx|D]}|i	|qEWdS(s?Create working set from list of path entries (default=sys.path)N(
RStentriest
entry_keystby_keyt	callbacksRRtpathtentryt	add_entry(RSRR((Rt__init__Ls				

cCsT|ii|g|ii|x*t|tD]}|i	||t
q3WdS(sAdd a path item to ``.entries``, finding any distributions on it

        ``find_distributions(entry,False)`` 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``.)
        N(RSRt
setdefaultRRRtR!RRtaddR(RSRR((RRZs	cCs|ii|i|jS(s9True if `dist` is the active distribution for its projectN(RSRRyRRr(RSR((Rt__contains__jscCsJ|ii|i}|dj	o ||jot||n|SdS(sFind 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(RSRRytreqRrRRR,(RSRR((RRars
	ccsixb|D]Z}|i|}|djox5|iD]
}|Vq6Wq||jo||VqqWdS(sYield 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(	RSRRRRRRtvaluestep(RSRRRRR((RRs


cCsQtidi}|d}|i||d<|i|di	||dS(s?Locate distribution for `requires` and run `script_name` scriptiRUiN(RRRRRRRSRtrequiresRR(RSRRRR((RRs


ccs\h}xO|iD]D}x;|i|D],}||jod||<|i|Vq$q$WqWdS(sYield 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(tseenRSRtitemRRrR(RSRRrR((Rt__iter__s


cCs|o|i|i|n|djo
|i}n|ii	|g}|ii	|ig}|i|i
jodSn||i
|i<|i|jo|i|in|i|jo|i|in|i|dS(sAdd `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(tinsertRt	insert_onRSRRRtlocationRRtkeystkeys2RrRRtt
_added_new(RSRRRRR((RRs


c	Csdt|ddd}h}h}g}x2|o*|id}||joq.n|i|i}|djo|ii|i}|djoa|djot|i}n|i|||}||i<|djot|qn|i|n||jot||n|i|i|idddt||<q.W|S(sList 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``.
        Nii(tlisttrequirementst	processedtbesttto_activatetpopRRyRrRRRSRtenvR%Rt
best_matcht	installerR-RtR,textendRtextrasR(	RSRRRRRRRR((Rtresolves2




 

&cCs;t|}|ih}h}
|djot|i
}
|
|7}
n||}
|ig}t|i|x|D]}	x||	D]}|ig}y|i||
|}Wn.tj
o"}|||<|oqqPqXt|i||
iti|PqWq|Wt|
}
|
i|
|fS(saFind 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 "Couldn't 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.
        N(Rt
plugin_envtplugin_projectstsortt
error_infot
distributionstfull_envRR%RSRRRTt
shadow_settmapRtproject_nameRtas_requirementRRRt	resolveesR+tvtfallbacktupdatetdicttfromkeys(RSRRRRRRRRRRRRRR((Rtfind_pluginss:!



	
cGs7|it|}x|D]}|i|qW|S(sEnsure 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.
        N(RSRR0RtneededRR(RSRRR((RR?scCsG||ijodSn|ii|x|D]}||q/WdS(sAInvoke `callback` for all distributions (including existing ones)N(tcallbackRSRRtR(RSRR((Rt	subscribeQscCs"x|iD]}||q
WdS(N(RSRRR(RSRR((RRZs
(RURYRZRRRRRaRRRRRRRRRR(((RR&Is				
	
)R			cBstZdZeeedZdZdZedZ	dZ
dZedZedZ
d	Zd
ZdZRS(s5Searchable snapshot of distributions on a search pathcCs5h|_h|_||_||_|i|dS(s!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. ``'2.4'``);
        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(RSt_distmapRjR	tpythontscantsearch_path(RSRR	R((RRks				cCsF|idjp#|idjp|i|ijot|i|iS(sIs 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(RSRRRt
py_versionR5R	(RSR((Rtcan_addscCs|i|ii|dS(s"Remove `dist` from the environmentN(RSRRRrtremove(RSR((RRscCsS|djo
ti}nx2|D]*}x!t|D]}|i|q4Wq!WdS(sdScan `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(	RRRRRR!RRSR(RSRRR((RRs


cCsy|i|SWn7tj
o+|i}||ijogSqInX||ijo&|i|}|i|<t|n|i|S(sKReturn a newest-to-oldest list of distributions for `project_name`
        N(RSRjRRetlowerRtdistst_sort_dists(RSRR((Rt__getitem__s
cCs|i|or|ioe|ii|ig}||jo<|i||i|i	jot
|i	|iq~qndS(s<Add `dist` if we ``can_add()`` it and it isn't already addedN(RSRRthas_versionRRRrRRtRjR(RSRR((RRs

cCsa|i|}|dj	o|Snx*||iD]}||jo|Sq2q2W|i||S(sFind 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(	RRaRRRRSRrtobtainR(RSRRRR((RRs

cCs|dj	o||SndS(sObtain 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(RRtrequirement(RSRR((RRs
ccs1x*|iiD]}||o|VqqWdS(s=Yield the unique project names of the available distributionsN(RSRRRr(RSRr((RRs
cCst|to|i|n[t|to7xG|D](}x||D]}|i|qIWq8Wntd|f|S(s2In-place addition of a distribution or environmentsCan't add %r to environmentN(	R_totherR(RSRR%tprojectRR(RSRRR((Rt__iadd__scCs@|igdddd}x||fD]}||7}q(W|S(s4Add an environment or distribution to an environmentR	RN(RSRTRtnewRR(RSRRR((Rt__add__s
(RURYRZRRtPY_MAJORRRRRRRRRRRR(((RR%hs				
		cBstZdZRS(sTAn 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
    (RURYRZ(((RR/s
cBstZdZeZdZdZdZdZdZ	dZ
dZdZfd	Z
d
ZdZedZRS(
s'Manage resource extraction and packagescCs
h|_dS(N(RStcached_files(RS((RRscCst|i|S(sDoes the named resource exist?N(Rtpackage_or_requirementRR(RSRR((RRscCst|i|S(s,Is the named resource an existing directory?N(RRRR(RSRR((RRscCst|i||S(s4Return a true filesystem path for specified resourceN(RRRRSR(RSRR((RRscCst|i||S(s9Return a readable file-like object for specified resourceN(RRRRSR(RSRR((RR#scCst|i||S(s%Return specified resource as a stringN(RRRRSR(RSRR((RR)scCst|i|S(s1List the contents of the named resource directoryN(RRRR(RSRR((RR/scCs^tid}|ipt}td||f}||_	||_||_
|dS(s5Give an error message for problems extracting file(s)is}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(Rtexc_infotold_excRStextraction_pathR$t
cache_pathR/terrRtoriginal_error(RSRRR((Rtextraction_error5s			cCsb|ipt}tii||d|}yt
|Wn|inXd|i|<|S(sReturn 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.
        s-tmpiN(
RSRR$textract_pathRkRR
tarchive_nametnamesttarget_pathR:RR(RSRRRR((Rtget_cache_path^s
cCsdS(s4Perform 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.
        N((RSttempnametfilename((Rtpostprocessvs
cCs'|iotdn||_dS(sSet 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()``.)
        s5Can't change extraction path, files already extractedN(RSRR
RR(RSR((RR"s
cCsdS(sB
        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((RStforce((RR#s
(RURYRZRRRRRRRRRRRRR"RR#(((RR's								)		cCsytidSWntj
onXtidjotiidSnd}dd|fd|fd|fdd|fg}x|D]\}}d}xo|D]4}|tijotii
ti|}qPqW|otii
||}ntii
|dSqWtd
dS(s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".
    tPYTHON_EGG_CACHEtnts~/.python-eggssApplication DatatAPPDATAtUSERPROFILEt	HOMEDRIVEtHOMEPATHtHOMEtWINDIRtsPython-Eggss3Please set the PYTHON_EGG_CACHE enviroment variableN(R((RN(R(RR(R(sHOME((sHOMEN(R
(RktenvironReRRt
expandusertapp_dataRt	app_homesRtsubdirtdirnameRrR
tRuntimeError(RRRRRrR((RR$s*0	cCstidd|S(sConvert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    s[^A-Za-z0-9.]+t-N(tretsubR(R((RR2scCs%|idd}tidd|S(sConvert 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.
    R|Rs[^A-Za-z0-9.]+RN(RRRR(R((RR3scCstidd|iS(sConvert 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.
    s[^A-Za-z0-9.]+R}N(RRtextraR(R((RR8scCs|iddS(s|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    RR}N(RR(R((RR9scBstZdZeZeZeZdZdZdZ	dZ
dZdZdZ
dZd	Zd
ZdZdZd
ZdZdZdZdZdZRS(sETry to implement resources and metadata for arbitrary PEP 302 loaderscCs:t|dd|_tiit|dd|_dS(NR^t__file__R(	RgRdRRSRhRkRRtmodule_path(RSRd((RR	scCs|i|i|S(N(RSt_fnRR(RSRR((RR
scCst|i||S(N(tStringIORSRRR(RSRR((RRscCs|i|i|i|S(N(RSt_getRRR(RSRR((RRscCs|i|i|i|S(N(RSt_hasRRR(RSR((RRscCs&|io|i|i|i|S(N(RStegg_infoRRR(RSR((RRscCs.|ipdSn|i|i|i|S(NR(RSRRRR(RSR((RRs
cCst|i|S(N(R6RSRR(RSR((RR!scCs|i|i|i|S(N(RSt_isdirRRR(RSR((RR$scCs&|io|i|i|i|S(N(RSRRRR(RSR((RR'scCs|i|i|i|S(N(RSt_listdirRRR(RSR((RR+scCs.|io |i|i|i|SngS(N(RSRRRR(RSR((RR.s
 cBsd|}|i|ped|n|i|idd}|idd}|i|i	|}||d<ei
i|oe|||nOdkl}e|d|id|f||<e||d	}|||UdS(
Nsscripts/sNo script named %rs
s
s
R(scacheitexec(RtscriptRSRR+RRtscript_textRRtscript_filenameRRkRtexiststexecfilet	linecachetcachetlenRqtcompiletscript_code(RSRRR*R!R#R'R"((RR3s


%cCstddS(Ns9Can't perform this operation for unregistered loader type(tNotImplementedError(RSR((RREscCstddS(Ns9Can't perform this operation for unregistered loader type(R+(RSR((RRJscCstddS(Ns9Can't perform this operation for unregistered loader type(R+(RSR((RROscCstii||idS(Nt/(RkRR
tbaseRRq(RSR-R((RRTscCs7t|ido|ii|SntddS(Ntget_datas=Can't perform this operation for loaders without 'get_data()'(thasattrRSRhR.RR+(RSR((RRWs(RURYRZRtegg_nameRRhRRRRRRRRRRRRRRRRRR(((RRHs,																	cBs tZdZdZdZRS(s&Provider based on a virtual filesystemcCsti|||idS(N(RHRRSRdt
_setup_prefix(RSRd((RRdscCs|i}d}x||jos|iido;tii||_	tii
|d|_||_Pn|}tii
|\}}qWdS(Ns.eggsEGG-INFO(RSRRRtoldRtendswithRktbasenameR0R
Rtegg_rootRqR-(RSR2R-R((RR1hs	
	(RURYRZRR1(((RRIas	cBs;tZdZdZdZdZdZdZRS(s6Provides access to package resources in the filesystemcCstii|S(N(RkRR$(RSR((RRscCstii|S(N(RkRtisdir(RSR((RRscCs
ti|S(N(RktlistdirR(RSR((RRscCst|i|i|dS(Ntrb(topenRSRRR(RSRR((RRscCs/t|d}z|iSWd|iXdS(NR8(R9RtstreamRmtclose(RSRR:((RRs
(RURYRZRRRRR(((RRJ}s				cBs<tZdZdZZdZdZeZdZ	RS(s.Provider that returns nothing for all requestscCstS(N(R(RSR((Rt<lambda>scCsdS(NR((RSR((RR<scCsgS(N((RSR((RR<scCsdS(N((RS((RRs(
RURYRZRRRRRRR(((RRFs
		cBstZdZeZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZRS(
s"Resource support for zips and eggscCs@ti||ti|ii|_|iit	i
|_dS(N(RIRRSRdt	zipimportt_zip_directory_cacheRhtarchivetzipinfoRktseptzip_pre(RSRd((RRscCsE|i|io|t|iSntd||ifdS(Ns%s is not a subpath of %s(tfspathRRSRBR(tAssertionError(RSRC((Rt
_zipinfo_namescCsi|i|}|i|itio%|t|idi	tiSnt
d||ifdS(Nis%s is not a subpath of %s(RSRBtzip_pathRCRR5RkRAR(RqRD(RSRFRC((Rt_partss
%cCs|iptdn|i|}|i}di|i	||jo.x+|D]}|i||i
|q[Wn|i||S(Ns5resource_filename() only supported for .egg, not .zipR,(RSR0R+t_resource_to_zipRRFt_get_eager_resourcesteagersR
RGRt_extract_resourceRt
_eager_to_zip(RSRRRFRJR((RRs
!c	Cs||ijoPx9|i|D]'}|i|tii||}q$Wtii
|Sn|i|}|d|d|d}}
}
|
d?d|
d?d@|
d@|d@d	?|d?d
@|d@dddd
f	}ti|}y|i|i|i|}tii|o;ti|}|i|
jo|i|jo|Sq[ntddtii
|\}}	ti||i i!|ti"|t#|	||f|i$|	|yt%|	|Wnti&j
otii|ojti|}|i|
jo|i|jo|Sqmtidjot'|t%|	||SqmnnXWn ti&j
o|i(nX|S(Niiii	iiiiii?iiis	.$extracttdirR()RFRSt_indexRRKRRkRR
tlastRR@tzip_stattttdtsizet	date_timettimetmktimet	timestampRR0RGt	real_pathtisfiletstattst_sizetst_mtimet_mkstemptoutfttmpnamtwriteRhR.R;tutimeRtrenameterrortunlinkR(RSRRFRTRZRORRXRWR_RRRQR^RSRP((RRKsF%
 M $
 

cCse|idjoNg}x8dD]0}|i|o|i|i|qqW||_n|iS(Nsnative_libs.txtseager_resources.txt(snative_libs.txtseager_resources.txt(RSRJRRRRR(RSRJR((RRIs
cCsy|iSWntj
oh}x|iD]w}|iti}x\|oTtii
|d }||jo||i|dPqG|i
g||<qGWq,W||_|SnXdS(Ni(RSt	_dirindextAttributeErrortindR@RRqRkRAtpartsR
tparentRtR(RSRiRhRgR((RRNs 

	cCs/|i|}||ijp||ijS(N(RSRERCRFR@RN(RSRCRF((RR!scCs|i||ijS(N(RSRERCRN(RSRC((RR%scCs%t|ii|i|fS(N(RRSRNRyRERC(RSRC((RR(scCs|i|i|i|S(N(RSRERR5R(RSR((RRL+scCs|i|i|i|S(N(RSRERRR(RSR((RRH.s(RURYRZRRJRRERGRRKRIRNRRRRLRH(((RRKs						
	8							cBs2tZdZdZdZdZdZRS(s*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(RRS(RSR((RRVscCs
|djS(NsPKG-INFO(R(RSR((RRYscCs7|djot|idiSntddS(NsPKG-INFOtrUs(No metadata except PKG-INFO is available(RR9RSRRmRe(RSR((RR\s
cCst|i|S(N(R6RSRR(RSR((RRas(RURYRZRRRR(((RRCJs

			cBstZdZdZRS(sqMetadata 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(RRSRR(RSRR((RRs	(RURYRZR(((RRDsscBstZdZdZRS(s Metadata provider for .egg filescCsuti|i|_|iti|_||_	|i
o"tii|i|i
|_
n
|i|_
|idS(s-Create a metadata provider from a zipimporterN(R=R>timporterR?RSR@RkRARBRhtprefixRR
RR1(RSRk((RRs	
"(RURYRZR(((RREst
ImpWrappercBs&tZdZedZedZRS(s>PEP 302 Importer that wraps Python's "normal" import algorithmcCs
||_dS(N(RRS(RSR((RRscCs|idd}||jo|idjodSn|idjo
d}n
|ig}yti||\}}}Wntj
odSnXt|||S(NRi(
tfullnameRqtsubnameRSRRtimptfind_moduletfileRtetctImportErrort	ImpLoader(RSRnRRRsRoRr((RRqs
	(RURYRZRRRq(((RRmsRucBs tZdZdZdZRS(s<PEP 302 Loader that wraps Python's "normal" import algorithmcCs||_||_||_dS(N(RrRSRRs(RSRrRRs((RRs		cCsHz%ti||i|i|i}Wd|io|iinX|S(N(	Rptload_moduleRnRSRrRRstmodR;(RSRnRw((RRvs%
(RURYRZRRv(((RRus	cCsyti|}WnTtj
oHxCtiD]-}y||}Wntj
oq,XPq,Wd}nXtii	|||djo*yt
|}Wqtj
oqXn|S(sRetrieve a PEP 302 "importer" for the given path item

    If there is no importer, this returns a wrapper around the builtin import
    machinery.  The returned importer is only cached if it was created by a
    path hook.
    N(Rtpath_importer_cachet	path_itemRkRet
path_hooksthookRtRRRm(RyR{Rk((RRPs&

	(sget_importersImpImportercCs|t|<dS(sxRegister `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(tdistribution_findert_distribution_finderst
importer_type(R~R|((RRLscCs+t|}tt|}||||S(s.Yield distributions accessible via `path_item`N(RPRyRkRiR}tfindertonly(RyRRkR((RR!sccst|}|idoti|d|Vn|odSnxg|idD]V}|i
do@tii
||}x(tti||D]
}|VqWqRqRWdS(NsPKG-INFOtmetadataR,s.egg(RERkRRR(t
from_filenameRyRRtsubitemR3RkRR
tsubpathtfind_in_zipR=tzipimporterR(RkRyRRRRR((RRscOsAydklaWn tj
odklanXt||S(s)Thunk to load the real StringIO on demand(sStringION(t	cStringIORRtRWtkw(RWR((RRscCsfS(N((RkRyR((Rtfind_nothingsc
cst|}tii|o|iido/ti|dt	|tii
|dVqxXti|D]C}|i}|idodtii
||}tii|ot	||}	n
t|}	ti|||	dtVqt|o>|ido.xttii
||D]
}|Vq.Wqt|oo|ido_x\ttii
||D];}|ipqtnxt|iD]
}|VqWqtWqtqtWndS(s6Yield distributions accessible on a sys.path directorys.eggRsEGG-INFOs	.egg-infot
precedences	.egg-linkN(t_normalize_cachedRyRkRR6RR3R(RRDR
R7RtfullpathRRCt
from_locationR@RR!RRrRpRutrstripR(
RkRyRRRpRRRRR((Rtfind_on_paths4/
cCs|t|<dS(sRegister `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(tnamespace_handlert_namespace_handlersR~(R~R((RRMCscCst|}|djodSn|i|}|djodSntii	|}|djo1ti
|}ti|<g|_t
|n$t|dptd|ntt|}|||||}|dj	o0|i}|i||i|||_n|S(sEEnsure that named package includes a subpath of path_item (if needed)t__path__sNot a package:N(RPRyRkRRqtpackageNameRhRRcRyRdRRt_set_parent_nsR/RRiRthandlerRRRtRv(RRyRRdRhRkRR((Rt
_handle_nsTs&



cCstiz|tjodSntid}}d|jomdi|i	dd }t
|t|yti|i
}Wqtj
otd|qXnti|gi|ti|gx|D]}t||qWWdtiXdS(s9Declare that package 'packageName' is a namespace packageNRisNot a package:(Rptacquire_lockRt_namespace_packagesRRRRiR
RqRRfRcRRfRRRtRyRtrelease_lock(RRiRyR((RRis*




cCsdtizHxAti|fD]-}t||}|ot	||q q WWdti
XdS(sDEnsure that previously-declared namespace packages include path_itemN(RpRRRyRitpackageRRyRROR(RyRiRR((RROs
cCsbtii||idd}t|}x-|i
D]}t||joPq8q8W|SdS(sBCompute an ns-package subpath for a filesystem or zipfile importerRiN(RkRR
RyRRqRRt
normalizedRdRR(RkRyRRdRRR((Rtfile_ns_handlers"
	cCsdS(N(R(RkRyRRd((Rtnull_ns_handlerscCstiitii|S(s1Normalize a file/dir name for comparison purposesN(RkRtnormcasetrealpathR(R((RR;scCs>y||SWn+tj
ot|||<}|SnXdS(N(RjRReR;tresult(RRjR((RRs
cCsW|id}|i}|o1di|}tti	||ti	|ndS(NR(
RRqRhRRR
RitsetattrRRc(RRiRRh((RRs
ccst|toGxp|iD]2}|i}|o|ido|VqqWn-x)|D]!}xt|D]
}|VqqWq^WdS(sAYield non-empty/non-comment lines of a ``basestring`` or sequencet#N(	R_tstrsRRntsRuRtssR6(RRR((RR6s

s
\s*(#.*)?$s\s*\\\s*(#.*)?$s\s*((\w|[-.])+)s!\s*(<=?|>=?|==|!=)\s*((\w|[-.])+)s\s*,s\s*\[s\s*\]s\w+(\.\w+)*$sL(?P<name>[^-]+)( -(?P<ver>[^-]+) (-py(?P<pyver>[^-]+) (-(?P<plat>.+))? )? )?s(\d+ | [a-z]+ | \.| -)tpretctpreviewRsfinal-trctdevt@ccswxlti|D][}t||}|p
|djoqn|d djo|idVqd|VqWdVdS(NRit
0123456789it*s*final(tcomponent_reRqRtpartRtzfill(RR((Rt_parse_version_partsscCsg}xt|iD]}|idoi|djo.x+|o|ddjo|iq?Wnx+|o|ddjo|iqmWn|i|qWt|S(sYConvert 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", whic 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.
    Rs*finalis*final-t00000000N(	RhRRRRRRRtttuple(RRhR((RR1s
cBstZdZffedZdZdZeeedZeedZ	edZ
ee
Z
edZeeZedZ
ee
Z
RS(	s3Object representing an advertised importable objectcCspt|ptd|n||_||_t||_tiddi	|i
|_
||_dS(NsInvalid module namesx[%s]t,(tMODULEtmodule_nameR
RRSRtattrsR)RR
RR(RSRRRRR((RRs
		"cCsjd|i|if}|io|ddi|i7}n|io|ddi|i7}n|S(Ns%s = %st:Rs [%s]R(RSRRRRR
R(RSR((Rt__str__s

cCsdt|S(NsEntryPoint.parse(%r)(RbRS(RS((RRX!scCs|o|i||nt|ittdg}xP|iD]E}yt
||}WqFtj
otd||fqFXqFW|S(NRUs%r has no %r attribute(
RRSRRRfRtglobalsRRtattrRgRfRt(RSRRRRR((Rtload$s!
cCsZ|io|iotd|nttiti|ii|i||dS(Ns&Can't require() without a distribution(RSRRR.RRRRRRR(RSRR((RR.s	cCs%yf}}|idd\}}d|joL|idd\}}tid|}|i	o
t
n|i}nd|joN|idd\}}t|ip
t
n|iid}nWn"t
j
ot
d|n$X||i|i|||SdS(	sParse 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
        t=it[sx[RRs9EntryPoint must be in 'name=module:attrs [extras]' formatN(RRtsrcRqRRsR)RRtspecsR
RRtclsRuR(RRRRRRsRR((RR7s&	






cCst|ptd|nh}x\t|D]N}|i||}|i|jotd||in|||i<q3W|S(sParse an entry point groupsInvalid group namesDuplicate entry pointN(RRR
tthisR6tlinesRpRRRRR(RRRRRRRp((Rtparse_group`s

cCst|to|i}n
t|}h}x|D]|\}}|djo|pq9nt	dn|i
}||jot	d|n|i|||||<q9W|S(s!Parse a map of entry point groupss%Entry points must be listed in groupssDuplicate group nameN(R_tdataRtitemsR7tmapsRRRR
RuRRR(RRRRRR((Rt	parse_mapos 

(RURYRZRRRRXRRRRtclassmethodRR(((RR*
s			
	
cBsytZdZeeeeeeedZedZeeZe	dZ
dZdZdZ
e	e
Z
dZe	eZdZe	eZd	Ze	eZfd
ZdZedZd
ZdZdZdZedZeeZdZdZedZdZedZdZdZdZ dZ!e	e!Z!RS(s5Wrap an actual or potential sys.path entry w/metadatacCsnt|pd|_|dj	ot||_n||_||_||_	||_
|pt|_
dS(NtUnknown(R2RRSRRR3t_versionRR	RRRRGt	_provider(RSRRRRRR	R((RRs
				cKsdgd\}}}	}tii|\}}|i
djo?t|}
|
o(|
i
dddd\}}}	}qn|||d|d	|d
|	d||S(
Nis.eggs	.egg-infoRtvertpyverRRRRR	(s.eggs	.egg-info(RRRRR	RkRtsplitextR4textRtEGG_NAMERRRRRR(RRR4RRRR	RRRR((RRs,cCsEt|df|i|it|ipd|i|i|ifS(Ntparsed_versionR(RgRSRRrR(RRR	(RS((RR<scCst|i|S(N(tcmpRSthashcmpR(RSR((Rt__cmp__scCs
t|iS(N(thashRSR(RS((Rt__hash__scCs?y|iSWn-tj
o!|ii|_}|SnXdS(N(RSt_keyRfRRRr(RSRr((RRrs
cCs?y|iSWn-tj
o!t|i|_}|SnXdS(N(RSt_parsed_versionRfR1Rtpv(RSR((RRs
cCsy|iSWntj
ovxq|idD]L}|iido0t|idddi	|_|iSq,q,Wt
d|nXdS(NsPKG-INFOsversion:Ris.Missing 'Version:' header and/or PKG-INFO file(RSRRft
_get_metadataRpRRR3RqRuR
(RSRp((RRs%cCsy|iSWntj
ohdg<}|_xjdD]b}xYt|i|D]B\}}|ot
|}n|i|git
|qUWq9W|SnXdS(Nsrequires.txtsdepends.txt(srequires.txtsdepends.txt(RSt_Distribution__dep_mapRfRtdmRR7RRtreqsR8RRR0(RSRRRR((Rt_dep_maps'cCs|i}g}|i|idfxU|D]M}y|i|t	|Wq/t
j
otd||fq/Xq/W|S(s@List of Requirements needed for this distro if `extras` are useds%s has no such extra feature %rN(RSRRtdepsRRyRRRR8ReR.(RSRRRR((RRs	ccs6|i|o"x|i|D]
}|Vq WndS(N(RSRRRRp(RSRRp((RRscCsb|djo
ti}n|i||tijo't|itt|i	dndS(s>Ensure distribution is importable on `path` (default=sys.path)snamespace_packages.txtN(
RRRRSRRORRRR(RSR((Rtactivates



cCsRdt|it|i|iptf}|io|d|i7}n|S(s@Return what this distribution's standard .egg filename should bes
%s-%s-py%sRN(R9RSRRRRRR	(RSR((RR0s
/
cCs-|iod||ifSnt|SdS(Ns%s (%s)(RSRRb(RS((RRXs
cCsPyt|dd}Wntj
o
d}nX|pd}d|i|fS(NRs[unknown version]s%s %s(RgRSRRR
R(RSR((RRs
cCs-|ido
t|nt|i|S(sADelegate all unrecognized public attributes to .metadata providerR}N(RRRfRgRSR(RSR((Rt__getattr__s
cKs(|it|tii|||S(N(	RRRRRkRR4RR(RRRR((RR!scCstid|i|ifS(s?Return a ``Requirement`` that matches this distribution exactlys%s==%sN(R)RRSRR(RS((RR(scCsF|i||}|djotd||ffn|iS(s=Return the `name` entry point of `group` or raise ImportErrorsEntry point %r not foundN(RSRRRRRRtR(RSRRR((RR,s

cCsjy
|i}Wn5tj
o)ti|id|}|_nX|dj	o|i	|hSn|S(s=Return the entry point map for `group`, or the full entry mapsentry_points.txtN(
RSt_ep_maptep_mapRfR*RRRRRy(RSRR((RR3s
'
cCs|i|i|S(s<Return the EntryPoint object for `group`+`name`, or ``None``N(RSRRRyR(RSRR((RR?sc
Cs3|p|i}|pdSn|tijo|int|}tii	|}	tt|}d}xot|D]P\}}||joPq}||	jo%|i|||i||Pq}q}W|i|dSxJy|i||d}Wntj
oPqX||=||=|}qWdS(s@Insert self.location in path before its nearest parent directoryNi(tlocRSRRRtcheck_version_conflictRtnlocRkRtbdirRtnpathRtbpt	enumeratetpRRRttindextnpR
(
RSRRRRRRRRR((RRUs:


	
cCs|idjodSnti|id}t|i}x|idD]}|t
ijp||jp
|tjoqOnt
t
i|dd}|ot|i|oqOntd|||ifqOWdS(Nt
setuptoolssnamespace_packages.txts
top_level.txtRsIModule %s was already imported from %s, but %s is being added to sys.path(RSRrRRRtnspR;RRtmodnameRRcRRgRtfnRt
issue_warning(RSRRRR((RR~s*cCs=y|iWn+tj
otdt|tSnXtS(NsUnbuilt egg for (RSRR
RRVRR(RS((RRs	cKsMx*d	D]"}|i|t||dqW|id|i|i|S(
s@Copy this distribution, substituting in any changed keyword argsRRRR	RRRN(sproject_namesversions
py_versionsplatformslocations
precedence(RRRRgRSRRRT(RSRR((Rtclones cCs-g}|iD]}|o||qq~S(N(t_[1]RSRtdep(RSRR((RRs("RURYRZRRR<RRRtpropertyRRRRrRRRRRRR0RXRRRRRRRRRRRR(((RR(sD
						
									)				cOs|d}t}y/x(ti|i|jo|d7}qWWntj
onXdkl}|d|d||dS(Ni(swarnt
stacklevel(tlevelRtgRRRR
twarningstwarnRWR(RWRRRR((RRs	
c	#s+tt|d}xD]}t|}|ptd|n|i	d}|i}	g}
t||	}|o4|i}	|tt||	dd\}}	}
n|tt||	d	d\}}	}g}|D]\}}||t|fq~}t|||
Vq%WdS(
sYield ``Requirement`` objects for each specification in `strs`

    `strs` must be an instance of ``basestring``, or a (possibly-nested)
    iterable thereof.
    csMg}x|||pt||o<yi}d}Wqetj
otdqeXn|||}|p%td|d|d||n|i|i
||i}t||}|o|i}q	|||ptd|d||q	q	W|||}|o|i}n|||fS(Nis+\ must not appear on the last nonblank lines	Expected s intatsExpected ',' or end-of-list in(Rt
TERMINATORRpRtCONTINUERtnextt
StopIterationR
tITEMRt	item_nameRtRtgroupstendtCOMMA(RRRpRRRRR(R(Rt	scan_lists,%"sMissing distribution specis'extra' nameisversion specN(i(ii(titerR6RRRRptDISTRORR
RRRRRtOBRACKETtCBRACKETtVERSIONtLINE_ENDRRtoptvalR3R)(RRRRRRRpRRRRR((RRR0s$ ($3cCslg}|D]}||i|fq~}|ig}|D]\}}||q?~|ddd<dS(Ni(RRRRttmpRthcRR(RRRRRRR((RR
	s*
cBsStZdZdZdZdZdZdZdZe	eZRS(NcCs5|t||_}||i|_|_g}|D])\}
}|t
|t|
|
|fq:~}|i
g}|D]\}}	}
}||
|fq~|_|ttt||_|_|itg}|D]\}}	}
}||
|fq~t|if|_t|i|_dS(s>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!N(RR2RStunsafe_nameRRrRRRRR1t
state_machineRRtparsedttransRRRR8RtImmutableSetthashCmpRt_Requirement__hash(RSRRRRRRRRRR((RR#	s=
6"QcCsqdig}|iD]}|di|q~}di|i}|od|}nd|i||fS(NRRs[%s]s%s%s%s(R
RRSRRRR(RSRRRR((RR1	s
6cCs t|to|i|ijS(N(R_RR)RSR(RSR((Rt__eq__7	scCst|to6|i|ijotSn|io
|i}qfn!t|tot	|}nd}x|iD]\}}}}|t||}|djotSqv|djotSqv|djo
t}qv|djp
|djo
t}qvqvW|djo
t}n|S(NtFtTt+R(R_RR(RrRSRRRRR1RRORRRRRtactionR(RSRRRORRRR((RR:	s,







cCs|iS(N(RSR(RS((RRK	scCsdt|S(NsRequirement.parse(%r)(RbRS(RS((RRXN	scCs^tt|}|o2t|djo|dSntd|ntd|dS(NiisExpected only one requirementsNo requirements found(RR0RRR(R
(RR((RRQ	s(
RURYRRRRRRXRtstaticmethod(((RR)"	s							t<s--Ts<=sT-Tt>sF+Fs>=sT+Fs==sT..s!=sF++cCs?t|tp(d|tfdY}|idSn|iS(s&Get an mro for a type or classic classRcBstZRS(N(RURY(((RRi	siN(R_Rttypetobjectt__mro__(R((Rt_get_mrof	s
cCsFx?tt|dt|D]}||jo||SqqWdS(s2Return an adapter factory for `ob` from `registry`RTN(R$RgtobR!RQtregistry(R&R%RQ((RRim	s

cCs:tii|}tii|pti|ndS(s1Ensure that the parent directory of `path` existsN(RkRRR6tmakedirs(RR((RR:t	sccsd}g}xt|D]}|ido\|ido9|p|o||fVn|dd!i}g}qt	d|q|i
|qW||fVdS(srSplit 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``.
    Rt]iisInvalid section headingN(RtsectiontcontentR6RRpRR3RuR
Rt(RR)R*Rp((RR7z	s

cOsAdkl}ti}ztt_|||SWd|t_XdS(N(smkstemp(ttempfiletmkstempRkR9told_opentos_openRWR(RWRR-R,((RR]	s
		cCsBx;ttD]-}|idptt|||<q
q
WdS(NR}(RMt_managerRRRgR(RR((Rt_initialize	s
(s__requires__cCs
|iS(N(RR(R((RR<	s(RZRRkR=RURRpRtsetsRRaRbRdR9R.Rt__all__t	ExceptionR+R,R-R.R\RRR<R=R>R?R@RNRRR{RR)RRR4R5RRQRRRRRRARBR"R&R%RRRR/R'R$R2R3R8R9RHRIRJR!RFRGRKRRCRDRERmRuRPtpkgutiltImpImporterRtR}RLRR!RRRRRRRMRRRORRR;RRR6RR
RR	RRR
RRtVERBOSEt
IGNORECASERRRyRRR1R*R(RR0RR)RR$RiR:R7R]R/R0RRt__main__t__requires__RRRRRRRRRRR R(uRGRR/R8R=RRmR R>RR=RRR?RRaRHRJR'RCRR5RRRR
R}RFR2RRRRIRROR	RRR7R5RLRR(RRRR{RQR9RR:RRRkRDR2RR%RBRNRpR!R&RRRR9R+R4R0RR6R)RiR0R;RR.R.RR]R-RbRR\RPRuRERRMR<RRRR
RKRRRR$R1RRdR@RR$R3RR/R,RRRARR*RURR((Rt?s"?

	)
						3				)) 	)		
			\
	)		
		
#
			
	
	
				6		){&	#	=	9<