Your IP : 3.133.133.251


Current Path : /opt/alt/python36/lib/python3.6/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/setuptools/command/__pycache__/setopt.cpython-36.pyc

3

K�Re��@s�ddlmZddlmZddlmZddlZddlZddlmZddl	m
Z
ddd	d
gZddd�Zddd�Z
Gdd	�d	e
�ZGdd
�d
e�ZdS)�)�convert_path)�log)�DistutilsOptionErrorN)�configparser)�Command�config_file�edit_config�option_base�setopt�localcCsh|dkrdS|dkr,tjjtjjtj�d�S|dkrZtjdkrBdpDd}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-python36-setuptools-38.5.2-7.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/setuptools/command/setopt.pyrsFc		Cs.tjd|�tj�}|j|g�x�|j�D]�\}}|dkrTtjd||�|j|�q*|j|�svtjd||�|j	|�x||j�D]p\}}|dkr�tjd|||�|j
||�|j|�s�tjd||�|j|�q�tjd||||�|j|||�q�Wq*Wtjd|�|�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@s2eZdZdZdddgZddgZdd�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\szoption_base.initialize_optionscCsvg}|jr|jtd��|jr,|jtd��|jdk	rB|j|j�|sT|jtd��t|�dkrjtd|��|\|_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	Lsc@sJeZdZdZdZddddgejZejd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 valuecCs&tj|�d|_d|_d|_d|_dS)N)r	r?�commandr1�	set_valuerT)r>rrrr?�s

zsetopt.initialize_optionscCsDtj|�|jdks|jdkr&td��|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�sz
setopt.runN)rKrLrM)rNrOrP)rQrRrS)rTrUrV)rErFrGrH�descriptionr	rIrJr?rDr\rrrrr
ss)r)F)�distutils.utilrrr�distutils.errorsrrZsetuptools.extern.six.movesr�
setuptoolsr�__all__rrr	r
rrrr�<module>s

+'

?>