a (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-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/upload_docs.py_encodesr 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]}dSdS)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||jdurV|r8|d}t|jd|_qh|d}tj |j d|_n| d|j|_d|j vr|td|d|jdS) NrhtmlbuildZdocsrzpypi.python.orgzr?rrbasenamer usernamepasswordrdecoderar!r#rINFOurllibparseurlparsereclientHTTPConnectionHTTPSConnectionAssertionErrorconnect putrequest putheaderstrr) endheaderssendsocketerrorERROR getresponsestatusreason getheader show_responseprint)rr.frcmetar] credentialsauthbodyctmsgZschemanetlocurlparamsquery fragmentsconnr`erlocationr r r r@s` &           zupload_docs.upload_fileN)__name__ __module__ __qualname__DEFAULT_REPOSITORY descriptionr user_optionsboolean_optionsr sub_commandsrrr8rE staticmethodrR classmethodrar@r r r r rs(   r)__doc__base64r distutilsrdistutils.errorsrrrr%r;rArYrU http.clientre urllib.parserr pkg_resourcesrrr rr r r r s