Your IP : 3.147.57.239


Current Path : /opt/alt/python35/lib/python3.5/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/setuptools/command/__pycache__/setopt.cpython-35.pyc



�Re��@s�ddlmZddlmZddlmZddlZddlZddlmZddl	m
Z
ddd	d
gZddd�Zd
dd�Z
Gdd	�d	e
�ZGdd
�d
e�ZdS)�)�convert_path)�log)�DistutilsOptionErrorN)�configparser)�Command�config_file�edit_config�option_base�setopt�localcCs�|dkrdS|dkr>tjjtjjtj�d�S|dkrtjdkr_dpbd}tjjtd	|��St	d
|��dS)z�Get the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    rz	setup.cfg�globalz
distutils.cfg�user�posix�.�z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N)
�os�path�join�dirname�	distutils�__file__�name�
expanduserr�
ValueError)�kind�dot�r��/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/setopt.pyrs	Fc		Cs�tjd|�tj�}|j|g�x%|j�D]\}}|dkrttjd||�|j|�q9|j|�s�tjd||�|j	|�x�|j�D]�\}}|dkr tjd|||�|j
||�|j|�sLtjd||�|j|�q�tjd||||�|j|||�q�Wq9Wtjd|�|s�t
|d	��}|j|�WdQRXdS)
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 %sNzDeleting 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�debugr�RawConfigParser�read�items�info�remove_section�has_section�add_section�
remove_option�options�set�open�write)	�filename�settings�dry_run�opts�sectionr(�option�value�frrrr!s8

	
c@sIeZdZdZdddgZddgZdd�Zd
d�ZdS)r	z<Abstract base class for commands that mess with config files�
global-config�g�0save options to the site-wide distutils.cfg file�user-config�u�7save options to the current user's pydistutils.cfg file�	filename=r3�-configuration file to use (default=setup.cfg)cCsd|_d|_d|_dS)N)�
global_config�user_configr,)�selfrrr�initialize_options\s		zoption_base.initialize_optionscCs�g}|jr"|jtd��|jr>|jtd��|jdk	r]|j|j�|sv|jtd��t|�dkr�td|��|\|_dS)Nrr
r�z/Must specify only one configuration file option)r<�appendrr=r,�lenr)r>�	filenamesrrr�finalize_optionsas			zoption_base.finalize_optionsN)r4r5r6)r7r8r9)r:r3r;)�__name__�
__module__�__qualname__�__doc__�user_options�boolean_optionsr?rDrrrrr	Ls	c@sieZdZdZdZddddgejZejdgZdd�Zdd�Z	dd�Z
dS)r
z#Save command-line options to a filez1set an option in setup.cfg or another config file�command=�c�command to set an option for�option=�o�
option to set�
set-value=�s�value of the option�remove�r�remove (unset) the valuecCs5tj|�d|_d|_d|_d|_dS)N)r	r?�commandr1�	set_valuerT)r>rrrr?�s

			zsetopt.initialize_optionscCs`tj|�|jdks+|jdkr7td��|jdkr\|jr\td��dS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r	rDrWr1rrXrT)r>rrrrD�s

zsetopt.finalize_optionscCs;t|j|j|jjdd�|jii|j�dS)N�-�_)rr,rWr1�replacerXr.)r>rrr�run�s$z
setopt.runN)rKrLrM)rNrOrP)rQrRrS)rTrUrV)rErFrGrH�descriptionr	rIrJr?rDr\rrrrr
ss
)�distutils.utilrrr�distutils.errorsrrZsetuptools.extern.six.movesr�
setuptoolsr�__all__rrr	r
rrrr�<module>s+'

?>