/snap/core18/2979/usr/lib/python3.6/distutils/command/__pycache__
NameSizeModeActions
bdist.cpython-36.pyc37790644editdlrm
bdist_dumb.cpython-36.pyc37410644editdlrm
bdist_msi.cpython-36.pyc197650644editdlrm
bdist_rpm.cpython-36.pyc130680644editdlrm
bdist_wininst.cpython-36.pyc84760644editdlrm
build.cpython-36.pyc40630644editdlrm
build_clib.cpython-36.pyc49690644editdlrm
build_ext.cpython-36.pyc165700644editdlrm
build_py.cpython-36.pyc105160644editdlrm
build_scripts.cpython-36.pyc43320644editdlrm
check.cpython-36.pyc52230644editdlrm
clean.cpython-36.pyc21770644editdlrm
config.cpython-36.pyc103120644editdlrm
install.cpython-36.pyc151300644editdlrm
install_data.cpython-36.pyc23220644editdlrm
install_egg_info.cpython-36.pyc34180644editdlrm
install_headers.cpython-36.pyc17220644editdlrm
install_lib.cpython-36.pyc52990644editdlrm
install_scripts.cpython-36.pyc21880644editdlrm
register.cpython-36.pyc84100644editdlrm
sdist.cpython-36.pyc131070644editdlrm
upload.cpython-36.pyc50480644editdlrm
__init__.cpython-36.pyc5330644editdlrm
Edit: /snap/core18/2979/usr/lib/python3.6/distutils/command/__pycache__/register.cpython-36.pyc (8410B)
3 ª·]À-ã@sddZddlZddlZddlZddlZddlmZddlm Z ddl Tddl m Z Gdd„de ƒZ dS) zhdistutils.command.register Implements the Distutils 'register' command (register with the repository). éN)Úwarn)Ú PyPIRCCommand)Ú*)Úlogc@sŽeZdZdZejdd gZejdddgZdd d „fgZd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zd!dd„ZdS)"Úregisterz7register the distribution with the Python package indexúlist-classifiersNú list the valid Trove classifiersÚstrictúBWill stop the registering if the meta-data are not fully compliantÚverifyÚcheckcCsdS)NT©)Úselfr r ú0/usr/lib/python3.6/distutils/command/register.pyÚszregister.cCstj|ƒd|_d|_dS)Nr)rÚinitialize_optionsÚlist_classifiersr )rr r rrs zregister.initialize_optionscCs*tj|ƒd|jfddœ}||jjd<dS)Nré)r Úrestructuredtextr )rr)rÚfinalize_optionsr Ú distributionZcommand_options)rZ check_optionsr r rr$s zregister.finalize_optionscCsX|jƒ|jƒx|jƒD]}|j|ƒqW|jr<|jƒn|jrL|jƒn|jƒdS)N) rÚ _set_configZget_sub_commandsZ run_commandZdry_runÚverify_metadatarÚ classifiersÚ send_metadata)rZcmd_namer r rÚrun+s  z register.runcCs8tdtƒ|jjdƒ}|jƒ|j|_d|_|jƒdS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated, use the check command insteadr rN)rÚPendingDeprecationWarningrZget_command_objZensure_finalizedr rr)rr r r rÚcheck_metadata:s zregister.check_metadatacCsz|jƒ}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|jƒ‚|jdkrp|j|_d|_d S) z: Reads the configuration file and set attributes. ÚusernameÚpasswordÚ repositoryÚrealmTZpypiz%s not found in .pypircFN)Z _read_pypircrrr r!Ú has_configZDEFAULT_REPOSITORYÚ ValueError)rZconfigr r rrDs     zregister._set_configcCs*|jd}tjj|ƒ}tj|j|ƒƒdS)z8 Fetch the list of classifiers from the server. z?:action=list_classifiersN)r ÚurllibÚrequestZurlopenrÚinfoÚ_read_pypi_response)rZurlZresponser r rrUs  zregister.classifierscCs&|j|jdƒƒ\}}tjd||ƒdS)zF Send the metadata to the package index server to be checked. r zServer response (%s): %sN)Úpost_to_serverÚbuild_post_datarr&)rÚcodeÚresultr r rr\szregister.verify_metadatac Cs|jrd}|j}|j}n d}d}}djƒ}x:||krf|jdtjƒtƒ}|sTd}q.||kr.tdƒq.W|dkr|x|s‚tdƒ}qtWx|s–t j dƒ}q†Wt j j ƒ}t j j|jƒd }|j|j|||ƒ|j|jd ƒ|ƒ\}}|jd ||ftjƒ|d kr|jr||j_nj|jd tjƒ|jd|jƒtjƒd}x&|jƒdkr\tdƒ}|s8d}q8W|jƒdkr|j||ƒn„|dkr¬ddi} d| d<| d<| d<d| d<x| dsÊtdƒ| d<q°Wx‚| d| dkrNx| dsþt j dƒ| d<qâWx| dst j dƒ| d<qW| d| dkrÎd| d<d| d<tdƒqÎWx| dsltdƒ| d<qRW|j| ƒ\}}|d kr–tjd ||ƒntjdƒtjd ƒnT|d!krdd"i} d| d<x| dsâtd#ƒ| d<qÈW|j| ƒ\}}tjd ||ƒdS)$a_ Send the metadata to the package index server. Well, do the following: 1. figure who the user is, and then 2. send the data as a Basic auth'ed POST. First we try to read the username/password from $HOME/.pypirc, which is a ConfigParser-formatted file with a section [distutils] containing username and password entries (both in clear text). Eg: [distutils] index-servers = pypi [pypi] username: fred password: sekrit Otherwise, to figure who the user is, we offer the user three choices: 1. use existing login, 2. register as a new user, or 3. set the password to a random string and email the user. Ú1ÚxÚz1 2 3 4zâWe need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit Your selection [default 1]: z&Please choose one of the four options!z Username: z Password: rZsubmitzServer response (%s): %séÈzAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)ÚXZynzSave your login (y/N)?ÚnÚyÚ2z:actionÚuserÚnamerZemailNZconfirmz Confirm: z!Password and confirm don't match!z EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.Ú3Zpassword_resetzYour email address: )r"rrÚsplitÚannouncerÚINFOÚinputÚprintÚgetpassr$r%ZHTTPPasswordMgrÚparseZurlparser Z add_passwordr!r(r)rZ _get_rc_fileÚlowerZ _store_pypircr&) rZchoicerrÚchoicesÚauthZhostr*r+Údatar r rrcsŒ                     zregister.send_metadatacCs|jj}|d|jƒ|jƒ|jƒ|jƒ|jƒ|jƒ|jƒ|j ƒ|j ƒ|j ƒ|j ƒ|j ƒ|jƒ|jƒ|jƒdœ}|ds„|ds„|drŒd|d<|S)Nz1.0)z:actionÚmetadata_versionr5ÚversionZsummaryZ home_pageZauthorZ author_emailZlicenseÚ descriptionÚkeywordsÚplatformrZ download_urlÚprovidesÚrequiresÚ obsoletesrGrHrIz1.1rB)rZmetadataZget_nameZ get_versionZget_descriptionZget_urlZ get_contactZget_contact_emailZ get_licenceZget_long_descriptionZ get_keywordsZ get_platformsZget_classifiersZget_download_urlZ get_providesZ get_requiresZ get_obsoletes)rÚactionÚmetarAr r rr)Ýs* zregister.build_post_datacCsd|kr$|jd|d|jftjƒd}d|}|d}tjƒ}xŽ|jƒD]‚\}}t|ƒtgƒtfƒfkrp|g}xZ|D]R}t|ƒ}|j |ƒ|j d|ƒ|j dƒ|j |ƒ|rv|dd krv|j d ƒqvWqJW|j |ƒ|j d ƒ|j ƒj d ƒ}d |tt |ƒƒd œ} t jj|j|| ƒ} t jjt jj|dƒ} d}y| j| ƒ} Wnxt jjk rˆ} z$|jrl| jjƒ}| j| jf} WYdd} ~ XnJt jjk rº} zdt| ƒf} WYdd} ~ XnX|jrÎ|j| ƒ}d} |jrd jdd|ddfƒ}|j|tjƒ| S)zC Post a query to the server, and return a string response. r5zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z --z--z* Content-Disposition: form-data; name="%s"z rú Ú zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)z Content-typezContent-length)Z password_mgrr.Niôr/ÚOKú-éKéÿÿÿÿ)r/rN)r8r rr9ÚioÚStringIOÚitemsÚtypeÚstrÚwriteÚgetvalueÚencodeÚlenr$r%ZRequestZ build_openerZHTTPBasicAuthHandlerÚopenÚerrorZ HTTPErrorZ show_responseÚfpÚreadr*ÚmsgZURLErrorr'Újoin)rrAr@ÚboundaryZ sep_boundaryZ end_boundaryZbodyÚkeyÚvalueZheadersZreqÚopenerr+Úer_r r rr(ùsV         zregister.post_to_server)rNr)r Nr )N)Ú__name__Ú __module__Ú __qualname__rDrZ user_optionsZboolean_optionsZ sub_commandsrrrrrrrrr)r(r r r rrs&  zr)Ú__doc__r<rRZ urllib.parser$Zurllib.requestÚwarningsrZdistutils.corerZdistutils.errorsZ distutilsrrr r r rÚs