ó N3{Yc@sþdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZddlmZddlmZmZmZmZmZerÒd nd Zd d „Zd efd„ƒYZdS(spupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). iÿÿÿÿN(tstandard_b64encode(titer_entry_points(tlog(tDistutilsOptionError(tupload(thttplibturlparsetunicodet iteritemstPY3tsurrogateescapetstrictsutf-8cCs#t|tƒr|j|tƒS|S(N(t isinstanceRtencodeterrors(tstencoding((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pytbst upload_docscBs{eZdZdddejfddgZejZd„Zd efgZ d „Z d „Z d „Z d „Z d„ZRS(sUpload documentation to PyPIs repository=trsurl of repository [default: %s]s show-responses&display full response text from servers upload-dir=sdirectory to uploadcCs1|jdkr-xtddƒD]}tSWndS(Nsdistutils.commandst build_sphinx(t upload_dirtNoneRtTrue(tselftep((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyt has_sphinx0sRcCs#tj|ƒd|_d|_dS(N(Rtinitialize_optionsRRt target_dir(R((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyR7s  cCs¤tj|ƒ|jdkrs|jƒrF|jdƒ}|j|_qŒ|jdƒ}tj j |j dƒ|_n|j dƒ|j|_|j d|jƒdS(NRtbuildtdocsRsUsing upload directory %s(Rtfinalize_optionsRRRtget_finalized_commandtbuilder_target_dirRtostpathtjoint build_basetensure_dirnametannounce(RRR((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyR<s    c Cs÷tj|dƒ}zÓ|j|jƒx¼tj|jƒD]¨\}}}||jkrs| rstd|jƒ‚nxj|D]b}tjj||ƒ}|t |jƒj tjj ƒ}tjj||ƒ} |j || ƒqzWq8WWd|j ƒXdS(Ntws'no files found in upload directory '%s'(tzipfiletZipFiletmkpathRR"twalkRR#R$tlentlstriptseptwritetclose( Rtfilenametzip_filetroottdirstfilestnametfulltrelativetdest((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pytcreate_zipfileJs" "cCsŽx!|jƒD]}|j|ƒq Wtjƒ}|jjjƒ}tjj |d|ƒ}z|j |ƒ|j |ƒWdt j |ƒXdS(Ns%s.zip(tget_sub_commandst run_commandttempfiletmkdtempt distributiontmetadatatget_nameR"R#R$R;t upload_filetshutiltrmtree(Rtcmd_namettmp_dirR7R3((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pytrun[s  cCsEt|dƒ}|jƒ}|jƒ|jj}idd6|jƒd6tjj|ƒ|fd6}t |j d|j ƒ}t |ƒ}t r¢|jdƒ}nd|}d }t d ƒt |ƒ} | t d ƒ} g} xÿt|ƒD]ñ\} } d | }t| tƒr| g} nx½| D]µ}t|ƒtkrZ|d |d7}|d}n t |ƒ}| j| ƒ| jt |ƒƒ| jt dƒƒ| j|ƒ|r#|dt dƒkr#| jt dƒƒq#q#WqëW| j| ƒ| jt dƒƒt dƒj| ƒ} |jd|jtjƒt|jƒ\}}}}}}|dkrntj|ƒ}n.|dkrŒtj|ƒ}ntd|ƒ‚d}y{|jƒ|j d|ƒd|}|j!d|ƒ|j!dt"t#| ƒƒƒ|j!d|ƒ|j$ƒ|j%| ƒWn>t&j'k r]t(j)ƒd}|jt"|ƒtj*ƒdSX|j+ƒ}|j,dkrŸ|jd|j,|j-ftjƒnz|j,d krö|j.d!ƒ}|dkrÜd"|jƒ}n|jd#|tjƒn#|jd$|j,|j-ftj*ƒ|j0rAd%d&|jƒd%d&fGHndS('Ntrbt doc_uploads:actionR7tcontentt:tasciisBasic s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--s* Content-Disposition: form-data; name="%s"s; filename="%s"iis iÿÿÿÿs s tsSubmitting documentation to %sthttpthttpssunsupported schema tPOSTs multipart/form-data; boundary=%ss Content-typesContent-lengtht AuthorizationiÈsServer response (%s): %si-tLocationshttps://pythonhosted.org/%s/sUpload successful. Visit %ssUpload failed (%s): %st-iK(1topentreadR1R@RARBR"R#tbasenameRtusernametpasswordRR tdecodeRR tlistttypettupletappendR$R't repositoryRtINFORRtHTTPConnectiontHTTPSConnectiontAssertionErrortconnectt putrequestt putheadertstrR-t endheaderstsendtsocketterrortsystexc_infotERRORt getresponsetstatustreasont getheaderRt show_response(RR2tfRKtmetatdatat credentialstauthtboundaryt sep_boundaryt end_boundarytbodytkeytvaluesttitletvaluetschematnetlocturltparamstqueryt fragmentstconnt content_typeteRtlocation((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyRCisŽ               !            N(s show-responseNs&display full response text from server(s upload-dir=Nsdirectory to upload(t__name__t __module__t descriptionRtDEFAULT_REPOSITORYRt user_optionstboolean_optionsRt sub_commandsRRR;RHRC(((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyR#s        (t__doc__R"RjR)R>RlRDtbase64Rt pkg_resourcesRt distutilsRtdistutils.errorsRtdistutils.command.uploadRtsetuptools.compatRRRRR RRR(((sO/opt/alt/python34/lib/python3.4/site-packages/setuptools/command/upload_docs.pyts      (