Mini Shell

Direktori : /lib64/python3.9/distutils/command/__pycache__/
Upload File :
Current File : //lib64/python3.9/distutils/command/__pycache__/upload.cpython-39.pyc

a

�DOg��@s�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZmZddlmZdd	lmZdd
lmZeedd�eedd�eed
d�d�ZGdd�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�	HTTPError)�urlopen�Request)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�log�md5�sha256�blake2b)Z
md5_digestZ
sha256_digestZblake2_256_digestc@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 filesrcCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser�identity)�self�r�0/usr/lib64/python3.9/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_optionsrrrZ_read_pypircrrrr�distribution)rZconfigrrrr2s
�



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�runDs
z
upload.runc"Cs
t|j�\}}}}}}	|s"|s"|	r0td|j��|dvrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|��}W|�	�n
|�	�0|j
j}
dd|
��|
�
�tj�|�|f||d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��d�}d|d<t��D]B\}}|du�rL�q6z||�� �||<Wnt!�ytYn0�q6|j�r�t|dd
��,}tj�|�d|��f|d<Wd�n1�s�0Y|j"d|j#�$d�}dt%|��&d�}d}d|�$d�}|d}t'�(�}|��D]�\}}d|}t)|t*��sB|g}|D]j}t+|�t,u�rr|d|d7}|d}nt-|��$d�}|�.|�|�.|�$d��|�.d�|�.|��qF�q |�.|�|�/�}d||jf}|�0|t1j2�d |t-t3|��|d!�}t4|j||d"�}zt5|�}|�6�}|j7}Wnjt8�yX} z| j9}| j7}WYd} ~ nBd} ~ 0t:�y�} z |�0t-| �t1j;��WYd} ~ n
d} ~ 00|d#k�r�|�0d$||ft1j2�|j<�r|�=|�}!d%�>d&|!d&f�}|�0|t1j2�n"d'||f}|�0|t1j;�t?|��dS)(NzIncompatible url %s)�http�httpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper#Zmetadata_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�AssertionErrorrrr
r)�open�read�closer�metadata�get_nameZget_version�os�path�basenameZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes�_FILE_CONTENT_DIGESTS�items�	hexdigest�
ValueErrorrr�encoder�decode�io�BytesIO�
isinstance�list�type�tuple�str�write�getvalueZannouncer�INFO�lenrrZgetcoder!r�code�OSError�ERRORrZ_read_pypi_response�joinr)"rr"r#r$Zschema�netloc�url�params�queryZ	fragmentsZgpg_args�fr.�metar6Zdigest_nameZdigest_consZ	user_passZauth�boundaryZsep_boundaryZend_boundary�body�key�value�titler!r7Zrequest�result�status�reason�e�textrrrr Ls���

� 

�(




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r0r	Zuser_optionsZboolean_optionsrrr%r rrrrrs�r)�__doc__r@rI�hashlib�base64rZurllib.errorrZurllib.requestrr�urllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsr�getattrrCrrrrr�<module>s 


�

Zerion Mini Shell 1.0