Hacked By AnonymousFox

Current Path : /proc/thread-self/root/proc/self/root/opt/alt/python37/lib64/python3.7/distutils/command/__pycache__/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/opt/alt/python37/lib64/python3.7/distutils/command/__pycache__/upload.cpython-37.pyc

B

� f]�@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/python37/lib64/python3.7/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|��x$|jjD]\}}}|�|||�qWdS)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|��}Wd|�	�X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}d}|dk�rZt!�"�\}}}|�rtd||f}n|dk�rtdt!j!dd�}||d<|j�r�tj�|�dt|dd
���f|d<|j#d|j$�%d�}dt&|��'d�}d}d|�%d�}|d}t(�)�}x�|�*�D]�\}}d|}t+|t,��s |g}xr|D]j}t-|�t.k�rR|d |d!7}|d}nt/|��%d"�}|�0|�|�0|�%d"��|�0d#�|�0|��q&W�q�W|�0|�|�1�}d$||jf}|�2|t3j4�d%|t/t5|��|d&�}t6|j||d'�}yt7|�}|�8�} |j9}!Wnft:k
�r:}"z|"j;} |"j9}!Wdd}"~"XYn8t<k
�rp}"z|�2t/|"�t3j=��Wdd}"~"XYnX| d(k�r�|�2d)| |!ft3j4�|j>�r�|�?|�}#d*�@d+|#d+f�}|�2|t3j4�n"d,| |!f}|�2|t3j=�tA|��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	obsoletesrZ	bdist_rpmzbuilt for %s %sZ
bdist_dumbzbuilt for %s�)Zterse�commentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-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)Brr�AssertionErrorr
rr
r$�open�read�closerZmetadataZget_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_obsoletesr-�distrr�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)�metar2r/r>r(�idZ	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titlerr3Zrequest�resultZstatus�reason�e�textrrrrBs�













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

Hacked By AnonymousFox1.0, Coded By AnonymousFox