%PDF- %PDF-
Direktori : /opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/ |
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/setopt.cpython-37.pyc |
B ��a� � @ s� d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dlm Z dddd gZ ddd�Zdd d�ZG dd� de �Z G dd � d e �ZdS )� )�convert_path)�log)�DistutilsOptionErrorN)�Command�config_file�edit_config�option_base�setopt�localc C sh | dkrdS | dkr,t j�t j�tj�d�S | dkrZt jdkrBdpDd}t j�td | ��S t d | ��dS )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'N) �os�path�join�dirname� distutils�__file__�name� expanduserr � ValueError)Zkind�dot� r �J/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/setopt.pyr s Fc C s8 t �d| � t�� }dd� |_|�| g� x�|�� D ]�\}}|dkr^t �d|| � |�|� q4|� |�s�t �d|| � |� |� x||�� D ]p\}}|dkr�t �d||| � |�||� |�|�s�t �d|| � |�|� q�t �d |||| � |� |||� q�W q4W t �d | � |�s4t| d��}|�|� W dQ R X dS )aY Edit 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 s | S )Nr )�xr r r �<lambda>* � zedit_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�configparserZRawConfigParserZoptionxform�read�items�infoZremove_sectionZhas_sectionZadd_sectionZ remove_option�options�set�open�write) �filenameZsettings�dry_runZoptsZsectionr% �option�value�fr r r r s: c @ s2 e Zd ZdZdddgZddgZdd� Zd d � ZdS )r z<Abstract base class for commands that mess with config files)z global-config�gz0save options to the site-wide distutils.cfg file)zuser-config�uz7save options to the current user's pydistutils.cfg file)z filename=r- z-configuration file to use (default=setup.cfg)z global-configzuser-configc C s d | _ d | _d | _d S )N)� global_config�user_configr) )�selfr r r �initialize_options\ s zoption_base.initialize_optionsc C sv g }| j r|�td�� | jr,|�td�� | jd k rB|�| j� |sT|�td�� t|�dkrjtd|��|\| _d S )Nr r r � z/Must specify only one configuration file option)r0 �appendr r1 r) �lenr )r2 � filenamesr r r �finalize_optionsa s zoption_base.finalize_optionsN)�__name__� __module__�__qualname__�__doc__�user_options�boolean_optionsr3 r8 r r r r r L s c @ sJ e Zd ZdZdZddddgej Zejdg Zdd � Zd d� Z dd � 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 valuerB c C s&