efJdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlmZddlmZd d lmZd ZGd d eZdS)z|upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to sites other than PyPi such as devpi). )standard_b64encode)log)DistutilsOptionErrorN)metadata)SetuptoolsDeprecationWarning)uploadc.|ddS)Nzutf-8surrogateescape)encode)ss ~/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/command/upload_docs.py_encoders 88G. / //ceZdZdZdZdddejzfddgZejZdZd efgZ d Z d Z d Z d Z edZedZdZdS) upload_docszhttps://pypi.python.org/pypi/z;Upload documentation to sites other than PyPi such as devpiz repository=rzurl of repository [default: %s])z show-responseNz&display full response text from server)z upload-dir=Nzdirectory to uploadcZt|jduotjddS)Nzdistutils.commands build_sphinx)groupname)bool upload_dirr entry_pointsselfs r has_sphinxzupload_docs.has_sphinx/s8 Ot # W%,@~VVV   rrcJtj|d|_d|_dS)N)r initialize_optionsr target_dirrs rr zupload_docs.initialize_options7s%!$'''rctjdtj||j|r5|d}t|jd|_ na|d}tj |j d|_ n!|d|j|_ |d|j zdS)NzWUpload_docs command is deprecated. Use Read the Docs (https://readthedocs.org) instead.rhtmlbuilddocsrzUsing upload directory %s)rwarnr finalize_optionsrrget_finalized_commanddictbuilder_target_dirsr!ospathjoin build_baseensure_dirnameannounce)rrr$s rr'zupload_docs.finalize_options<s  1    %%% ? "   I#99.II "&|'G"H"H"P227;;"$',,u/?"H"H    - - -"oDO 1DOCDDDDDrctj|d} ||jt j|jD]\}}}||jkr|sd}t ||jz|D]}tj||}|t|jd tjj } tj| |} | ||  | dS#| wxYw)Nwz'no files found in upload directory '%s')zipfileZipFilemkpathr!r+walkrr,r-lenlstripsepwriteclose) rfilenamezip_filerootdirsfilestmplrfullrelativedests rcreate_zipfilezupload_docs.create_zipfileNs.?8S11  KK ( ( (%'WT_%=%= / /!dE4?**5*DD.tdo/EFFF!//D7<<d33D#C$8$8$:$:;BB27;OOH7<<$77DNN4.... /  / NN     HNN    s C9D''D=ctjddd|D]}||t j}|jj}tj |d|z} | || |tj|dS#tj|wxYw)NzDeprecated commanda upload_docs is deprecated and will be removed in a future version. Instead, use tools like devpi and Read the Docs; or lower level tools like httpie and curl to interact directly with your hosting service API. )i )due_datez%s.zip)remitget_sub_commands run_commandtempfilemkdtemp distributionrget_namer+r,r-rE upload_fileshutilrmtree)rcmd_nametmp_dirrr=s rrunzupload_docs.run^s$)   #    --// ' 'H   X & & & &"$$ )22447<<D99 #    ) ) )   X & & & M' " " " " "FM' " " " "s *CC/c#0K|\}}d|z}t|ts|g}|D]n}t|tr|d|dzz }|d}nt|}|Vt|VdV|V|r|dddkrdVodS) Nz* Content-Disposition: form-data; name="%s"z; filename="%s"rr s   ) isinstancelisttupler)item sep_boundarykeyvaluestitlevalues r _build_partzupload_docs._build_partvs V=C&$'' XF  E%'' '*U1X55a   %.. MMMKKK rssu,,   rcbd}d|dz}|dz}|df}tj|j|}t ||}t j|}t j||} d|z} d | | fS) z= Build up the MIME payload for the POST data z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --asciis--rZ)r_z multipart/form-data; boundary=%sr) r functoolspartialrdmapitems itertoolschain from_iterabler-) clsdataboundaryr_ end_boundary end_itemsbuilder part_groupsparts body_items content_types r_build_multipartzupload_docs._build_multiparts I!9!99 #e+   # O%   '4::<<00 --k::_UI66 9HD xx ##\11rcHt|d5}|}dddn #1swxYwY|jj}d|t j||fd}t|j dz|j z}t| d}d|z}| |\}} d|jz} || t jt$j|j\} } } }}}|s|s|rJ| dkr t*j| }n8| d kr t*j| }nt3d | zd } ||d | | }|d ||dt;t=||d||| |nE#tB$r8}|t;|t j"Yd}~dSd}~wwxYw|#}|j$dkr3d|j$d|j%} || t jn|j$dkrT|&d}|d|z}d|z} || t jn2d|j$d|j%} || t j"|j'r%tQd|ddSdS)Nrb doc_upload)z:actionrcontent:rfzBasic zSubmitting documentation to %shttphttpszunsupported schema POSTz Content-typezContent-length AuthorizationzServer response (z): i-Locationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (zK---------------------------------------------------------------------------))openreadrOrrPr+r,basenamerusernamepasswordrdecoderx repositoryr0rINFOurllibparseurlparser~clientHTTPConnectionHTTPSConnectionAssertionErrorconnect putrequest putheaderstrr7 endheaderssendOSErrorERROR getresponsestatusreason getheader show_responseprint)rr<fr|metaro credentialsauthbodyctmsgschemanetlocurlparamsquery fragmentsconnrwerlocations rrQzupload_docs.upload_files (D ! ! QffhhG                )#MMOO((22G<   dmc1DMABB (55<< 8 8 8 NN+ST^^ < < < NN?D 1 1 1 OO    IIdOOOO    MM#a&&#) , , , FFFFF       8s???01!((CC MM#sx ( ( ( ( X__{{:..H9DMMOOK/(:C MM#sx ( ( ( ( /0hhhAC MM#sy ) ) )   0 (AFFHHh / / / / / 0 0s%266B1I J-J  JN)__name__ __module__ __qualname__DEFAULT_REPOSITORY descriptionr user_optionsboolean_optionsr sub_commandsr r'rErV staticmethodrd classmethodrxrQrrrrs9OK   -0I I J4L,O   $Z01L EEE$ ###0\&22[2*=0=0=0=0=0rr)__doc__base64r distutilsrdistutils.errorsrr+r3rMrRrkrg http.clientr~ urllib.parser _importlibrwarningsrr rrrrrrs &%%%%%111111  !!!!!!333333000@0@0@0@0@0&@0@0@0@0@0r