OwlCyberSecurity - MANAGER
Edit File: configuration.cpython-38.pyc
U ʗRe% � @ s� 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 �e�ZG d d� de �ZdS )� N)�Values)�Any�List�Optional)�Command)�ERROR�SUCCESS)� Configuration�Kind�get_configuration_files�kinds)�PipError)� indent_log)�get_prog�write_outputc @ s* e Zd ZdZdZdZdd�dd�Zeee e d�d d �Zeee e d�dd �Zeee dd�dd�Zeee dd�dd�Zeee dd�dd�Zeee dd�dd�Zeee dd�dd�Zedd�dd�Zdd�dd�Zeee dd�dd�Zee e e ed�d d!�Zdd�d"d#�Zee d$�d%d&�ZdS )'�ConfigurationCommanda� 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 command.option - set: Set the command.option=value - unset: Unset the value associated with command.option - debug: List the configuration files and values defined under them Configuration keys should be dot separated command and option name, with the special prefix "global" affecting any command. For example, "pip config set global.index-url https://example.org/" would configure the index url for all commands, but "pip config set download.timeout 10" would configure a 10 second timeout only for "pip download" commands. 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 [<file-option>] list %prog [<file-option>] [--editor <editor-path>] edit %prog [<file-option>] get command.option %prog [<file-option>] set command.option value %prog [<file-option>] unset command.option %prog [<file-option>] debug N)�returnc C sl | j jdddd dd� | j jdddd d d� | j jdddd d d� | j jdddd dd� | 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��self� r# ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/commands/configuration.py�add_options: s: ����z ConfigurationCommand.add_options)�options�argsr c C s | j | j| j| j| j| jd�}|r.|d |krHt�dd�t |��� t S |d }z| j||dkd�}W n: tk r� } zt�|j d � t W Y �S d }~X Y nX t|j|d�| _| j�� z|| ||dd � � W n< tk �r } zt�|j d � t W Y �S d }~X Y nX tS ) N)�list�edit�get�set�unset�debugr zNeed an action (%s) to perform.z, )r* r+ r, 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'