%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/_distutils/command/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/_distutils/command/__pycache__/register.cpython-312.pyc

�


_�d).��j�dZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZGd�de
�Z
y)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
�N)�warn�)�
PyPIRCCommand)�logc��eZdZdZej
ddgzZejgd�zZdd�fgZd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zdd�Zy)�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)�verifyr	r
�checkc��y)NT���selfs �H/usr/lib/python3/dist-packages/setuptools/_distutils/command/register.py�<lambda>zregister.<lambda>#s��c�J�tj|�d|_d|_y)Nr)r�initialize_options�list_classifiersr
rs rrzregister.initialize_options%s���(�(��.� !�����rc��tj|�d|jfdd�}||jjd<y)Nr)r�)r
�restructuredtextr)r�finalize_optionsr
�distribution�command_options)r�
check_optionss  rrzregister.finalize_options*sA���&�&�t�,�"�4�;�;�/� /�
�
�6C����)�)�'�2rc�$�|j�|j�|j�D]}|j|��|jr|j�y|jr|j�y|j�y�N)	r�_set_config�get_sub_commands�run_command�dry_run�verify_metadatar�classifiers�
send_metadata)r�cmd_names  r�runzregister.run3sx�����������-�-�/�	'�H����X�&�	'��<�<�� � �"�
�
"�
"�������� rc���tdt�|jjd�}|j	�|j
|_d|_|j�y)zDeprecated API.zVdistutils.command.register.check_metadata is deprecated; use the check command insteadrrN)r�DeprecationWarningr�get_command_obj�ensure_finalizedr
rr()rrs  r�check_metadatazregister.check_metadataBsR���
,��	
�
�!�!�1�1�'�:��
��� ��{�{���!"���
�	�	�rc�@�|j�}|ik7r0|d|_|d|_|d|_|d|_d|_y	|jd|jfvrtd|jz��|jdk(r|j|_d|_y	)
z0Reads the configuration file and set attributes.�username�password�
repository�realmT�pypiz%s not found in .pypircFN)�_read_pypircr/r0r1r2�
has_config�DEFAULT_REPOSITORY�
ValueError)r�configs  rr zregister._set_configOs����"�"�$���R�<�"�:�.�D�M�"�:�.�D�M�$�\�2�D�O����D�J�"�D�O����v�t�/F�/F�&G�G� �!:�T�_�_�!L�M�M����&�(�"&�"9�"9���#�D�Orc��|jdz}tjj|�}t	j
|j
|��y)z.Fetch the list of classifiers from the server.z?:action=list_classifiersN)r1�urllib�request�urlopenr�info�_read_pypi_response)r�url�responses   rr%zregister.classifiers_s<���o�o� ;�;���>�>�)�)�#�.������)�)�(�3�4rc�x�|j|jd��\}}tjd||�y)z<Send the metadata to the package index server to be checked.r�Server response (%s): %sN)�post_to_server�build_post_datarr=)r�code�results   rr$zregister.verify_metadataes4���,�,�T�-A�-A�(�-K�L���v����+�T�6�:rc��|jrd}|j}|j}nd}dx}}dj�}||vrC|j	dt
j�t�}|sd}n||vrtd�||vr�C|dk(�r�|std�}|s�|stjd�}|s�tjj�}tjj|j�d	}|j!|j"|||�|j%|j'd
�|�\}}|j	dj)||�t
j�|dk(r�|jr||j*_y|j	d
t
j�|j	d|j-�zt
j�d}|j/�dvr"td�}|sd}|j/�dvr�"|j/�dk(r|j1||�yyy|dk(�r#ddi}	dx|	d<x|	d<|	d<d|	d<|	dstd�|	d<|	ds�|	d|	dk7rr|	dstjd�|	d<|	ds�|	dstjd�|	d<|	ds�|	d|	dk7rd|	d<d|	d<td�|	d|	dk7r�r|	dstd�|	d<|	ds�|j%|	�\}}|dk7rt3j4d||�yt3j4d �t3j4d!�y|d"k(rNdd#i}	d|	d<|	dstd$�|	d<|	ds�|j%|	�\}}t3j4d||�yy)%aSend 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: r�submitzServer response ({}): {}��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�X�ynzSave your login (y/N)?�n�y�2�:action�user�namer0�emailN�confirmz
 Confirm: z!Password and confirm don't match!z
   EMail: rBz"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3�password_resetzYour email address: )r5r/r0�split�announce�logging�INFO�input�print�getpassr:r;�HTTPPasswordMgr�parse�urlparser1�add_passwordr2rCrD�formatr�_get_rc_file�lower�
_store_pypircrr=)
r�choicer/r0�choices�auth�hostrErF�datas
          rr&zregister.send_metadataks���<�?�?��F��}�}�H��}�}�H��F�"$�$�H�x��/�/�#���G�#��M�M� ����	
