� ,�Re����ddlmZddlmZddlmZddlZddlZddlZddlm Z gd�Z dd�Z dd �Z Gd �d e ��Z Gd �de ��ZdS)�)� convert_path)�log)�DistutilsOptionErrorN)�Command)� config_file� edit_config� option_base�setopt�localc�^�|dkrdS|dkrGtj�tj�tj��d��S|dkrCtjdkrdpd}tj�td |z����Std |���) z�Get the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z 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 ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/setopt.pyrr s���  �w����{� �x����w�|�|� �G�O�O�I�.� /� /�� � � � �v�~�~��g�� �(�S�.�B���w�!�!�,�/D�s�/J�"K�"K�L�L�L� �A�4� � ��Fc ���tjd|��tj��}d�|_|�|g��|���D�]-\}}|�,tjd||��|�|���4|� |��s+tjd||��|� |��|���D]�\}}|�ntjd|||��|� ||��|� |��s+tjd||��|�|���utjd||||��|� |||������/tjd |��|s@t|d ��5}|�|��ddd��dS#1swxYwYdSdS) 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�zedit_config..*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 rrr sR���I�-�x�8�8�8� � '� )� )�D�"�{�D���I�I�x�j����$�N�N�,�,�5�5���� �?� �H�4�g�x� H� H� H� � � �� (� (� (� (��#�#�G�,�,� *�� �9�7�H�M�M�M�� � ��)�)�)�!(����� 5� 5� ����=��I�0��������&�&�w��7�7�7��<�<��0�0�5���!F�!(�(�4�4�4��+�+�G�4�4�4���I�3���������H�H�W�f�e�4�4�4�4�! 5�$�H�\�8�$�$�$� �� �(�C� � � �A� �J�J�q�M�M�M� � � � � � � � � � � � ���� � � � � � ��s�1G�G�Gc�.�eZdZdZgd�ZddgZd�Zd�ZdS)r zr@c�0�d|_d|_d|_dSr!)� global_config� user_configr5��selfs r�initialize_optionszoption_base.initialize_options\s��!�������� � � rc��g}|jr"|�td����|jr"|�td����|j�|�|j��|s"|�td����t |��dkrt d|���|\|_dS)Nr rr �z/Must specify only one configuration file option)rC�appendrrDr5�lenr)rF� filenamess r�finalize_optionszoption_base.finalize_optionsas���� � � � 4� � � �[��2�2� 3� 3� 3� � � 2� � � �[��0�0� 1� 1� 1� �=� $� � � �T�]� +� +� +�� 3� � � �[��1�1� 2� 2� 2� �y�>�>�A� � �&�A���� �#��� � � rN)�__name__� __module__� __qualname__�__doc__� user_options�boolean_optionsrGrMr"rrr r LsW������F�F����L� ���O���� #�#�#�#�#rr c�V�eZdZdZdZgd�ejzZejdgzZd�Zd�Z d�Z dS) 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�r�t�|��d|_d|_d|_d|_dSr!)r rG�commandr:� set_valuerXrEs rrGzsetopt.initialize_options�s6���&�&�t�,�,�,��� ��� ������ � � rc��t�|��|j�|j�t d���|j�|jst d���dSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r rMr[r:rr\rXrEs rrMzsetopt.finalize_options�s`���$�$�T�*�*�*� �<� �4�;�#6�&�'N�O�O� O� �>� !�$�+� !�&�'M�N�N� N� "� !� !� !rc��t|j|j|j�dd��|jii|j��dS)N�-�_)rr5r[r:�replacer\r7rEs r�runz setopt.run�sO��� �M�� �t�{�2�2�3��<�<�d�n�M�� �L�  � � � � rN) rNrOrPrQ� descriptionr rRrSrGrMrbr"rrr r ss~������-�-�E�K���� � � !�L�"�1�X�J�>�O����O�O�O� � � � � rr )r )F)�distutils.utilrrr�distutils.errorsrrr'� setuptoolsr�__all__rrr r r"rr�rhs��'�'�'�'�'�'�������1�1�1�1�1�1����� � � � ����������� A� A� A������&)�)�)�)�X$#�$#�$#�$#�$#�'�$#�$#�$#�N" �" �" �" �" �[�" �" �" �" �" r