AlkantarClanX12

Your IP : 3.137.190.6


Current Path : /usr/lib64/python3.6/distutils/command/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/distutils/command/__pycache__/upload.cpython-36.pyc

3

��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	�Zd
d�Zdd
�Z	dd�Z
dS)�uploadzupload binary package to PyPI�sign�s�sign files to upload using gpg�	identity=�i�GPG identity used to sign filescCs,tj|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.6/distutils/command/upload.pyr s
zupload.initialize_optionscCsvtj|�|jr |jr td��|j�}|ikrX|d|_|d|_|d|_|d|_	|jrr|j
jrr|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)r�configrrrr(s




zupload.finalize_optionscCs>|jjsd}t|��x$|jjD]\}}}|j|||�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��|d2krDtd|��|jr|ddd|g}
|jrnd|jg|
d	d	�<t|
|jd
�t|d�}z|j�}Wd|j	�X|j
j}
dd
|
j�|
j
�tjj|�|f||tj|�j�d|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j�|
j �d�}ytj!|�j�}WnPt"k
�r�}z2d|}|j#|t$j%�ddl&m'}|��s|�WYdd}~Xn
X||d<d}|dk�r�t(j)�\}}}|�r�d||f}n|dk�r�dt(j(dd�}||d<|j�rtjj|�dt|dd�j�f|d<|j*d|j+j,d�}d t-|�j.d�}d!}d"|j,d�}|d#}t/j0�}x�|j1�D]�\}}d$|}t2|t3��s�|g}xr|D]j}t4|�t5k�r�|d%|d7}|d}nt6|�j,d&�}|j7|�|j7|j,d&��|j7d'�|j7|��q�W�qjW|j7|�|j8�}d(||jf}|j#|t$j%�d)|t6t9|��|d*�} t:|j|| d+�}!yt;|!�}"|"j<�}#|"j=}$Wnft>k
�r�}z|j?}#|j=}$WYdd}~Xn8t@k
�r�}z|j#t6|�t$jA��WYdd}~XnX|#d,k�r8|j#d-|#|$ft$j%�|jB�rZ|jC|"�}%d.jDd/d0|%d/d0f�}|j#|t$j%�n"d1|#|$f}|j#|t$jA�tE|��dS)3NzIncompatible url %s�http�httpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper$Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZ	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"zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
�-�KzUpload failed (%s): %s)r'r()Frr�AssertionErrorr
rr
r*�open�read�closerZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr4r3�distrr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoder"r�code�OSErrorZERRORrZ_read_pypi_response�joinr)&rr#r$r%ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr/�metar9Zdigest�er"r4r6rIr.�idZ	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler:Zrequest�resultZstatus�reason�textrrrr!Bs�













zupload.upload_fileN)r
rr)rrr)�__name__�
__module__�__qualname__r1r	Zuser_optionsZboolean_optionsrrr&r!rrrrrsr)�__doc__rCrLr3rF�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>s