ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/distutils/command/__pycache__/register.cpython-38.opt-1.pyc
U

e5dÀ-ã@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGdd„de	ƒZ
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
éN)Úwarn)Ú
PyPIRCCommand)Ú*)Úlogc@sŽeZdZdZejddgZejdddgZddd	„fgZd
d„Zdd
„Z	dd„Z
dd„Zdd„Zdd„Z
dd„Zdd„Zdd„Zddd„ZdS) Úregisterz7register the distribution with the Python package index)úlist-classifiersNz list the valid Trove classifiers)ÚstrictNzBWill stop the registering if the meta-data are not fully compliantÚverifyrrÚcheckcCsdS)NT©©Úselfrrú2/usr/lib64/python3.8/distutils/command/register.pyÚ<lambda>ózregister.<lambda>cCst |¡d|_d|_dS)Nr)rÚinitialize_optionsÚlist_classifiersrrrrrrs
zregister.initialize_optionscCs*t |¡d|jfddœ}||jjd<dS)Nr)ré)rÚrestructuredtextr
)rÚfinalize_optionsrÚdistributionZcommand_options)r
Z
check_optionsrrrr$s

ÿzregister.finalize_optionscCsT| ¡| ¡| ¡D]}| |¡q|jr8| ¡n|jrH| ¡n| ¡dS)N)	rÚ_set_configZget_sub_commandsZrun_commandZdry_runÚverify_metadatarÚclassifiersÚ
send_metadata)r
Zcmd_namerrrÚrun+s

zregister.runcCs8tdtƒ|j d¡}| ¡|j|_d|_| ¡dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)rÚPendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrrÚcheck_metadata:sÿzregister.check_metadatacCsz| ¡}|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)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj |¡}t | |¡¡dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r ÚurllibÚrequestZurlopenrÚinfoÚ_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&| | d¡¡\}}t d||¡dS)zF Send the metadata to the package index server to be checked.
        r	úServer response (%s): %sN)Úpost_to_serverÚbuild_post_datarr&)r
ÚcodeÚresultrrrr\szregister.verify_metadatac
CsÜ|jrd}|j}|j}nd}d}}d ¡}||krd| dtj¡tƒ}|sRd}q,||kr,tdƒq,|dkrl|s|tdƒ}qn|sŒt	 	d¡}q|t
j ¡}t
j
 |j¡d	}| |j|||¡| | d
¡|¡\}}| d||ftj¡|dkrØ|jr||j_nf| d
tj¡| d| ¡tj¡d}| ¡dkrNtdƒ}|s*d}q*| ¡dkrØ| ||¡nl|dkrˆddi}	d|	d<|	d<|	d<d|	d<|	ds¸tdƒ|	d<qž|	d|	dkr0|	dsæt	 	d¡|	d<qÊ|	dst	 	d¡|	d<qæ|	d|	dkr¸d|	d<d|	d<tdƒq¸|	dsJtdƒ|	d<q0| |	¡\}}|dkrrt d||¡nt d¡t d ¡nP|d!krØdd"i}	d|	d<|	ds¼td#ƒ|	d<q¢| |	¡\}}t d||¡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: rZsubmitr(éÈ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Ú2ú: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&)
r
ZchoicerrÚchoicesÚauthZhostr+r,Údatarrrrcsšú



ÿÿ

ÿÿÿ








zregister.send_metadatacCs|jj}|d| ¡| ¡| ¡| ¡| ¡| ¡| ¡| 	¡| 
¡| ¡| ¡| 
¡| ¡| ¡| ¡dœ}|ds„|ds„|drŒd|d<|S)Nz1.0)r5Úmetadata_versionr7ÚversionZsummaryZ	home_pageZauthorZauthor_emailÚlicenseÚdescriptionÚkeywordsÚplatformrZdownload_urlÚprovidesÚrequiresÚ	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
ÚactionÚmetarCrrrr*Ýs,îzregister.build_post_dataNc
Csôd|kr$| d|d|jftj¡d}d|}|d}t ¡}| ¡D]~\}}t|ƒtgƒtdƒfkrn|g}|D]R}t|ƒ}| 	|¡| 	d|¡| 	d¡| 	|¡|rr|d	d
krr| 	d¡qrqH| 	|¡| 	d¡| 
¡ d¡}d
|tt|ƒƒdœ}	t
j |j||	¡}
t
j t
jj|d¡}d}z| |
¡}Wnxt
jjk
r€}
z"|jrd|
j ¡}|
j|
jf}W5d}
~
XYnJt
jjk
r²}
zdt|
ƒf}W5d}
~
XYnX|jrÆ| |¡}d}|jrðd d|df¡}| |tj¡|S)zC Post a query to the server, and return a string response.
        r7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

éÿÿÿÿú
Ú
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/Niô)r0ZOKzK---------------------------------------------------------------------------)r:r rr;ÚioÚStringIOÚitemsÚtypeÚstrÚwriteÚgetvalueÚencodeÚlenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandlerÚopenÚerrorZ	HTTPErrorZ
show_responseÚfpÚreadr+ÚmsgZURLErrorr'Újoin)r
rCrBÚboundaryZsep_boundaryZend_boundaryZbodyÚkeyÚvalueZheadersZreqZopenerr,Úer_rrrr)ùs^ÿþ





þÿ

zregister.post_to_server)N)Ú__name__Ú
__module__Ú__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*ýÿ
zr)Ú__doc__r>rRZurllib.parser$Zurllib.requestÚwarningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrrÚ<module>s