ó Àfc@sèddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl m Z mZmZddlmZddlmZddlZd ejefd „ƒYZd efd „ƒYZdS( iÿÿÿÿ(t convert_path(tlog(tDistutilsErrortDistutilsOptionErrorN(tsix(t Distributiont PathMetadatatnormalize_path(t easy_install(t namespacestdevelopcBs‹eZdZdZejddgZejdgZeZ d„Z d„Z d „Z e d „ƒZd „Zd „Zd „Zd„ZRS(sSet up package for developments%install package in 'development mode't uninstalltusUninstall this source packages egg-path=s-Set the path to be used in the .egg-link filecCsA|jr)t|_|jƒ|jƒn |jƒ|jƒdS(N(R tTruet multi_versiontuninstall_linktuninstall_namespacestinstall_for_developmenttwarn_deprecated_options(tself((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytruns      cCs5d|_d|_tj|ƒd|_d|_dS(Nt.(tNoneR tegg_pathRtinitialize_optionst setup_pathtalways_copy_from(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR's     cCs‘|jdƒ}|jrCd}|j|jf}t||ƒ‚n|jg|_tj|ƒ|jƒ|j ƒ|j j t j dƒƒ|jd}t jj|j|ƒ|_|j|_|jdkrêt jj|jƒ|_nt|jƒ}tt jj|j|jƒƒ}||kr9td|ƒ‚nt|t|t jj|jƒƒd|jƒ|_|j|j|j|jƒ|_dS(Ntegg_infos-Please rename %r to %r before using 'develop's*.eggs .egg-linksA--egg-path must be a relative path from the install directory to t project_name(tget_finalized_commandtbroken_egg_infoRRtegg_nametargsRtfinalize_optionstexpand_basedirst expand_dirst package_indextscantglobtostpathtjoint install_dirtegg_linktegg_baseRRtabspathRRRRtdistt_resolve_setup_pathR(RteittemplateR t egg_link_fnttargetR((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR!.s<        cCsœ|jtjdƒjdƒ}|tjkrGd|jdƒd}nttjj|||ƒƒ}|ttjƒkr˜t d|ttjƒƒ‚n|S(sµ Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. t/s../isGCan't get a consistent path to setup script from installation directory( treplaceR'tseptrstriptcurdirtcountRR(R)R(R,R*Rt path_to_setuptresolved((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR/XscCsºtjrÛt|jdtƒrÛ|jdddƒ|jdƒ|jdƒ}t|j ƒ}|jdd|ƒ|jdƒ|jdddƒ|jdƒ|jdƒ}||_ ||j _ t ||jƒ|j _n-|jdƒ|jdddƒ|jdƒ|jƒtjr7|jtjƒdt_n|jƒtjd |j|jƒ|jsœt|jd ƒ"}|j|j d |jƒWdQXn|jd|j |j ƒdS( Ntuse_2to3tbuild_pytinplaceiRR,t build_extisCreating %s (link to %s)tws ( RtPY3tgetattrt distributiontFalsetreinitialize_commandt run_commandRRt build_libRR.tlocationRRt _providertinstall_site_pyt setuptoolstbootstrap_install_fromRRtinstall_namespacesRtinfoR+R,tdry_runtopentwriteRtprocess_distributiontno_deps(Rtbpy_cmdt build_pathtei_cmdtf((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRks4            $cCsùtjj|jƒr½tjd|j|jƒt|jƒ}g|D]}|jƒ^qD}|j ƒ||j g|j |j gfkržtj d|ƒdS|j s½tj|jƒq½n|j sÙ|j|jƒn|jjrõtj dƒndS(NsRemoving %s (link to %s)s$Link points to %s: uninstall aborteds5Note: you must uninstall or replace scripts manually!(R'R(texistsR+RRNR,RPR7tcloseRRtwarnROtunlinkt update_pthR.RCtscripts(Rt egg_link_filetlinetcontents((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRšs     cCs±||jk rtj||ƒS|j|ƒx~|jjp>gD]j}tjjt |ƒƒ}tjj |ƒ}t j |ƒ}|j ƒ}WdQX|j||||ƒq?WdS(N(R.Rtinstall_egg_scriptstinstall_wrapper_scriptsRCR]R'R(R-RtbasenametioRPtreadtinstall_script(RR.t script_namet script_pathtstrmt script_text((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRa¬s cCst|ƒ}tj||ƒS(N(tVersionlessRequirementRRb(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRb¾s (R R sUninstall this source packageN(s egg-path=Ns-Set the path to be used in the .egg-link file(t__name__t __module__t__doc__t descriptionRt user_optionsRtboolean_optionsRDtcommand_consumes_argumentsRRR!t staticmethodR/RRRaRb(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR s   * /  RkcBs)eZdZd„Zd„Zd„ZRS(sz Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS(N(t_VersionlessRequirement__dist(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt__init__ÑscCst|j|ƒS(N(RBRt(Rtname((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt __getattr__ÔscCs|jS(N(R(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytas_requirement×s(RlRmRnRuRwRx(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRkÃs   (tdistutils.utilRt distutilsRtdistutils.errorsRRR'R&Rdtsetuptools.externRt pkg_resourcesRRRtsetuptools.command.easy_installRRKR tDevelopInstallerR tobjectRk(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyts    ³