ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/command/__pycache__/upload.cpython-36.opt-2.pyc

3

��2a]�@s�ddlZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZddlmZGd	d
�d
e�ZdS)�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�+/opt/alt/python36/lib64/python3.6/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��|d/krDtd|��|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�}d}|dk�rZt!j"�\}}}|�rtd||f}n|dk�rtdt!j!dd�}||d<|j�r�tjj|�dt|dd�j�f|d<|j#d|j$j%d�}dt&|�j'd�}d}d|j%d�}|d}t(j)�}x�|j*�D]�\}}d |}t+|t,��s |g}xr|D]j}t-|�t.k�rR|d!|d"7}|d}nt/|�j%d#�}|j0|�|j0|j%d#��|j0d$�|j0|��q&W�q�W|j0|�|j1�}d%||jf}|j2|t3j4�d&|t/t5|��|d'�}t6|j||d(�}yt7|�}|j8�} |j9}!Wnft:k
�r:}"z|"j;} |"j9}!WYdd}"~"Xn8t<k
�rp}"z|j2t/|"�t3j=��WYdd}"~"XnX| d)k�r�|j2d*| |!ft3j4�|j>�r�|j?|�}#d+j@d,d-|#d,d-f�}|j2|t3j4�n"d.| |!f}|j2|t3j=�tA|��dS)0NzIncompatible url %s�http�httpszunsupported 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�
�-�KzUpload failed (%s): %s)r'r()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_obsoletesr3�distrr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalueZannouncer�INFO�lenrrZgetcoder"r�code�OSErrorZERRORrZ_read_pypi_response�joinr)$rr#r$r%ZschemaZnetlocZurl�paramsZqueryZ	fragmentsZgpg_args�fr/�metar8r5rFr.�idZ	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler"r9Zrequest�result�status�reason�e�textrrrr!Bs�













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

Zerion Mini Shell 1.0