a –Î `mã@sŽddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl m Z ddl mZddl Z Gdd„deje ƒZGd d „d ƒZdS) é)Ú convert_path)Úlog)ÚDistutilsErrorÚDistutilsOptionErrorN)Ú easy_install)Ú namespacesc@sveZdZdZdZejddgZejdgZdZdd„Z d d „Z d d „Z e d d„ƒZ dd„Zdd„Zdd„Zdd„ZdS)ÚdevelopzSet up package for developmentz%install package in 'development mode')Ú uninstallÚuzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer FcCs2|jrd|_| ¡| ¡n| ¡| ¡dS)NT)r Z multi_versionÚuninstall_linkZuninstall_namespacesÚinstall_for_developmentZwarn_deprecated_options©Úself©rúóz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)rrÚexistsr!rr8r"r:ÚcloserrÚwarnr9ÚunlinkZ update_pthr'r5Úscripts)rZ egg_link_fileÚcontentsrrrr ™s   ÿ   zdevelop.uninstall_linkc Cs”||jurt ||¡S| |¡|jjp*gD]b}tj t |ƒ¡}tj  |¡}t   |¡}|  ¡}Wdƒn1st0Y| ||||¡q,dS©N)r'rÚinstall_egg_scriptsÚinstall_wrapper_scriptsr5rErrr#rÚbasenameÚior:ÚreadZinstall_script)rr'Ú script_nameZ script_pathZstrmZ script_textrrrrH«s     &zdevelop.install_egg_scriptscCst|ƒ}t ||¡SrG)ÚVersionlessRequirementrrI©rr'rrrrI½szdevelop.install_wrapper_scriptsN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Z descriptionrZ user_optionsZboolean_optionsZcommand_consumes_argumentsrrrÚ staticmethodr(r r rHrIrrrrrs"þ  * /rc@s(eZdZdZdd„Zdd„Zdd„ZdS) rNa© 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 ||_dSrG)Ú_VersionlessRequirement__distrOrrrÚ__init__ÑszVersionlessRequirement.__init__cCs t|j|ƒSrG)r4rU)rÚnamerrrÚ __getattr__Ôsz"VersionlessRequirement.__getattr__cCs|jSrGrr rrrÚas_requirement×sz%VersionlessRequirement.as_requirementN)rPrQrRrSrVrXrYrrrrrNÂsrN)Zdistutils.utilrZ distutilsrZdistutils.errorsrrrrrKr$Zsetuptools.command.easy_installrr7rZDevelopInstallerrrNrrrrÚs    5