o _ad@sddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl m Z ddl mZddl Z Gdddeje ZGd d d ZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN) easy_install) namespacesc@sveZdZdZdZejddgZejdgZdZddZ d d Z d d Z e d dZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode') uninstalluzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer FcCs2|jrd|_||n||dS)NT)r multi_versionuninstall_linkuninstall_namespacesinstall_for_developmentwarn_deprecated_optionsselfrsz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r'r(existsr+rrJr,rLcloserrwarnrKunlink update_pthr2 distributionscripts)r egg_link_filecontentsrrrr s    zdevelop.uninstall_linkc Cs||jur t||S|||jjpgD]1}tjt |}tj |}t | }| }Wdn1s:wY|||||qdSN)r2rinstall_egg_scriptsinstall_wrapper_scriptsrYrZr'r(r-rbasenameiorLreadinstall_script)rr2 script_name script_pathstrm script_textrrrr^s      zdevelop.install_egg_scriptscCst|}t||Sr])VersionlessRequirementrr_rr2rrrr_s zdevelop.install_wrapper_scriptsN)__name__ __module__ __qualname____doc__ descriptionr user_optionsboolean_optionscommand_consumes_argumentsrrr! staticmethodr3rr r^r_rrrrrs$  +  rc@s(eZdZdZddZddZddZdS) rha Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> 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 ||_dSr])_VersionlessRequirement__distrirrr__init__s zVersionlessRequirement.__init__cCs t|j|Sr])getattrrs)rnamerrr __getattr__s z"VersionlessRequirement.__getattr__cCs|jSr]rrrrras_requirementsz%VersionlessRequirement.as_requirementN)rjrkrlrmrtrwrxrrrrrhs  rh)distutils.utilr distutilsrdistutils.errorsrrr'r&rar.setuptools.command.easy_installrrGrDevelopInstallerrrhrrrrs