403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/pip/_internal/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pip/_internal/__pycache__/configuration.cpython-39.pyc
a

W��e�6�@s>dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZddl
mZmZddlmZddlmZddlmZddlmZmZejZe
d	e�Zer�d
ndZdZed
ddddd�Zejej ej!ej"ej#fZ$ej ejej!fZ%ee&�Z'eed�dd�Z(ee	ed�dd�Z)eee	efd�dd�Z*Gdd�d�Z+dS)aConfiguration management setup

Some terminology:
- name
  As written in config files.
- value
  Value associated with a name
- key
  Name combined with it's section (section.name)
- variant
  A single word describing where the configuration key-value pair came from
�N)�Any�Dict�Iterable�List�NewType�Optional�Tuple)�ConfigurationError�!ConfigurationFileCouldNotBeLoaded)�appdirs)�WINDOWS)�	getLogger)�
ensure_dir�enum�Kindzpip.inizpip.conf)�version�help�user�globalZsite�envzenv-var)�USER�GLOBAL�SITE�ENV�ENV_VAR)�name�returncCs*|���dd�}|�d�r&|dd�}|S)zAMake a name consistent regardless of source (environment or file)�_�-z--�N)�lower�replace�
startswith)r�r#�?/usr/lib/python3.9/site-packages/pip/_internal/configuration.py�_normalize_name2s
r%cCs(d|vrd|�d�}t|��|�dd�S)N�.zVKey does not contain dot separated section and key. Perhaps you wanted to use 'global.z
' instead?�)r	�split)rZ
error_messager#r#r$�_disassemble_key:s��r)�rcCstdd�t�d�D�}tj�tjt�}tj�tj�d�t	r<dndt�}tj�t�
d�t�}tj|tj
|gtj||giS)NcSsg|]}tj�|t��qSr#)�os�path�join�CONFIG_BASENAME)�.0r,r#r#r$�
<listcomp>Esz+get_configuration_files.<locals>.<listcomp>Zpip�~z.pip)rZsite_config_dirsr+r,r-�sys�prefixr.�
expanduserrZuser_config_dir�kindsrrr)Zglobal_config_filesZsite_config_fileZlegacy_config_fileZnew_config_filer#r#r$�get_configuration_filesDs�

�
�r6cs�eZdZdZd6eeedd��fdd�
Zdd�dd�Zee	d�d	d
�Z
eee	e
fd�dd�Ze	e
d
�dd�Ze	e
dd�dd�Ze	dd
�dd�Zdd�dd�Zdd�dd�Zeee	e
fd�dd��Zdd�dd�Zee	ed�dd�Ze	ed �d!d"�Zdd�d#d$�Ze	eee	e
fee	e
fd%�d&d'�Zeee	e	fd�d(d)�Zeeeee	fd�d*d+�Zeee	e
fd,�d-d.�Z ee	efd�d/d0�Z!e	edd1�d2d3�Z"e	d�d4d5�Z#�Z$S)7�
Configurationa�Handles management of configuration.

    Provides an interface to accessing and managing configuration files.

    This class converts provides an API that takes "section.key-name" style
    keys and stores the value associated with it as "key-name" under the
    section "section".

    This allows for a clean interface wherein the both the section and the
    key-name are preserved in an easy to manage form in the configuration files
    and the data stored is also nice.
    N)�isolated�	load_onlyrcsjt���|dur4|tvr4td�d�ttt�����||_||_	dd�t
D�|_dd�t
D�|_g|_
dS)Nz5Got invalid value for load_only - should be one of {}z, cSsi|]
}|g�qSr#r#�r/�variantr#r#r$�
<dictcomp>rsz*Configuration.__init__.<locals>.<dictcomp>cSsi|]
}|i�qSr#r#r:r#r#r$r<us)�super�__init__�VALID_LOAD_ONLYr	�formatr-�map�reprr8r9�OVERRIDE_ORDER�_parsers�_config�_modified_parsers)�selfr8r9��	__class__r#r$r>es 
����zConfiguration.__init__r*cCs|��|js|��dS)z<Loads configuration from configuration files and environmentN)�_load_config_filesr8�_load_environment_vars�rGr#r#r$�loadzszConfiguration.loadcCs:|jdusJd��z|��dWSty4YdS0dS)z7Returns the file with highest priority in configurationNz)Need to be specified a file to be editingr)r9�_get_parser_to_modify�
IndexErrorrLr#r#r$�get_file_to_edit�s
zConfiguration.get_file_to_editcCs
|j��S)z`Returns key-value pairs like dict.items() representing the loaded
        configuration
        )�_dictionary�itemsrLr#r#r$rR�szConfiguration.items)�keyrcCsF|}t|�}z|j|WSty@t|�td|����Yn0dS)z#Get a value from the configuration.�No such key - N)r%rQ�KeyErrorr)r	)rGrS�orig_keyr#r#r$�	get_value�szConfiguration.get_value)rS�valuercCs|t|�}|��|jsJ�|��\}}|dur\t|�\}}|�|�sN|�|�|�|||�||j|j|<|�	||�dS)z$Modify a value in the configuration.N)
r%�_ensure_have_load_onlyr9rNr)�has_sectionZadd_section�setrE�_mark_as_modified)rGrSrX�fname�parser�sectionrr#r#r$�	set_value�s


zConfiguration.set_valuecCs�|}t|�}|��|jsJ�||j|jvr<td|����|��\}}|dur�t|�\}}|�|�rr|�||�sztd��|�	|�s�|�
|�|�||�|j|j|=dS)z#Unset a value in the configuration.rTNz4Fatal Internal error [id=1]. Please report as a bug.)r%rYr9rEr	rNr)rZZ
remove_optionrRZremove_sectionr\)rGrSrVr]r^r_rr#r#r$�unset_value�s(
�
��

zConfiguration.unset_valuecCs�|��|jD]�\}}t�d|�ttj�|��z8t|d��}|�	|�Wd�n1s^0YWqt
y�}z td|�d|����WYd}~qd}~00qdS)z!Save the current in-memory state.z
Writing to %s�wNz:An error occurred while writing to the configuration file z: )rYrF�logger�inforr+r,�dirname�open�write�OSErrorr	)rGr]r^�f�errorr#r#r$�save�s,���zConfiguration.savecCs$|jdurtd��t�d|j�dS)Nz'Needed a specific file to be modifying.z$Will be working with %s variant only)r9r	rc�debugrLr#r#r$rY�s
z$Configuration._ensure_have_load_onlycCs"i}tD]}|�|j|�q|S)z3A dictionary representing the loaded configuration.)rC�updaterE)rGZretvalr;r#r#r$rQ�szConfiguration._dictionarycCs�t|���}|tjdd�tjgkr4t�d�dS|��D]V\}}|D]H}|j	durp||j	krpt�d||�qH|�
||�}|j|�||f�qHq<dS)z,Loads configuration from configuration filesrr'zZSkipping loading configuration files due to environment's PIP_CONFIG_FILE being os.devnullNz Skipping file '%s' (variant: %s))
�dict�iter_config_filesr5rr+�devnullrcrlrRr9�
_load_filerD�append)rG�config_filesr;�filesr]r^r#r#r$rJ�s�z Configuration._load_config_files)r;r]rcCsLt�d||�|�|�}|��D]&}|�|�}|j|�|�||��q |S)Nz'For variant '%s', will try loading '%s')rc�verbose�_construct_parserZsectionsrRrErm�_normalized_keys)rGr;r]r^r_rRr#r#r$rqs

zConfiguration._load_file)r]rc
Cs�t��}tj�|�r�t�d�}z|j||d�WnTtyVt	d|�d�|d��Yn0tj
y�}zt	|d��WYd}~n
d}~00|S)NF)�encodingzcontains invalid z characters)�reasonr])rj)�configparser�RawConfigParserr+r,�exists�locale�getpreferredencoding�read�UnicodeDecodeErrorr
�Error)rGr]r^Zlocale_encodingrjr#r#r$rvs

�
 zConfiguration._construct_parsercCs"|jtj�|�d|����dS)z.Loads configuration from environment variablesz:env:N)rEr5rrmrw�get_environ_varsrLr#r#r$rK*s�z$Configuration._load_environment_vars)r_rRrcCs.i}|D] \}}|dt|�}|||<q|S)z�Normalizes items to construct a dictionary with normalized keys.

        This routine is where the names become keys and are made the same
        regardless of source - configuration files or environment.
        r&)r%)rGr_rRZ
normalizedr�valrSr#r#r$rw0s

zConfiguration._normalized_keysccsDtj��D]4\}}|�d�r
|dd���}|tvr
||fVq
dS)z@Returns a generator with all environmental vars with prefix PIP_ZPIP_�N)r+�environrRr"r �ENV_NAMES_IGNORED)rGrSr�rr#r#r$r�>s

zConfiguration.get_environ_varsccs�tj�dd�}t�}tj|tjfV|jo>|o<tj�|�}|rVtj	|tj	fVtj
|tj
fV|dur�tj|gfVntjgfVdS)a�Yields variant and configuration files associated with it.

        This should be treated like items of a dictionary. The order
        here doesn't affect what gets overridden. That is controlled
        by OVERRIDE_ORDER. However this does control the order they are
        displayed to the user. It's probably most ergononmic to display
        things in the same order as OVERRIDE_ORDER
        ZPIP_CONFIG_FILEN)r+r��getr6r5rr8r,r|rrr)rGZenv_config_filersZshould_load_user_configr#r#r$roGs�zConfiguration.iter_config_files)r;rcCs
|j|S)z#Get values present in a config file)rE)rGr;r#r#r$�get_values_in_configgsz"Configuration.get_values_in_configcCs*|js
J�|j|j}|s"td��|dS)Nz4Fatal Internal error [id=2]. Please report as a bug.���)r9rDr	)rG�parsersr#r#r$rNks
�z#Configuration._get_parser_to_modify)r]r^rcCs"||f}||jvr|j�|�dS)N)rFrr)rGr]r^Zfile_parser_tupler#r#r$r\ys
zConfiguration._mark_as_modifiedcCs|jj�d|j�d�S)N�(�))rI�__name__rQrLr#r#r$�__repr__~szConfiguration.__repr__)N)%r��
__module__�__qualname__�__doc__�boolrrr>rM�strrPrrrrRrWr`rarkrY�propertyrrQrJr{rqrvrKrwr�rror�rNr\r��
__classcell__r#r#rHr$r7Ws2
	

�	 r7),r�rzr}r+r2�typingrrrrrrrZpip._internal.exceptionsr	r
Zpip._internal.utilsrZpip._internal.utils.compatrZpip._internal.utils.loggingr
Zpip._internal.utils.miscrrr{r�rr.r�r5rrrrrrCr?r�rcr%r)r6r7r#r#r#r$�<module>s8
$
�


Youez - 2016 - github.com/yon3zu
LinuXploit