3 \ºã@sDddlZddlmZddlTddlmZdd„ZGdd„deƒZdS) éN)ÚCommand)Ú*)Ú get_platformcCsTddlm}g}x,tjD]"}|jd|dtj|dfƒqW||ƒ}|jdƒdS)Nr)Ú FancyGetoptzformats=éz'List of available distribution formats:)Zdistutils.fancy_getoptrÚbdistÚformat_commandsÚappendÚformat_commandZ print_help)rÚformatsÚformatZpretty_printer©r ú//usr/lib64/python3.6/distutils/command/bdist.pyÚ show_formats s   rc @s–eZdZdZd6dddeƒfd7d8d9d:d;gZdgZdd defgZdd?d@dAdBdCdDdEd/œ Z d0d1„Z d2d3„Zd4d5„Zd S)Frz$create a built (binary) distributionú bdist-base=Úbú4temporary directory for creating built distributionsz plat-name=Úpz;platform name to embed in generated filenames (default: %s)úformats=Nú/formats for distribution (comma-separated list)ú dist-dir=Údú=directory to put final built distributions in [default: dist]ú skip-buildú2skip rebuilding everything (for testing/debugging)úowner=Úuú@Owner name used when creating a tar file [default: current user]úgroup=ÚgúAGroup name used when creating a tar file [default: current group]z help-formatsz$lists available distribution formatsÚ bdist_rpmÚgztarÚzip)ÚposixÚntÚrpmÚbztarÚxztarÚztarÚtarÚwininstÚmsiúRPM distributionÚ bdist_dumbúgzip'ed tar fileúbzip2'ed tar fileúxz'ed tar fileúcompressed tar fileútar fileÚ bdist_wininstúWindows executable installerúZIP fileÚ bdist_msiúMicrosoft Installer) r&r"r'r(r)r*r+r#r,cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)Ú bdist_baseÚ plat_namer Údist_dirÚ skip_buildÚgroupÚowner)Úselfr r rÚinitialize_optionsQszbdist.initialize_optionsc Cs´|jdkr(|jrtƒ|_n|jdƒj|_|jdkrT|jdƒj}tjj|d|jƒ|_|j dƒ|j dkr y|j tj g|_ Wn"t k ržtdtj ƒ‚YnX|jdkr°d|_dS)NZbuildzbdist.r z;don't know how to create built distributions on platform %sZdist)r:r<rZget_finalized_commandr9Ú build_baseÚosÚpathÚjoinZensure_string_listr Údefault_formatÚnameÚKeyErrorZDistutilsPlatformErrorr;)r?rAr r rÚfinalize_optionsZs$       zbdist.finalize_optionsc CsÎg}xH|jD]>}y|j|j|dƒWq tk rHtd|ƒ‚Yq Xq Wxztt|jƒƒD]h}||}|j|ƒ}||jkrŠ|j||_ |dkr¢|j |_ |j |_ |||dd…kr¼d|_ |j |ƒq^WdS)Nrzinvalid format '%s'r.r)r r r rGZDistutilsOptionErrorÚrangeÚlenZreinitialize_commandÚno_format_optionr r>r=Z keep_tempZ run_command)r?Zcommandsr ÚiZcmd_nameZsub_cmdr r rÚrunvs"    z bdist.run)rrr)rNr)rrr)rNr)rrr)rrr )r!)r!r-)r.r/)r.r0)r.r1)r.r2)r.r3)r4r5)r.r6)r7r8)Ú__name__Ú __module__Ú __qualname__Z descriptionrZ user_optionsZboolean_optionsrZ help_optionsrKrErr r@rHrMr r r rrsJ    r)rBZdistutils.corerZdistutils.errorsZdistutils.utilrrrr r r rÚs