��W�F�����w�&��>�?��G�#�"�S�=�� ��.����"�?�?�<�8����>�>�1�1�3�D��<�<�(�(����9�!�<�D����d�j�j�$��(�C��.�.�t�/C�/C�H�/M�t�T�L�D�&��M�M�4�;�;�D�&�I�7�<�<�X��s�{��?�?�2:�D�%�%�.��M�M�:� �����M�M�:�T�=N�=N�=P�P�����!�F� �,�,�.��4�!&�'?�!@��%�%(�F�!�,�,�.��4��|�|�~��,��*�*�8�X�>�-�-�2�s�]��v�&�D�>@�@�D��L�@�4�
�+�d�7�m�"�D��O��6�l�$�\�2��V���6�l��z�"�d�9�o�5��z�*�'.���|�'D�D��$��z�*��y�/�&-�o�o�l�&C�D��O��y�/��
�#�t�I��6�')�D��$�&*�D��O��=�>��z�"�d�9�o�5��7�m� %�l� 3��W�
��7�m��.�.�t�4�L�D�&��s�{����3�T�6�B����=�>����U�V�
�s�]��/�0�D��D��M��7�m� %�&<� =��W�
��7�m��.�.�t�4�L�D�&��H�H�/��v�>�
rc�h�|jj}id|�dd�d|j��d|j��d|j	��d|j��d|j
��d	|j��d
|j��d|j��d|j��d
|j��d|j��d|j��d|j��d|j��d|j!��}|ds
|ds|drd|d<|S)NrR�metadata_versionz1.0rT�version�summary�	home_page�author�author_email�license�description�keywords�platformr%�download_url�provides�requires�	obsoletesz1.1)r�metadata�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licence�get_long_description�get_keywords�
get_platforms�get_classifiers�get_download_url�get_provides�get_requires�
get_obsoletes)r�action�metarls    rrDzregister.build_post_data�s���� � �)�)��
��v�
���
�
�D�M�M�O�
�
�t�'�'�)�	
�

�t�+�+�-�
�
�����

�
�d�&�&�(�
�
�D�2�2�4�
�
�t�'�'�)�
�
�4�4�4�6�
�
��)�)�+�
�
��*�*�,�
�
�4�/�/�1�
�
�D�1�1�3�
� 
��)�)�+�!
�"
��)�)�+�#
�$
��+�+�-�%
��(�
��t�J�/�4��3D�',�D�#�$��rNc���d|vr=|jdj|d|j�tj�d}d|z}|dz}tj�}|j�D]�\}}t|�tg�td�fvr|g}|D]q}t|�}|j|�|jd|z�|jd�|j|�|s�X|d	d
k(s�a|jd��s��|j|�|jd�|j�jd�}d
|ztt|��d�}	tjj!|j||	�}
tjj#tjj%|���}d}	|j'|
�}|j(r|j+|�}d}|j(r4dj;d|df�}|j|tj�|S#tj,j.$rH}
|j(r|
j0j3�}|
j4|
j6f}Yd}
~
��d}
~
wtj,j8$r}
dt|
�f}Yd}
~
��d}
~
wwxYw)z9Post a query to the server, and return a string response.rTzRegistering {} to {}z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)�password_mgrrJ)rL�OKNi�zK---------------------------------------------------------------------------)rZrdr1r[r\�io�StringIO�items�type�str�write�getvalue�encode�lenr:r;�Request�build_opener�HTTPBasicAuthHandler�open�
show_responser>�error�	HTTPError�fp�readrE�msg�URLError�join)rrlrj�boundary�sep_boundary�end_boundary�body�key�value�headers�req�openerrF�er�s               rrCzregister.post_to_serversi���T�>��M�M�&�-�-�d�6�l�D�O�O�L����
�
I����(��#�d�*���{�{�}���*�*�,�	%�J�C���E�{�4��8�T�"�X�"6�6�����
%���E�
���
�
�<�(��
�
�H�3�N�O��
�
�6�"��
�
�5�!��U�2�Y�$�.��J�J�t�$�
%�		%�	
�
�
�<� ��
�
�4���}�}��%�%�g�.��N���!�#�d�)�n�
��
�n�n�$�$�T�_�_�d�G�D�����,�,��N�N�/�/�T�/�B�
����	��[�[��%�F��!�!��/�/��7���F�����)�)�X�t�X�6�7�C��M�M�#�w�|�|�,��
���|�|�%�%�	#��!�!��t�t�y�y�{���V�V�Q�U�U�]�F���|�|�$�$�	!��#�a�&�[�F��	!�s$�I�K#�)>J,�, K#�
K�K#r)�__name__�
__module__�__qualname__rur�user_options�boolean_options�sub_commandsrrr(r-r r%r$r&rDrCrrrrrs���K�K� �-�-�F�	
�1��L�$�3�3�7��O��/�0�1�L��
C�
!��$� 5�;�?�B�88rr)�__doc__r_r�r[�urllib.parser:�urllib.request�warningsr�corer�distutils._logrrrrr�<module>r�s2����	����� ��m�}�mr

Zerion Mini Shell 1.0