File: //usr/lib/python3.9/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-39.pyc
a
?�f�$ � @ s� d dl Z d dlZd dlZd dlmZ d dlmZmZ d dlm Z m
Z
mZ d dlm
Z
d dlmZ d dlmZmZ d dlmZ er�d d lmZmZmZ d d
lmZ d dlmZ e �e�ZG dd
� d
e�ZdS )� N)�Command)�ERROR�SUCCESS)�
Configuration�get_configuration_files�kinds)�PipError)�
indent_log)�get_prog�write_output)�MYPY_CHECK_RUNNING)�List�Any�Optional)�Values)�Kindc @ s� e Zd ZdZdZdZdd� Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd S )!�ConfigurationCommandah
Manage local and global configuration.
Subcommands:
- list: List the active configuration (or from the file specified)
- edit: Edit the configuration file in an editor
- get: Get the value associated with name
- set: Set the name=value
- unset: Unset the value associated with name
- debug: List the configuration files and values defined under them
If none of --user, --global and --site are passed, a virtual
environment configuration file is used if one is active and the file
exists. Otherwise, all modifications happen on the to the user file by
default.
Ta
%prog [<file-option>] list
%prog [<file-option>] [--editor <editor-path>] edit
%prog [<file-option>] get name
%prog [<file-option>] set name value
%prog [<file-option>] unset name
%prog [<file-option>] debug
c C sl | j jdddd dd� | j jdddd d
d� | j jdddd d
d� | j jdddd dd� | j�d| j � d S )Nz--editor�editorZstorez\Editor to use to edit the file. Uses VISUAL or EDITOR environment variables if not provided.)�dest�action�default�helpz--global�global_file�
store_trueFz+Use the system-wide configuration file onlyz--user� user_filez$Use the user configuration file onlyz--site� site_filez3Use the current environment configuration file onlyr )Zcmd_optsZ
add_option�parserZinsert_option_group��self� r �H/usr/lib/python3.9/site-packages/pip/_internal/commands/configuration.py�add_options8 s: ����z ConfigurationCommand.add_optionsc
C s | j | j| j| j| j| jd�}|r.|d |vrHt�dd�t |��� t
S |d }z| j||dv d�}W n8 ty� } z t�|j
d � t
W Y d }~S d }~0 0 t|j|d�| _| j�� z|| ||dd � � W n: t�y } z t�|j
d � t
W Y d }~S d }~0 0 tS ) N)�list�edit�get�set�unset�debugr zNeed an action (%s) to perform.z, )r$ r% r&