ó b-äQc@sðdZddlTddlmZddlmZddlmZyddlm Z Wn!e k rwddl m Z nXddl Z ddl Z ddl Z ddlZddlZddlmZmZmZmZd efd „ƒYZdS( s`distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).iÿÿÿÿ(t*(tCommand(tspawn(tlog(tmd5N(turlparsetStringIOthttplibt ConfigParsertuploadcBsceZdZdZdddefdddgZddgZd „Zd„Zd„Z d„Z RS(supload binary package to PyPIshttps://pypi.python.org/pypis repository=trsurl of repository [default: %s]s show-responses&display full response text from servertsigntsssign files to upload using gpgs identity=tisGPG identity used to sign filescCs:d|_d|_d|_d|_t|_d|_dS(Nti(tusernametpasswordt repositoryt show_responsetFalseR tNonetidentity(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pytinitialize_options&s      cCs&|jr"|j r"tdƒ‚ndtjkr tjjtjddƒ}tjj|ƒr |jd|ƒt j idd6dd6dd6ƒ}|j |ƒ|j sÂ|j d dƒ|_ n|j sã|j d dƒ|_ n|js|j d dƒ|_qq n|j s"|j|_ ndS( Ns.Must use --sign for --identity to have meaningtHOMEs.pypircsUsing PyPI login from %sRRRRs server-login(RR tDistutilsOptionErrortostenvirontpathtjointexiststannounceRtreadRtgetRRtDEFAULT_REPOSITORY(Rtrctconfig((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pytfinalize_options.s(        cCsR|jjstdƒ‚nx0|jjD]"\}}}|j|||ƒq(WdS(Ns'No dist file created in earlier command(t distributiont dist_filesRt upload_file(Rtcommandt pyversiontfilename((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pytrunEs c Cs/|jrSddd|g}|jr=d|jg|dd+nt|d|jƒnt|dƒ}|jƒ}|jƒtjj |ƒ}d}|d krÄ|j j ƒrÄd t j d d ƒ}nid d6dd6|j j ƒd6|j jƒd6||fd6|d6|d6t|ƒjƒd6} |dkrct jƒ\} } } | rˆd| | f}qˆn%|dkrˆdt j d d ƒ}n|| d<|jrÞt|dƒ} tjj |ƒd| jƒf| d<| jƒndtj|jd|jƒjƒ}d }d!|}|d"}tjƒ}xù| jƒD]ë\}}t|ƒtgƒkrh|g}nx¸|D]°}t|ƒtkr¢d#|d$}|d }nd}t|ƒ}|j|ƒ|jd%|ƒ|j|ƒ|jd&ƒ|j|ƒ|ro|d'd(kro|jd)ƒqoqoWq8W|j|ƒ|jd)ƒ|jƒ}|jd*||jft j!ƒt"|jƒ\}}}}}}|d+kr¬t#j$|ƒ}n.|d,krÊt#j%|ƒ}nt&d-|ƒ‚d} t j!}yu|j'ƒ|j(d.|ƒ|j)d/d0|ƒ|j)d1tt*|ƒƒƒ|j)d2|ƒ|j+ƒ|j,|ƒWn>t-j.k ržt/j0ƒd }|jt|ƒt j1ƒdSX|j2ƒ}|j3d3krà|jd4|j3|j4ft j!ƒn#|jd5|j3|j4ft j1ƒ|j5r+d6d7|jƒd6d7fGHndS(8Ntgpgs --detach-signs-as --local-useritdry_runtrbRt bdist_eggs built on %stterseit file_uploads:actiont1tprotocol_versiontnametversiontcontenttfiletypeR*t md5_digestt bdist_rpmsbuilt for %s %st bdist_dumbs built for %stcomments.asct gpg_signaturesBasic t:s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--s;filename="%s"is* Content-Disposition: form-data; name="%s"s iÿÿÿÿs s sSubmitting %s to %sthttpthttpssunsupported schema tPOSTs Content-types multipart/form-data; boundary=%ssContent-lengtht AuthorizationiÈsServer response (%s): %ssUpload failed (%s): %st-iK(6R RRR.topenR tcloseRRtbasenameR&thas_ext_modulestplatformtget_namet get_versionRt hexdigesttdisttbase64t encodestringRRtstripRtitemsttypettupletstrtwritetgetvalueRRRtINFORRtHTTPConnectiontHTTPSConnectiontAssertionErrortconnectt putrequestt putheadertlent endheaderstsendtsocketterrortsystexc_infotERRORt getresponsetstatustreasonR( RR)R*R+tgpg_argstfR7RFR<tdataRLR6tidtasc_filetauthtboundaryt sep_boundaryt end_boundarytbodytkeytvaluetfntschematnetlocturltparamstqueryt fragmentsR?tloglevelteR ((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR(Ks®           & '               !           N(s show-responseNs&display full response text from server(ssignR ssign files to upload using gpg(s identity=R sGPG identity used to sign files( t__name__t __module__t descriptionR"Rt user_optionstboolean_optionsRR%R,R((((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR s      (t__doc__tdistutils.errorstdistutils.coreRtdistutils.spawnRt distutilsRthashlibRt ImportErrorRRbR`RHRMtsetuptools.compatRRRRR (((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyts       "