o ~Re2@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZddlmZd d ZGd d 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)iter_entry_points)uploadcCs |ddS)Nzutf-8surrogateescape)encode)sr /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/upload_docs.py_encodes r c@seZdZdZdZdddejfddgZejZdd Zd efgZ d d Z d dZ ddZ ddZ eddZeddZddZdS) 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 uploadcCs&|jdurtddD]}dSdSdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfepr r r has_sphinx-s zupload_docs.has_sphinxrcCst|d|_d|_dS)N)rinitialize_optionsr target_dir)rr r r r4s  zupload_docs.initialize_optionscCst||jdur+|r|d}t|jd|_n|d}tj |j d|_n | d|j|_d|j vr>td|d|jdS) NrhtmlbuildZdocsrzpypi.python.orgzrrbasenamer usernamepasswordrdecoder`r!r#rINFOurllibparseurlparserdclientHTTPConnectionHTTPSConnectionAssertionErrorconnect putrequest putheaderstrr) endheaderssendsocketerrorERROR getresponsestatusreason getheader show_responseprint)rr.frbmetar\ credentialsauthbodyctmsgZschemanetlocurlparamsquery fragmentsconnr_erlocationr r r r?sh            zupload_docs.upload_fileN)__name__ __module__ __qualname__DEFAULT_REPOSITORY descriptionr user_optionsboolean_optionsr sub_commandsrrr7rD staticmethodrQ classmethodr`r?r r r r rs*    r)__doc__base64r distutilsrdistutils.errorsrrr~r%r:r@rXrT http.clientrd urllib.parserq pkg_resourcesrrr rr r r r s"