ScE@s dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddl mZyddlmZmZWn'ek r=ddlmZmZnXyeWn!ek riddlmZnXy!edZddl m!Z"Wn6ek re#Zddl$m"Z"e%e%d Z&nXdd lm'Z'y&dd lm(Z(m)Z)m*Z*e+Z,Wnek re-Z,nXdd lm.Z/dd l0m1Z1m2Z2ej3ddfko^ej4j5dkrsddl6j7Z8ne%Z8yddl9Z9Wnek rnXddZ:iZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCZDdZEdddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_gEZFd6eGfd`YZHd7eHfdaYZId8eHfdbYZJd9eHfdcYZKiZLejMd ZNdZOddZPdeZQdfZRdZSdgZTdhZUgdiZVdjZWdkZXejYdlZZejYdmZ[eXZ\dnZ]doZ^e^Z_dpZ`dqZae%drZbdsZcdNfdtYZddOedfduYZed1effdvYZgd0effdwYZhehZid:ejfdxYZkd2fdyYZldzZmd{Znd|Zod}Zpd~ZqdeffdYZrerjsZterjuZudUfdYZveTefevdVevfdYZwdWewfdYZxeTeye%exe8e%k rLeTe8jzexndSevfdYZ{e{Z|de}fdYZ~de~fdYZdejfdYZdXewfdYZeTejedPe{fdYZdQexfdYZdRefdYZe<ddidZe-dZe-dZeejee-dZeefee-dZee jee8e%k ree8jene<ddie<ddidZdZdZe%dZdZee jeeejee8e%k r<ee8jendZeefedZidZdZdZejYdjZejYdjZejYdjZejYdjZejYdjZejYdjZejYdjZejYdjZejYdejejBjZejYdejZidd6dd6dd6dd6dd6jZdZdZd5effdYZdZd3effdYZdefdYZied6ed6ed6ZdZdZd4fdYZidd6dd6dd6dd6dd6dd6ZdZdZdZdZdZelZdZeeegjZe<dd*eejZejZejZej^Z^e^Z_edge_eeejejdS(sZ Package 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(t get_importer(turlparset urlunparse(t ImmutableSetcCs |jS(N(tnext(to((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt1s(tStringIO(tBytesIOcBsZ|dkre}n|dkr-|}nee|j|d||fdUdS(Ntexec(tNonetglobalstcompiletopentread(tfntglobstlocs((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytexecfile6s     (tutime(tmkdirtrenametunlink(R (tisdirtsplititcpythonicCs^tstdnt|\}}|rZ|rZt| rZt|t||ndS(Ns*"os.mkdir" not supported on this platform.(t WRITE_SUPPORTtIOErrorRRt_bypass_ensure_directoryR(tnametmodetdirnametfilename((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRTs  cKs-tj|tjtj||dS(N(R tupdatet _state_varstdicttfromkeys(tvartypetkw((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_declare_state`scCsLi}t}x6tjD](\}}|d|||||Distribution doesn't have an "extra feature" of the given name(RRR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRgsiiicCs|t|R?tdarwinVersionStringRRDtFalse(tprovidedtrequiredtreqMactprovMact provDarwintdversiont macosversion((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRns*$"*cCsNtjdj}|d}|j||deZdZdZdZdZdZdZRS(cCsdS(s;Does the package's distribution contain the named metadata?N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt has_metadataqscCsdS(s'The named metadata resource as a stringN((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt get_metadatatscCsdS(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((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytget_metadata_lineswscCsdS(s>Is the named metadata a directory? (like ``os.path.isdir()``)N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytmetadata_isdir}scCsdS(s?List of metadata names in the directory (like ``os.listdir()``)N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytmetadata_listdirscCsdS(s=Execute the named script in the supplied namespace dictionaryN((Rt namespace((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRJs(RRRRRRRRJ(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR|os      cBsDeZdZdZdZdZdZdZdZRS(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((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytget_resource_filenamescCsdS(siReturn a readable file-like object for `resource_name` `manager` must be an ``IResourceManager``N((RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytget_resource_streamscCsdS(smReturn a string containing the contents of `resource_name` `manager` must be an ``IResourceManager``N((RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytget_resource_stringscCsdS(s,Does the package contain the named resource?N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt has_resourcescCsdS(s>Is the named resource a directory? (like ``os.path.isdir()``)N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRVscCsdS(s?List of resource names in the directory (like ``os.listdir()``)N((R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRTs( RRRRRRRRVRT(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR}s     cBseZdZddZedZedZdZdZ dZ ddZ dZ d Z deed Zdded Zdded Zd ZdZdZdZdZRS(sDA collection of active distributions on sys.path (or a similar list)cCs^g|_i|_i|_g|_|dkr<tj}nx|D]}|j|qCWdS(s?Create working set from list of path entries (default=sys.path)N(tentriest entry_keystby_keyt callbacksR R@Rt add_entry(RRtentry((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt__init__s       cCse|}yddlm}Wntk r1|SXy|j|Wntk r`|j|SX|S(s1 Prepare the master working set. i(t __requires__(t__main__RRRIRet_build_from_requirements(tclstwsR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt _build_masters   cCs|g}t|}|j|t}x|D]}|j|q4Wx0tjD]%}||jkrU|j|qUqUW|jtj(|S(sQ Build a working set from a requirement spec. Rewrites sys.path. (RitresolveR^taddR@RRR(Rtreq_specRtreqstdistsRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs    cCsT|jj|g|jj|x*t|tD]}|j||tq3WdS(sAdd 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``.) N(Rt setdefaultRRRZRRR(RRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs cCs|jj|j|kS(s9True if `dist` is the active distribution for its project(RRR5(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt __contains__scCsG|jj|j}|dk r?||kr?t||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(RRR5R Re(RtreqR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs ccsgx`|D]X}|j|}|dkrGx4|jD] }|Vq5Wq||kr||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(RNR tvalues(RRDRRRtep((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRPs    cCsQtjdj}|d}|j||d<|j|dj||dS(s?Locate distribution for `requires` and run `script_name` scriptiRiN(R@RRR4RIRJ(RtrequiresRRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRJs    ccspi}xc|jD]X}||jkr+qnx:|j|D]+}||kr9d||<|j|Vq9q9WqWdS(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(RRR(RtseentitemR5((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt__iter__s  cCs|r|j|j|n|dkr4|j}n|jj|g}|jj|jg}| r~|j|jkr~dS||j|j<|j|kr|j|jn|j|kr|j|jn|j |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, unless `replace=True`. If it's added, any callbacks registered with the ``subscribe()`` method will be called. N( t insert_onRR tlocationRRR5RRt _added_new(RRRtinsertRtkeystkeys2((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR)s   c Cst|ddd}i}i}g}xc|r|jd}||krUq.n|j|j} | dkr?|jj|j} | dks| |kr/|r/|} |dkr| dkrt|j}qtg}tg} n|j || |} ||j<| dkr/t |q/n|j | n| |kr]t | |n|j | j|jdddt||s &cCs@tjdkr<tj|jdBd@}tj||ndS(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. tposiximiN(RRRGRHtchmod(RttempnameR R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt postprocessscCs%|jrtdn||_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(R6RER8(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR[/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((Rtforce((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR\IsN((RRRR R8RRURVRSRRRQRTR=RCt staticmethodR>RRR[RR\(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR`s           cCsytjdSWntk r"nXtjdkrBtjjdSd}dd|fd|fd|fdd|fg}x|D]\}}d }xn|D]5}|tjkrtjj|tj|}qPqW|rtjj||}ntjj|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_CACHERDs~/.python-eggssApplication DatatAPPDATAt USERPROFILEt HOMEDRIVEtHOMEPATHtHOMEtWINDIRRs Python-Eggss3Please set the PYTHON_EGG_CACHE enviroment variableN(sAPPDATA((sAPPDATAN(s USERPROFILE(s HOMEDRIVEsHOMEPATH(sHOMEPATH(sHOME((sHOMEN(sWINDIR( RRFRRRt expanduserR RBt RuntimeError(tapp_datat app_homesRtsubdirRR5((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR]Vs0     cCstjdd|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-(tretsub(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRkscCs%|jdd}tjdd|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. RR<s[^A-Za-z0-9.]+Ra(RRbRc(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRlscCstjdd|jS(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(RbRcR&(textra((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRqscCs|jddS(s|Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. RaR(R(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRrstMarkerEvaluationcBs#eZidd6dd6ejd6dd6ejd6ejd6ejd 6Zed Z e d Z ed Z ed Z edZedZedZeddZedZdekreZnedZedZe dZRS(cCstjS(N(RR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRstos_namecCstjS(N(R@RA(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRst sys_platformtpython_full_versioncCstjd S(Ni(RAtpython_version(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRsRitplatform_versiontplatform_machinetpython_implementationcCs=y|j|Wn%tk r8|jtjdSXtS(s{ Validate text as a PEP 426 environment marker; return an exception if invalid or False otherwise. i(Rtt SyntaxErrortnormalize_exceptionR@RR(Rttext((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytis_invalid_markers  cCsEidd6dd6}d|_d|_|j|j|j|_|S(s 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. sinvalid syntaxsunexpected EOF while parsingsparenthesis is never closedN(R R tlinenoRRN(texctsubs((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRns    cCsKgtdt|dD]}|j||^q}tjtj|S(Nii(trangetlent interprett functoolstreduceR,tand_(RtnodelisttiR)((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytand_tests5cCsKgtdt|dD]}|j||^q}tjtj|S(Nii(RtRuRvRwRxR,tor_(RRzR{R)((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyttests5cCsj|dd}|tjkrT|ddtjkrCtdn|j|dSd}t|dS(NiiisEmpty parenthesess5Language feature not supported in environment markers(ttokentLPARtRPARRmRv(RRzttRN((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytatomscCst|dkr'd}t|n|dd}|d}|dtjkrt|ddkr|dkr}d}qd }qny|j|}Wn-tk rt|d }t|nX||j|d|j|dS( Nis5Chained comparison not allowed in environment markersiiiitnotsnot insis nots, operator not allowed in environment markers(RuRmRtNAMEtget_opRRtevaluate(RRzRNtcomptcop((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt comparisons      cCsi|jtj6|jtj6|jtj6|jtj6dd6dd6tjd6tjd6}ttdr|j|tj sN(tContextualZipFiletnamelistR#(RRR)((Rs7/usr/local/lib/python2.7/site-packages/pkg_resources.pytbuilds  (RRRRRtload(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRstMemoizedZipManifestscBs)eZdZejddZdZRS(s% Memoized zipfile manifests. t manifest_modsmanifest mtimecCsvtjj|}tj|j}||ksC||j|krk|j|}|j||||"os.rename" and "os.unlink" are not supported on this platforms .$extracttdirRD(t_indexRRRRBRRRRRRCRRt _is_currentt_mkstemptwriteRRRRRRRterrortisfileRRR=( RRRRtlastRRt real_pathtoutfttmpnam((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs@$    c Cs|j|j|\}}tjj|s2tStj|}|j|ks_|j|krctS|j j |}t |d}|j }WdQX||kS(sK Return True if the file_path is current for this zip_path RN( RRRRRRRGtst_sizeRRRR R( Rt file_pathRRRRGt zip_contentstft file_contents((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRscCsa|jdkrZg}x6dD].}|j|r|j|j|qqW||_n|jS(Nsnative_libs.txtseager_resources.txt(snative_libs.txtseager_resources.txt(RR RRR(RRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs  cCsy |jSWntk ri}x~|jD]s}|jtj}xX|rtjj|d }||kr||j|dPqF|jg||=?|==|!=)\s*((\w|[-.])+)s\s*,s\s*\[s\s*\]s \w+(\.\w+)*$sL(?P[^-]+)( -(?P[^-]+) (-py(?P[^-]+) (-(?P.+))? )? )?s(\d+ | [a-z]+ | \.| -)tctpretpreviewsfinal-Ratrct@tdevccsuxitj|D]X}t||}| s|dkr>qn|d dkr_|jdVqd|VqWdVdS(NR<it 0123456789it*s*final(t component_reRRtzfill(Rtpart((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_parse_version_parts8s cCsg}xt|jD]}|jdr|dkrdx'|r`|ddkr`|jq=Wnx'|r|ddkr|jqgWn|j|qWt|S(sConvert 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. RGs*finalis*final-t00000000(RKR&RRRttuple(RRRJ((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRjFs cBseZdZd d d dZdZdZed d dZd d dZ e d dZ e d dZ e d dZ RS( s3Object representing an advertised importable objectcCsnt|std|n||_||_t||_tjddj|j |_ ||_ dS(NsInvalid module namesx[%s]t,( tMODULERERt module_nameRMtattrsRbRRBRR(RRRPRQRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRvs   "cCsfd|j|jf}|jr<|ddj|j7}n|jrb|ddj|j7}n|S(Ns%s = %st:R<s [%s]RN(RRPRQRBR(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt__str__s   cCsdt|S(NsEntryPoint.parse(%r)(R(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRscCs|r|j||nt|jttdg}xN|jD]C}yt||}WqDtk rtd||fqDXqDW|S(NRs%r has no %r attribute(RIRRPR RQRRR(RRIRRRtattr((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs  cCsi|jr%|j r%td|n|jj|j}tj|||}tttj|dS(Ns&Can't require() without a distribution( RRRgRRXRRR R(RRRRR)((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRIs c Cs!yd }}|jdd\}}d|krz|jdd\}}tjd|}|jrntn|j}nd|kr|jdd\}}t|jstn|jjd}nWn&tk rd}t||n#X||j|j|||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[RRR<s9EntryPoint must be in 'name=module:attrs [extras]' formatN(( RRbRtspecsRERROR!R ( RtsrcRRQRRRRRN((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRs$         cCst|std|ni}xZt|D]L}|j||}|j|krptd||jn|||j s  % cCsy |jSWntk rigd6}|_xdD]}xt|j|D]\}}|rd|kr|jdd\}}t|rg}qt|sg}qnt|pd}n|j |gj t |qRWq6W|SXdS(Ns requires.txts depends.txtRRi(s requires.txts depends.txt( t_Distribution__dep_mapRR RpRvRRsRtRqRRRi(RtdmRRdRtmarker((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_dep_mapK s    "     'cCs|j}g}|j|jddxS|D]K}y|j|t|Wq/tk rytd||fq/Xq/W|S(s@List of Requirements needed for this distro if `extras` are useds%s has no such extra feature %rN((R|RRR RqRRg(RRRztdepsRi((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR_ s   ccs5|j|r1x|j|D] }|VqWndS(N(RR(RRR%((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRvm scCs~|dkrtj}n|j||tjkrzt|jx6|jdD]"}|tjkrQt|qQqQWndS(s>Ensure distribution is importable on `path` (default=sys.path)snamespace_packages.txtN( R R@RRRRRvRRW(RRtpkg((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytactivater s    cCsOdt|jt|j|jp'tf}|jrK|d|j7}n|S(s@Return what this distribution's standard .egg filename should bes %s-%s-py%sRa(RrRRR#R5RA(RR ((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR} s  cCs(|jrd||jfSt|SdS(Ns%s (%s)(RR(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s cCsMyt|dd}Wntk r/d}nX|p9d}d|j|fS(NRs[unknown version]s%s %s(RR RER(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRS s    cCs.|jdrt|nt|j|S(sADelegate all unrecognized public attributes to .metadata providerR(RRRRc(RRT((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt __getattr__ scKs(|jt|tjj|||S(N(RRRRR(RR R R&((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR scCstjd|j|jfS(s?Return a ``Requirement`` that matches this distribution exactlys%s==%s(RbRRR(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR scCsD|j||}|dkr:td||ffn|jS(s=Return the `name` entry point of `group` or raise ImportErrorsEntry point %r not foundN(ROR RR(RRDRR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRM s cCscy |j}Wn3tk rBtj|jd|}|_nX|dk r_|j|iS|S(s=Return the entry point map for `group`, or the full entry mapsentry_points.txtN(t_ep_mapRRcR^RvR R(RRDtep_map((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRN s    cCs|j|j|S(s<Return the EntryPoint object for `group`+`name`, or ``None``(RNR(RRDR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRO sc Csk|p |j}|sdSt|}tjj|}g|D]}|rVt|pY|^q>}xt|D]w\}}||krPqo||kro|jtkro|tjkr|j n|j |||j ||PqoqoW|tjkr|j n|j |dSxMt rfy|j ||d}Wntk rNPqX||=||=|}qWdS(s@Insert self.location in path before its nearest parent directoryNi(RRRRRt enumerateRRwR@tcheck_version_conflictRRRtindexRE( RRtloctnloctbdirtptnpathRtnp((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s6 +       cCs|jdkrdStj|jd}t|j}x|jdD]}|tjksJ||ksJ|tkr}qJn|dkrqJnt tj|dd}|rt|j |sJ|j |jrqJnt d|||jfqJWdS( Nt setuptoolssnamespace_packages.txts top_level.txtt pkg_resourcestsiteRsIModule %s was already imported from %s, but %s is being added to sys.path(s pkg_resourcess setuptoolsssite( R5R#R$RvRvRR@RR(RR Rt issue_warning(RtnspRtmodnameR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s"  cCs8y |jWn&tk r3tdt|tSXtS(NsUnbuilt egg for (RRERRRR(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR+ s   cKsYd}x0|jD]"}|j|t||dqW|jd|j|j|S(s@Copy this distribution, substituting in any changed keyword argss<project_name version py_version platform location precedenceR N(RRRR RcR(RR&R@RT((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pytclone s  cCs g|jD]}|r |^q S(N(R|(Rtdep((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR sN(((RRRRwR R5RwRRRRR)RlRmRnRoRpRqRrR5RjRR|RRvRRRRSRRRRMRNRORRR+RR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRasJ                    (   tDistInfoDistributioncBsSeZdZdZejdZedZedZ dZ dZ RS(sGWrap an actual or potential sys.path entry w/metadata, .dist-info styletMETADATAs([\(,])\s*(\d.*?)\s*([,\)])cCsTy |jSWnBtk rO|j|j}tjjj||_|jSXdS(sParse and cache metadataN(t _pkg_infoRRRwtemailRtParsertparsestr(RR ((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_parsed_pkg_info s   cCs6y |jSWn$tk r1|j|_|jSXdS(N(t_DistInfoDistribution__dep_mapRt_compute_dependencies(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR| s   cCsy|jdddg}|dj}|dj}tj|jd|}|jddjdd}||fS(sConvert 'Foobar (1); baz' to ('Foobar ==1', 'baz') Split environment marker, add == prefix to version specifiers as necessary, and remove parenthesis. t;iRis\1==\2\3t(t)(RR RbRctEQEQR(Rt requires_distRtdistverstmark((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_preparse_requirement( s c sddlm}igd6}|_gxc|jjdpBgD]I}|j|\}}tt|}|||_ j |qCWfd}t |d}|dj |xR|jjdpgD]8} t | j} tt || ||| |j}n|||fS(Nis+\ must not appear on the last nonblank lines Expected s intatsExpected ',' or end-of-list in(tCONTINUERt StopIterationRERRDtendtCOMMA( tITEMt TERMINATORR%Rtgroupst item_nameR)R?RN(RY(s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt scan_listm s2     sMissing distribution specis 'extra' nameis version specN(i(ii( titerRotDISTRORERDRtOBRACKETtCBRACKETtVERSIONtLINE_ENDRlRb( R>RR%R?RRRRWRR2((RYs7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRid s$$    $+cBsMeZdZdZdZdZdZdZedZ RS(c Cs|t||_}||j|_|_g|D](\}}t|t|||f^q6}|jg|D]\}}}} || f^qu|_|t t t ||_ |_ |jt d|Dt|j f|_t|j|_dS(s>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!css'|]\}}}}||fVqdS(N((RR_ttransRRd((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pys sN(Rkt unsafe_nameR&RR5Rjt state_machineR RWRMR RqRRRthashCmpRkt_Requirement__hash( RRRWRRR-RR_RRd((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s2 ."cCsgdjg|jD]}dj|^q}dj|j}|rSd|}nd|j||fS(NRNRs[%s]s%s%s%s(RBRWRR(RRRWR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRS s . cCst|to|j|jkS(N(RRbR(RR0((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRq sc Cs t|tr=|j|jkr%tS|jr[|j}q[nt|tr[t|}nd}d}x|jD]{\}}}}||||}|dkrtS|dkrt S|dkrt }qt|dks|dkrtt}qtqtW|dkrt }n|S(NcSs||k||kS(N((tatb((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR stFtTt+Ra( RRaR5RRRjRRjR R( RRRtcompareR_RRRdtaction((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s,         cCs|jS(N(R(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRl scCsdt|S(NsRequirement.parse(%r)(R(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR scCsWtt|}|rDt|dkr2|dStd|ntd|dS(NiisExpected only one requirementsNo requirements found(RRiRuRE(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s ( RRRRSRqRRlRRTR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRb s      s--TtsT+Fs>=sT..s==sF++s!=cCs:t|ts3d|tfdY}|jdS|jS(s&Get an mro for a type or classic classRcBseZRS((RR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR si(RRtobjectt__mro__(R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyt_get_mro s cCsAx:tt|dt|D]}||kr||SqWdS(s2Return an adapter factory for `ob` from `registry`RN(RRR(tregistryR6R((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR s% cCs8tjj|}tjj|s4tj|ndS(s1Ensure that the parent directory of `path` existsN(RRRRtmakedirs(RR((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRu sccsd}g}xt|D]y}|jdr|jdrs|sI|rW||fVn|dd!j}g}qtd|q|j|qW||fVdS(ssSplit 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``. RVt]iisInvalid section headingN(R RoRRR RER(RtsectiontcontentR%((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyRp s  cOs7tj}ztt_tj||SWd|t_XdS(N(RR tos_openttempfiletmkstemp(R:R&told_open((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyR( s   cCs@x9ttD]+}|jds tt|||RRmRnRJRRLRMRNROR|R}RR_R^RR]RhR`R]RkRlRqRrReRpRsRtRRRRtSourceFileLoaderRRR#RRRRRRR~RRRRZRRR&t ImpImportert FileFinderRR2RWRR7R8RvRR.RoR?RRRRRRRROtVERBOSEt IGNORECASERhRHRRRKRjRcR`RaRRgRRiRbRRRRuRpRRRR RRXRIRPRRYRRR RR(((s7/usr/local/lib/python2.7/site-packages/pkg_resources.pyts                          '                                 .    h ,    c        )           ,  -j ,?  BJ