|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python39/lib/python3.9/site-packages/setuptools/command/__pycache__/ |
Upload File : |
a
�5�a� � @ 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 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)�kind�dot� r �J/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/setopt.pyr
s ��r Fc C sF t �d| � t�� }dd� |_|�| g� |�� D ]�\}}|du r\t �d|| � |�|� q2|� |�s~t �d|| � |�
|� |�� D ]p\}}|du r�t �d||| � |�||� |�|�s�t �d|| � |�|� q�t �d |||| � |�
|||� q�q2t �d
| � |�sBt| d��}|�|� W d � n1 �s80 Y 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'