o _a2@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 @/usr/lib/python3/dist-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) Nrhtmlbuilddocsrzpypi.python.orgzs"