Submit
Path:
~
/
/
opt
/
alt
/
python310
/
lib
/
python3.10
/
site-packages
/
setuptools
/
command
/
__pycache__
/
File Content:
setopt.cpython-310.pyc
o y�Re� � @ s� d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZd dlm Z g d�Z ddd �Zddd�ZG d d� de �Z G dd� de �ZdS )� )�convert_path)�log)�DistutilsOptionErrorN)�Command)�config_file�edit_config�option_base�setopt�localc C sd | dkrdS | dkrt j�t j�tj�d�S | dkr-t jdkr!dp"d}t j�td | ��S t 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 �L/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/setopt.pyr s ��r Fc C sH t �d| � t�� }dd� |_|�| g� |�� D ]c\}}|du r.t �d|| � |�|� q|� |�s?t �d|| � |� |� |�� D ]8\}}|du rkt �d||| � |�||� |�|�sjt �d|| � |�|� qCt �d |||| � |� |||� qCqt �d | � |s�t| d��}|�|� W d � dS 1 s�w Y dS 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>* s 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&