Hacked By AnonymousFox

Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/setopt.cpython-310.pyc

o

~�Re��@s�ddlmZddlmZddlmZddlZddlZddlZddlm	Z	gd�Z
ddd	�Zddd�ZGd
d�de	�Z
Gdd�de
�ZdS)�)�convert_path)�log)�DistutilsOptionErrorN)�Command)�config_file�edit_config�option_base�setopt�localcCsd|dkrdS|dkrtj�tj�tj�d�S|dkr-tjdkr!dp"d}tj�td	|��St	d
|��)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�dot�r��/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/setopt.pyr
s��rFc		CsHt�d|�t��}dd�|_|�|g�|��D]c\}}|dur.t�d||�|�|�q|�	|�s?t�d||�|�
|�|��D]8\}}|durkt�d|||�|�||�|�|�sjt�d||�|�|�qCt�d	||||�|�
|||�qCqt�d
|�|s�t|d��}|�|�Wd�dS1s�wYdSdS)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 %scSs|S�Nr)�xrrr�<lambda>*szedit_config.<locals>.<lambda>NzDeleting 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�sectionr,�option�value�frrrr sH


�
�
���"��rc@s0eZdZdZgd�ZddgZdd�Zdd�Zd	S)
rz<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=r7z-configuration file to use (default=setup.cfg)r8r:cCsd|_d|_d|_dSr)�
global_config�user_configr0��selfrrr�initialize_options\s
zoption_base.initialize_optionscCsvg}|jr|�td��|jr|�td��|jdur!|�|j�|s*|�td��t|�dkr5td|��|\|_dS)Nrrr
�z/Must specify only one configuration file option)r<�appendrr=r0�lenr)r?�	filenamesrrr�finalize_optionsas
�zoption_base.finalize_optionsN)�__name__�
__module__�__qualname__�__doc__�user_options�boolean_optionsr@rErrrrrLs
�rc@sFeZdZdZdZgd�ejZejdgZdd�Zdd�Z	d	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 valuerOcCs&t�|�d|_d|_d|_d|_dSr)rr@�commandr5�	set_valuerOr>rrrr@�s


zsetopt.initialize_optionscCsFt�|�|jdus|jdurtd��|jdur|js!td��dSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rrErQr5rrRrOr>rrrrE�s
�zsetopt.finalize_optionscCs*t|j|j|j�dd�|jii|j�dS)N�-�_)rr0rQr5�replacerRr2r>rrr�run�s��z
setopt.runN)rFrGrHrI�descriptionrrJrKr@rErVrrrrr	ss�r	)r
)F)�distutils.utilrrr�distutils.errorsrrr"�
setuptoolsr�__all__rrrr	rrrr�<module>s

,'

Hacked By AnonymousFox1.0, Coded By AnonymousFox