zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
U
G=®d’ã@s°dZddlmZddlmZddlmZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd    d
lmZd d „ZGd d„deƒZdS)zpupload_docs
 
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
é)Ústandard_b64encode)Úlog)ÚDistutilsOptionErrorN)Úsix)Ú http_clientÚurllib)Úiter_entry_pointsé)ÚuploadcCstjr
dnd}| d|¡S)NÚstrictÚsurrogateescapezutf-8)rÚPY2Úencode)ÚsÚerrors©rúUD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/command/upload_docs.pyÚ_encodesrc@s‚eZdZdZdZdddejfddgZejZdd    „Zd
efgZ    d d „Z
d d„Z dd„Z dd„Z edd„ƒZedd„ƒZdd„ZdS)Ú upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIz repository=Úrzurl of repository [default: %s])z show-responseNz&display full response text from server)z upload-dir=Nzdirectory to uploadcCs"|jdkrtddƒD]}dSdS)Nzdistutils.commandsÚ build_sphinxT)Ú
upload_dirr)ÚselfÚeprrrÚ
has_sphinx/s
zupload_docs.has_sphinxrcCst |¡d|_d|_dS)N)r
Úinitialize_optionsrÚ
target_dir)rrrrr6s
zupload_docs.initialize_optionscCsˆt |¡|jdkrN| ¡r0| d¡}|j|_q`| d¡}tj     |j
d¡|_n|  d¡|j|_d|j krtt  d¡| d|j¡dS)NrÚbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r
Úfinalize_optionsrrÚget_finalized_commandZbuilder_target_dirrÚosÚpathÚjoinÚ
build_baseÚensure_dirnameÚ
repositoryrÚwarnÚannounce)rrrrrrr;s
 
 
 
 
 
 
 
zupload_docs.finalize_optionsc Cs²t |d¡}z–| |j¡t |j¡D]x\}}}||jkrP|sPd}t||jƒ‚|D]H}tj     ||¡}|t
|jƒd…  tjj ¡}    tj     |    |¡}
|  ||
¡qTq&W5| ¡XdS)NÚwz'no files found in upload directory '%s')ÚzipfileÚZipFileÚcloseÚmkpathrr Úwalkrr!r"ÚlenÚlstripÚsepÚwrite) rÚfilenameÚzip_fileÚrootÚdirsÚfilesÚtmplÚnameÚfullÚrelativeÚdestrrrÚcreate_zipfileKs  zupload_docs.create_zipfilec    Csh| ¡D]}| |¡qt ¡}|jj ¡}tj     |d|¡}z|  |¡|  |¡W5t
  |¡XdS)Nz%s.zip)Úget_sub_commandsÚ run_commandÚtempfileÚmkdtempÚ distributionÚmetadataÚget_namer r!r"ÚshutilÚrmtreer<Ú upload_file)rÚcmd_nameZtmp_dirr8r3rrrÚrun[s   
zupload_docs.runccs|\}}d|}t|tƒs |g}|D]f}t|tƒrL|d|d7}|d}nt|ƒ}|Vt|ƒVdV|V|r$|dd…dkr$dVq$dS)    Nz*
Content-Disposition: form-data; name="%s"z; filename="%s"rr    s
 
éÿÿÿÿó ó
)Ú
isinstanceÚlistÚtupler)ÚitemÚ sep_boundaryÚkeyÚvaluesÚtitleÚvaluerrrÚ _build_partis
 
 
 
zupload_docs._build_partc Csnd}d| d¡}|d}|df}tj|j|d}t|| ¡ƒ}tj |¡}t ||¡}    d|}
d     |    ¡|
fS)    z=
        Build up the MIME payload for the POST data
        z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--Úasciis--rK)rPz multipart/form-data; boundary=%só)
rÚ    functoolsÚpartialrUÚmapÚitemsÚ    itertoolsÚchainÚ from_iterabler") ÚclsÚdataÚboundaryrPZ end_boundaryZ    end_itemsZbuilderZ part_groupsÚpartsZ
body_itemsÚ content_typerrrÚ_build_multipart}sþ  zupload_docs._build_multipartc
CsJt|dƒ}| ¡}W5QRX|jj}d| ¡tj |¡|fdœ}t|j    d|j
ƒ}t |ƒ}t j sn| d¡}d|}| |¡\}}    d|j}
| |
tj¡tj |j¡\} } } }}}|sÂ|sÂ|rÆt‚| dkrÚt | ¡}n | d    krît | ¡}n td
| ƒ‚d }zZ| ¡| d | ¡|    }| d |¡| dtt|ƒƒ¡| d|¡|  ¡| !|¡Wn>t"j#k
r–}z| t|ƒtj$¡WY¢dSd}~XYnX| %¡}|j&dkrÌd|j&|j'f}
| |
tj¡nb|j&dkr| (d¡}|dkrød| ¡}d|}
| |
tj¡nd|j&|j'f}
| |
tj$¡|j)rFt*d| ¡dƒdS)NÚrbZ
doc_upload)z:actionr8Úcontentú:rVzBasic zSubmitting documentation to %sÚhttpÚhttpszunsupported schema ÚÚPOSTz Content-typezContent-lengthÚ AuthorizationéÈzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %szK---------------------------------------------------------------------------)+ÚopenÚreadrArBrCr r!ÚbasenamerÚusernameÚpasswordrrr Údecoderdr%r'rÚINFOrÚparseÚurlparseÚAssertionErrorrÚHTTPConnectionÚHTTPSConnectionÚconnectÚ
putrequestÚ    putheaderÚstrr.Ú
endheadersÚsendÚsocketÚerrorÚERRORÚ getresponseÚstatusÚreasonÚ    getheaderÚ show_responseÚprint)rr2ÚfrfÚmetar`Ú credentialsÚauthÚbodyÚctÚmsgZschemaÚnetlocÚurlÚparamsÚqueryÚ    fragmentsÚconnrcÚerÚlocationrrrrFsd ý
 
 ÿ        
 
 zupload_docs.upload_fileN)Ú__name__Ú
__module__Ú __qualname__ÚDEFAULT_REPOSITORYÚ descriptionr
Ú user_optionsÚboolean_optionsrÚ sub_commandsrrr<rHÚ staticmethodrUÚ classmethodrdrFrrrrrs(ÿû
 
 
r)Ú__doc__Úbase64rÚ    distutilsrÚdistutils.errorsrr r€r)r?rDr\rXZsetuptools.externrZsetuptools.extern.six.movesrrÚ pkg_resourcesrr
rrrrrrÚ<module>s