�
��^i�" � �� � d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl m
Z
d dlmZm
Z
d dlmZmZmZmZ d dlmZ d dlmZ d d lmZmZ e j e� � Z G d
� de
� � ZdS )� N)�Values)�Any�List�Optional)�Command)�ERROR�SUCCESS)�
Configuration�Kind�get_configuration_files�kinds)�PipError)�
indent_log)�get_prog�write_outputc �v � e Zd ZdZdZdZdd�Zdedee de
fd �Zded
ede
e fd�Zdedee ddfd�Zdedee ddfd
�Zdedee ddfd�Zdedee ddfd�Zdedee ddfd�Zdeddfd�Zdd�Zdedee ddfd�Zdee de de
defd�Zdd�Zdede fd�ZdS )�ConfigurationCommandaa
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 to the user file by
default.
Ta
%prog [] list
%prog [] [--editor ] edit
%prog [] get name
%prog [] set name value
%prog [] unset name
%prog [] debug
�returnNc �> � | j � dddd d�� � | j � dddd d
�� � | j � dddd d
�� � | j � dddd d�� � | j � d| j � � d S )Nz--editor�editor�storez\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 )�cmd_opts�
add_option�parser�insert_option_group��selfs ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/commands/configuration.py�add_optionsz ConfigurationCommand.add_options4 s� � ��
� � �����9�
!�
�
�
�
�
� � �����>� !�
�
�
�
�
� � �����7� !�
�
�
�
�
� � �����F� !�
�
�
�
��'�'��4�=�9�9�9�9�9� �options�argsc �� � | j | j | j | j | j | j d�}|r
|d |vrBt � dd� t |� � � � � � t S |d } | � ||dv �� � }nC# t $ r6}t � |j
d � � t cY d }~S d }~ww xY wt |j |�� � | _ | j � � � || ||dd � � � nC# t $ r6}t � |j
d � � t cY d }~S d }~ww xY wt$ S ) N)�list�edit�get�set�unset�debugr zNeed an action (%s) to perform.z, )r. r/ r0 r- )�
need_value)�isolated� load_only� )�list_values�open_in_editor�get_name�set_name_value�
unset_name�list_config_values�logger�error�join�sortedr �_determine_filer r* r
�
isolated_mode�
configuration�loadr )r% r) r* �handlersr r4 �es r&