Yf" @sdZddlmZddlmZmZddlZddlZddlZGdddeZ ddZ d d Z d d Z dS) zdistutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata.)Command)logdir_utilNc@sUeZdZdZdZdgZddZdd Zd d Zd d Z dS)install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file install-dir=ddirectory to install tocCs d|_dS)N) install_dir)selfr G/opt/alt/python35/lib64/python3.5/distutils/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCs|jdddtt|jjtt|jjtjddf}t j j |j ||_ |j g|_dS)NZ install_libr z%s-%s-py%s.egg-info)r r )Zset_undefined_options to_filename safe_name distributionZget_name safe_versionZ get_versionsysversionospathjoinr targetoutputs)r basenamer r r finalize_optionssz!install_egg_info.finalize_optionsc Cs|j}tjj|rGtjj| rGtj|d|jnmtjj|r||j tj |jfd|n8tjj|j s|j tj |j fd|j t jd||jst|ddd}|jjj|WdQRXdS)Ndry_runz Removing z Creating z Writing %swencodingzUTF-8)rrrisdirislinkrZ remove_treerexistsZexecuteunlinkr makedirsrinfoopenrZmetadataZwrite_pkg_file)r rfr r r run s %# zinstall_egg_info.runcCs|jS)N)r)r r r r get_outputs.szinstall_egg_info.get_outputsN)rrr) __name__ __module__ __qualname____doc__Z descriptionZ user_optionsr rr'r(r r r r r s    rcCstjdd|S)zConvert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. z[^A-Za-z0-9.]+-)resub)namer r r r6srcCs%|jdd}tjdd|S)zConvert 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.  .z[^A-Za-z0-9.]+r-)replacer.r/)rr r r r>srcCs|jddS)z|Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. r-_)r3)r0r r r rHsr) r,Z distutils.cmdrZ distutilsrrrrr.rrrrr r r r s$+