B œq/e%)»ã @ s” d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZm Z d dl mZ d dlm Z mZ d dlmZ d dlmZ d dlmZ G d d „ d eƒZdS )é N)Ústandard_b64encode)ÚurlopenÚRequestÚ HTTPError)Úurlparse)ÚDistutilsErrorÚDistutilsOptionError)Ú PyPIRCCommand)Úspawn)Úlogc @ sJ e Zd ZdZejddg Zejdg Zdd„ 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 c C s, t | ¡ d| _d| _d| _d| _d | _d S )NÚ r F)r Úinitialize_optionsÚusernameÚpasswordÚ show_responser Úidentity)Úself© r ú=/opt/alt/python37/lib64/python3.7/distutils/command/upload.pyr s zupload.initialize_optionsc C sr t | ¡ | jr| jstdƒ‚| ¡ }|i krV|d | _|d | _|d | _|d | _ | jsn| j jrn| j j| _d S )Nz.Must use --sign for --identity to have meaningr r Ú repositoryÚrealm)r Úfinalize_optionsr r r Z_read_pypircr r r r Údistribution)r Zconfigr r r r ( s zupload.finalize_optionsc C s> | j jsd}t|ƒ‚x$| j jD ]\}}}| |||¡ qW d S )NzHMust create and upload files in one command (e.g. setup.py sdist upload))r Z dist_filesr Úupload_file)r ÚmsgÚcommandÚ pyversionÚfilenamer r r Úrun: s z upload.runc $ C sê t | jƒ\}}}}}} |s"|s"| r0td| j ƒ‚|dkrDtd| ƒ‚| jr|ddd|g} | jrnd| jg| dd…<