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.6/site-packages/pip/_internal/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.6/site-packages/pip/_internal/__pycache__/configuration.cpython-36.pyc
3

�N�aa3�@s>dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZddl
mZmZddlmZddlmZddlmZddlmZmZejZe
d	e�Zer�d
ndZdZedddddd�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*|j�jdd�}|jd�r&|dd�}|S)zAMake a name consistent regardless of source (environment or file)�_�-z--�N)�lower�replace�
startswith)r�r#�#/usr/lib/python3.6/configuration.py�_normalize_name2s
r%cCs&d|krdj|�}t|��|jdd�S)N�.zbKey does not contain dot separated section and key. Perhaps you wanted to use 'global.{}' instead?�)�formatr	�split)rZ
error_messager#r#r$�_disassemble_key:s
r*)rcCstdd�tjd�D�}tjjtjt�}tjjtjjd�t	r<dndt�}tjjtj
d�t�}tj|tj
|gtj||giS)NcSsg|]}tjj|t��qSr#)�os�path�join�CONFIG_BASENAME)�.0r,r#r#r$�
<listcomp>Fsz+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�j�|dk	r4|tkr4tdjdjttt�����||_||_	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$r;us)�super�__init__�VALID_LOAD_ONLYr	r(r-�map�reprr8r9�OVERRIDE_ORDER�_parsers�_config�_modified_parsers)�selfr8r9)�	__class__r#r$r=es


zConfiguration.__init__)rcCs|j�|js|j�dS)z<Loads configuration from configuration files and environmentN)�_load_config_filesr8�_load_environment_vars)rEr#r#r$�loadzszConfiguration.loadcCs8|jdk	std��y|j�dStk
r2dSXdS)z7Returns the file with highest priority in configurationNz)Need to be specified a file to be editingr)r9�AssertionError�_get_parser_to_modify�
IndexError)rEr#r#r$�get_file_to_edit�s
zConfiguration.get_file_to_editcCs
|jj�S)z`Returns key-value pairs like dict.items() representing the loaded
        configuration
        )�_dictionary�items)rEr#r#r$rO�szConfiguration.items)�keyrcCs2y
|j|Stk
r,td|����YnXdS)z#Get a value from the configuration.zNo such key - N)rN�KeyErrorr	)rErPr#r#r$�	get_value�s
zConfiguration.get_value)rP�valuercCst|j�|jst�|j�\}}|dk	rTt|�\}}|j|�sF|j|�|j|||�||j|j|<|j	||�dS)z$Modify a value in the configuration.N)
�_ensure_have_load_onlyr9rJrKr*�has_sectionZadd_section�setrC�_mark_as_modified)rErPrS�fname�parser�sectionrr#r#r$�	set_value�s


zConfiguration.set_valuecCs�|j�|jst�||j|jkr0td|����|j�\}}|dk	r�t|�\}}|j|�od|j||�sntd��|j	|�s�|j
|�|j||�|j|j|=dS)z#Unset a value in the configuration.zNo such key - Nz4Fatal Internal error [id=1]. Please report as a bug.)rTr9rJrCr	rKr*rUZ
remove_optionrOZremove_sectionrW)rErPrXrYrZrr#r#r$�unset_value�s


zConfiguration.unset_valuec
Cs\|j�xN|jD]D\}}tjd|�ttjj|��t|d��}|j	|�WdQRXqWdS)z!Save the current in-memory state.z
Writing to %s�wN)
rTrD�logger�inforr+r,�dirname�open�write)rErXrY�fr#r#r$�save�szConfiguration.savecCs$|jdkrtd��tjd|j�dS)Nz'Needed a specific file to be modifying.z$Will be working with %s variant only)r9r	r^�debug)rEr#r#r$rT�s
z$Configuration._ensure_have_load_onlycCs&i}xtD]}|j|j|�q
W|S)z3A dictionary representing the loaded configuration.)rA�updaterC)rEZretvalr:r#r#r$rN�s
zConfiguration._dictionarycCs�t|j��}|tjdd�tjgkr4tjd�dSxf|j�D]Z\}}xP|D]H}|j	dk	rt||j	krttjd||�qL|j
||�}|j|j||f�qLWq>WdS)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+�devnullr^rerOr9�
_load_filerB�append)rE�config_filesr:�filesrXrYr#r#r$rG�s
z Configuration._load_config_files)r:rXrcCsPtjd||�|j|�}x2|j�D]&}|j|�}|j|j|j||��q"W|S)Nz'For variant '%s', will try loading '%s')r^�verbose�_construct_parserZsectionsrOrCrf�_normalized_keys)rEr:rXrYrZrOr#r#r$rj�s

zConfiguration._load_file)rXrcCs�tj�}tjj|�r|y|j|�WnXtk
rNtdjt	j
d��|d��Yn.tjk
rz}zt|d��WYdd}~XnX|S)Nzcontains invalid {} charactersF)�reasonrX)�error)�configparser�RawConfigParserr+r,�exists�read�UnicodeDecodeErrorr
r(�locale�getpreferredencoding�Error)rErXrYrrr#r#r$ros
zConfiguration._construct_parsercCs"|jtjj|jd|j���dS)z.Loads configuration from environment variablesz:env:N)rCr5rrfrp�get_environ_vars)rEr#r#r$rHsz$Configuration._load_environment_vars)rZrOrcCs2i}x(|D] \}}|dt|�}|||<q
W|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%)rErZrOZ
normalizedr�valrPr#r#r$rp"s
zConfiguration._normalized_keysccsHxBtjj�D]4\}}|jd�r|dd�j�}|tkr||fVqWdS)z@Returns a generator with all environmental vars with prefix PIP_ZPIP_�N)r+�environrOr"r �ENV_NAMES_IGNORED)rErPr|rr#r#r$r{0s

zConfiguration.get_environ_varsccs�tjjdd�}|dk	r&tj|gfVntjgfVt�}tj|tjfV|job|o`tjj	|�}|rztj
|tj
fVtj|tjfVdS)zYields variant and configuration files associated with it.

        This should be treated like items of a dictionary.
        ZPIP_CONFIG_FILEN)r+r~�getr5rr6rr8r,rurr)rEZconfig_filerlZshould_load_user_configr#r#r$rh9szConfiguration.iter_config_files)r:rcCs
|j|S)z#Get values present in a config file)rC)rEr:r#r#r$�get_values_in_configWsz"Configuration.get_values_in_configcCs*|js
t�|j|j}|s"td��|dS)Nz4Fatal Internal error [id=2]. Please report as a bug.r'���)r9rJrBr	)rE�parsersr#r#r$rK[s
z#Configuration._get_parser_to_modify)rXrYrcCs"||f}||jkr|jj|�dS)N)rDrk)rErXrYZfile_parser_tupler#r#r$rWis
zConfiguration._mark_as_modifiedcCs|jj�d|j�d�S)N�(�))rF�__name__rN)rEr#r#r$�__repr__nszConfiguration.__repr__)N)%r��
__module__�__qualname__�__doc__�boolrrr=rI�strrMrrrrOrRr[r\rdrT�propertyrrNrGrtrjrorHrpr{rrhr�rKrWr��
__classcell__r#r#)rFr$r7Ws0	
	r7)rr),r�rsrxr+r2ZtypingrrrrrrrZpip._internal.exceptionsr	r
Zpip._internal.utilsrZpip._internal.utils.compatrZpip._internal.utils.loggingr
Zpip._internal.utils.miscrrrtr�rr.rr5rrrrrrAr>r�r^r%r*r6r7r#r#r#r$�<module>s6$



Youez - 2016 - github.com/yon3zu
LinuXploit