HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/setuptools/command/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/setuptools/command/__pycache__/setopt.cpython-312.pyc
�


_�d?���ddlmZddlmZddlmZddlZddlZddlZddlm	Z	gd�Z
d
d�Zdd�ZGd	�d
e	�Z
Gd�de
�Zy)�)�convert_path)�log)�DistutilsOptionErrorN)�Command)�config_file�edit_config�option_base�setoptc�\�|dk(ry|dk(rKtjjtjjtj
�d�S|dk(rFtjdk(xrdxsd}tjjtd	|z��Std
|��)z�Get the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    �localz	setup.cfg�globalz
distutils.cfg�user�posix�.�z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user')
�os�path�join�dirname�	distutils�__file__�name�
expanduserr�
ValueError)�kind�dots  �;/usr/lib/python3/dist-packages/setuptools/command/setopt.pyrr
s���
�w����x���w�w�|�|�B�G�G�O�O�I�,>�,>�?��Q�Q��v�~��g�g�� �(�S�.�B���w�w�!�!�,�/D�s�/J�"K�L�L�
�N�PT�
U�U�c	�t�tjd|�tj�}d�|_|j|g�|j
�D�]\}}|�)tjd||�|j|��2|j|�s(tjd||�|j|�|j
�D]�\}}|�etjd|||�|j||�|j|�r�Dtjd||�|j|��mtjd||||�|j|||�����tjd	|�|s't|d
�5}|j|�ddd�yy#1swYyxYw)aYEdit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %sc��|S�N�)�xs r�<lambda>zedit_config.<locals>.<lambda>&s���rNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %s�w)r�debug�configparser�RawConfigParser�optionxform�read�items�info�remove_section�has_section�add_section�
remove_option�options�set�open�write)	�filename�settings�dry_run�opts�sectionr1�option�value�fs	         rrrs����I�I�-�x�8��'�'�)�D�"�D���I�I�x�j��$�N�N�,�5�����?��H�H�4�g�x�H�����(��#�#�G�,��	�	�9�7�H�M�� � ��)�!(����

5�
����=��I�I�6����R��&�&�w��7��<�<��0����A�7�H���+�+�G�4��I�I�3�W�f�e�X���H�H�W�f�e�4�

5�5�.�H�H�\�8�$��
�(�C�
 �	�A��J�J�q�M�	�	��	�	�s�F.�.F7c�,�eZdZdZgd�ZddgZd�Zd�Zy)r	z<Abstract base class for commands that mess with config files))�
global-config�gz0save options to the site-wide distutils.cfg file)�user-config�uz7save options to the current user's pydistutils.cfg file)z	filename=r<z-configuration file to use (default=setup.cfg)r>r@c�.�d|_d|_d|_yr!)�
global_config�user_configr5��selfs r�initialize_optionszoption_base.initialize_optionsSs��!��������
rc�l�g}|jr|jtd��|jr|jtd��|j�|j|j�|s|jtd��t|�dkDrt
d|��|\|_y)Nr
rr�z/Must specify only one configuration file option)rC�appendrrDr5�lenr)rF�	filenamess  r�finalize_optionszoption_base.finalize_optionsXs����	�������[��2�3�������[��0�1��=�=�$����T�]�]�+�����[��1�2��y�>�A��&�A�9��
�%���rN)�__name__�
__module__�__qualname__�__doc__�user_options�boolean_optionsrGrMr"rrr	r	Es%��F��L�	���O�
�
%rr	c�h�eZdZdZdZgd�ejzZejdgzZd�Zd�Z	d�Z
y)	r
z#Save command-line options to a filez1set an option in setup.cfg or another config file))zcommand=�czcommand to set an option for)zoption=�oz
option to set)z
set-value=�szvalue of the option)�remove�rzremove (unset) the valuerXc�f�tj|�d|_d|_d|_d|_yr!)r	rG�commandr:�	set_valuerXrEs rrGzsetopt.initialize_optionsws,���&�&�t�,������������rc��tj|�|j�|j�t	d��|j
�|jst	d��yy)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r	rMr[r:rr\rXrEs rrMzsetopt.finalize_options~sS���$�$�T�*��<�<��4�;�;�#6�&�'N�O�O��>�>�!�$�+�+�&�'M�N�N�+6�!rc��t|j|j|jj	dd�|j
ii|j�y)N�-�_)rr5r[r:�replacer\r7rEs r�runz
setopt.run�s>����M�M�
�\�\�D�K�K�/�/��S�9�4�>�>�J�K��L�L�	
rN)rNrOrPrQ�descriptionr	rRrSrGrMrbr"rrr
r
isE��-�E�K��
	� � �!�L�"�1�1�X�J�>�O��O�
rr
)r)F)�distutils.utilrrr�distutils.errorsrrr'�
setuptoolsr�__all__rrr	r
r"rr�<module>rhsD��'��1��	���
A��V�&�R!%�'�!%�H!
�[�!
r