a oe @shdZddlZddlZddlmZddlmZmZddlm Z ddZ Gd d d e Z Gd d d eZ dS) zidistutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).N)Command)DistutilsPlatformErrorDistutilsOptionError) get_platformcCsPddlm}g}tjD]"}|d|dtj|dfq||}|ddS)zAPrint list of available formats (arguments to "--format" option).r) FancyGetoptformats=Nz'List of available distribution formats:)Z fancy_getoptrbdistformat_commandsappend print_help)rformatsformatZpretty_printerrDC:\Program Files\Certbot\pkgs\setuptools\_distutils\command\bdist.py show_formatss    rc@seZdZddZdS) ListCompatcCstjdtdddS)Nz4format_commands is now a dict. append is deprecated.r) stacklevel)warningswarnDeprecationWarning)selfitemrrrr s zListCompat.appendN)__name__ __module__ __qualname__r rrrrrsrc @seZdZdZddddefdddd d gZd gZd d defgZdZ dddZ e ddddddddZ e Z ddZddZdd Zd S)!r z$create a built (binary) distribution)z bdist-base=bz4temporary directory for creating built distributionsz plat-name=pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z dist-dir=dz=directory to put final built distributions in [default: dist]) skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]r z help-formatsNz$lists available distribution formats) bdist_rpmgztarzip)posixnt)r#zRPM distribution) bdist_dumbzgzip'ed tar file)r(zbzip2'ed tar file)r(zxz'ed tar file)r(zcompressed tar file)r(ztar file)r(zZIP file)Zrpmr$bztarxztarZztartarr%cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_base plat_namerdist_dir skip_buildgroupowner)rrrrinitialize_options^szbdist.initialize_optionscCs|jdur(|jrt|_n|dj|_|jdurT|dj}tj|d|j|_| d|j durz|j tj g|_ Wn t ytdtj Yn0|jdurd|_dS)Nbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r-r/rZget_finalized_commandr, build_baseospathjoinZensure_string_listrdefault_formatnameKeyErrorrr.)rr4rrrfinalize_optionsgs&         zbdist.finalize_optionsc Csg}|jD]<}z||j|dWq tyDtd|Yq 0q tt|jD]h}||}||}||jvr|j||_ |dkr|j |_ |j |_ |||ddvrd|_ | |qVdS)Nrzinvalid format '%s'r(r )rr r r:rrangelenZreinitialize_commandno_format_optionrr1r0Z keep_tempZ run_command)rZcommandsriZcmd_nameZsub_cmdrrrruns"     z bdist.run)rrr descriptionrZ user_optionsZboolean_optionsrZ help_optionsr>r8rr Zformat_commandr2r;r@rrrrr #sB    r )__doc__r5rZcorererrorsrrutilrrdictrr rrrrs