Hacked By AnonymousFox

Current Path : /opt/alt/python38/lib64/python3.8/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/distutils/command/__pycache__/upload.cpython-38.pyc

U

i�fY�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZdd	lmZGd
d�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�=/opt/alt/python38/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc Cs�t|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}d|d<|j�rpt|dd
��"}tj�|�d|�	�f|d<W5QRX|j!d|j"�#d�}dt$|��%d�}d}d|�#d�}|d}t&�'�}|�(�D]�\}}d|}t)|t*��s�|g}|D]j}t+|�t,k�r|d|d7}|d}nt-|��#d�}|�.|�|�.|�#d��|�.d�|�.|��q�q�|�.|�|�/�}d||jf}|�0|t1j2�d |t-t3|��|d!�}t4|j||d"�}zt5|�}|�6�}|j7}Wnft8k
�r�}z|j9}|j7}W5d}~XYn8t:k
�r.}z|�0t-|�t1j;��W5d}~XYnX|d#k�r�|�0d$||ft1j2�|j<�r�|�=|�}d%�>d&|d&f�}|�0|t1j2�n"d'||f}|�0|t1j;�t?|��dS)(NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
md5_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"r�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)@rr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZmd5Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesrr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalueZannouncer�INFO�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr) rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar1Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titlerr2Zrequest�resultZstatus�reason�e�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)�__doc__r9r?r-r<�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox