AlkantarClanX12

Your IP : 3.15.186.56


Current Path : /opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/upload.cpython-310.opt-2.pyc

o

6��f��@s�	ddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZeed
d�eedd�eedd�d
�ZGdd�de�ZdS)�N)�standard_b64encode)�	HTTPError)�urlopen�Request)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logZmd5Zsha256Zblake2b)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 filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�?/opt/alt/python310/lib64/python3.10/distutils/command/upload.pyr*s

zupload.initialize_optionscCszt�|�|jr|jstd��|��}|ikr+|d|_|d|_|d|_|d|_	|js9|j
jr;|j
j|_dSdSdS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr2s
�



�zupload.finalize_optionscCs:|jjs
d}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|	rtd|j��|dvr"td|��|jr>ddd|g}
|jr7d|jg|
dd�<t|
|jd	�t|d
�}z
|��}W|�	�n|�	�w|j
j}
idd�d
d�d|
���d|
�
��dtj�|�|f�d|�d|�dd�d|
���d|
���d|
���d|
���d|
���d|
���d|
���d|
���d|
���|
��|
��|
��|
��d��}d |d!<t��D]\}}|dur�q�z
||�� �||<Wq�t!y�Yq�w|j�rt|d"d
��}tj�|�d"|��f|d#<Wd�n	1�swY|j"d$|j#�$d%�}d&t%|��&d%�}d'}d(|�$d%�}|d)}t'�(�}|��D]J\}}d*|}t)|t*��s@|g}|D]5}t+|�t,u�rX|d+|d,7}|d-}nt-|��$d.�}|�.|�|�.|�$d.��|�.d/�|�.|��qB�q/|�.|�|�/�}d0||jf}|�0|t1j2�d1|t-t3|��|d2�}t4|j||d3�}z
t5|�}|�6�}|j7}Wn/t8�y�} z| j9}| j7}WYd} ~ nd} ~ wt:�y�} z
|�0t-| �t1j;��d} ~ ww|d4k�r|�0d5||ft1j2�|j<�r|�=|�}!d6�>d7|!d7f�}|�0|t1j2�dSdSd8||f}|�0|t1j;�t?|��)9NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbz:actionZfile_uploadZprotocol_version�1�name�version�contentZfiletyper Zmetadata_versionz1.0ZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiers)Z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�read�closerZmetadataZget_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�itemsZ	hexdigest�
ValueErrorrr�encoder�decode�io�BytesIO�
isinstance�list�type�tuple�str�write�getvalueZannouncer�INFO�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurl�paramsZqueryZ	fragmentsZgpg_args�fr)�metar1Zdigest_nameZdigest_consZ	user_passZauth�boundaryZsep_boundaryZend_boundary�body�key�value�titlerr2Zrequest�resultZstatus�reason�e�textrrrrLs��

����
�������������� �
��


�


��
���
�
�zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)r9rAZhashlib�base64rZurllib.errorrZurllib.requestrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsr�getattrr<rrrrr�<module>s"


