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/cli/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�N�a$*�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZddlmZmZeje�ZGdd	�d	ej�ZGd
d�de�ZGdd
�d
ej�ZGdd�de�ZdS)zBase option parser setup�N)�suppress)�Any�Dict�Iterator�List�Tuple)�
UNKNOWN_ERROR)�
Configuration�ConfigurationError)�redact_auth_from_url�	strtoboolcs�eZdZdZeedd��fdd�Zejed�dd�Z	dejeeed�dd
�Z
eed�dd�Zeed�dd�Zeed�dd�Z
eed�dd�Zeeed�dd�Z�ZS)�PrettyHelpFormatterz4A prettier/less verbose help formatter for optparse.N)�args�kwargs�returncs6d|d<d|d<tj�dd|d<t�j||�dS)N��max_help_position��indent_incrementr��width)�shutil�get_terminal_size�super�__init__)�selfrr)�	__class__��/usr/lib/python3.6/parser.pyrszPrettyHelpFormatter.__init__)�optionrcCs
|j|�S)N)�_format_option_strings)rrrrr�format_option_stringssz)PrettyHelpFormatter.format_option_strings� <{}>�, )r�mvarfmt�optseprcCs�g}|jr|j|jd�|jr0|j|jd�t|�dkrH|jd|�|j�r�|jdk	s^t�|jpl|jj	�}|j|j
|j	���dj|�S)z�
        Return a comma-separated list of option strings and metavars.

        :param option:  tuple of (short opt, long opt), e.g: ('-f', '--format')
        :param mvarfmt: metavar format string
        :param optsep:  separator
        rrN�)Z_short_opts�appendZ
_long_opts�len�insertZtakes_value�dest�AssertionError�metavar�lower�format�join)rrr$r%Zoptsr,rrrr s
z*PrettyHelpFormatter._format_option_strings)�headingrcCs|dkrdS|dS)NZOptionsr&z:
r)rr0rrr�format_heading9sz"PrettyHelpFormatter.format_heading)�usagercCsdj|jtj|�d��}|S)zz
        Ensure there is only one newline between usage and the first heading
        if there is no description.
        z
Usage: {}
z  )r.�indent_lines�textwrap�dedent)rr2�msgrrr�format_usage>sz PrettyHelpFormatter.format_usage)�descriptionrcCsZ|rRt|jd�rd}nd}|jd�}|j�}|jtj|�d�}|�d|�d�}|SdSdS)N�mainZCommandsZDescription�
z  z:
r&)�hasattr�parser�lstrip�rstripr3r4r5)rr8Zlabelrrr�format_descriptionFs
z&PrettyHelpFormatter.format_description)�epilogrcCs|r|SdSdS)Nr&r)rr@rrr�
format_epilogXsz!PrettyHelpFormatter.format_epilog)�text�indentrcs"�fdd�|jd�D�}dj|�S)Ncsg|]}�|�qSrr)�.0�line)rCrr�
<listcomp>`sz4PrettyHelpFormatter.indent_lines.<locals>.<listcomp>r:)�splitr/)rrBrCZ	new_linesr)rCrr3_sz PrettyHelpFormatter.indent_lines)r"r#)�__name__�
__module__�__qualname__�__doc__rr�optparse�Option�strr!r r1r7r?rAr3�
__classcell__rr)rrr
s
r
cs*eZdZdZejed��fdd�Z�ZS)�UpdatingDefaultsHelpFormatterz�Custom help formatter for use in ConfigOptionParser.

    This is updates the defaults before expanding them, allowing
    them to show up correctly in the help listing.

    Also redact auth from url type options
    )rrcs�d}|jdk	rLt|jt�st�|jj|jj�|jdk	s<t�|jjj|j�}t�j	|�}|r�|j
dkr�t|t�rv|g}t|t�s�g}x|D]}|j
|t|��}q�W|S)NZURL)r<�
isinstance�ConfigOptionParserr+�_update_defaults�defaultsr*�getr�expand_defaultr,rN�list�replacer)rrZdefault_values�	help_text�val)rrrrVms



z,UpdatingDefaultsHelpFormatter.expand_default)	rHrIrJrKrLrMrNrVrOrr)rrrPdsrPc@s:eZdZeeeejd�dd�Zee	ej
d�dd��ZdS)�CustomOptionParser)�idxrrrcOs(|j||�}|jj�|jj||�|S)z*Insert an OptionGroup at a given position.)Zadd_option_group�
option_groups�popr))rr\rr�grouprrr�insert_option_group�s
z&CustomOptionParser.insert_option_group)rcCs.|jdd�}x|jD]}|j|j�qW|S)z<Get a list of all options, including those in option groups.N)Zoption_listr]�extend)r�res�irrr�option_list_all�sz"CustomOptionParser.option_list_allN)rHrIrJ�intrrLZOptionGroupr`�propertyrrMrdrrrrr[�s	r[cs�eZdZdZdd�eeeedd��fdd�Zej	eeed�d	d
�Z
eeeefd�dd
�Z
eeefeeefd�dd�Zejd�dd�Zedd�dd�Z�ZS)rRzsCustom option parser which updates its defaults by checking the
    configuration files and environmental variablesF)�isolatedN)r�namergrrcs,||_t|�|_|jst�t�j||�dS)N)rhr	�configr+rr)rrhrgrr)rrrr�s

zConfigOptionParser.__init__)r�keyrZrcCsNy|j||�Stjk
rH}ztd|���tjd�WYdd}~XnXdS)Nz(An error occurred during configuration: �)�check_valuerLZOptionValueError�print�sys�exit)rrrjrZ�excrrr�
check_default�s
z ConfigOptionParser.check_default)rccs�d|jdg}dd�|D�}xR|jj�D]D\}}|s@tjd|�q&|jdd�\}}||kr&||j||f�q&Wx,|D]$}x||D]\}}||fVq�WqtWdS)N�globalz:env:cSsi|]
}g|�qSrr)rDrhrrr�
<dictcomp>�szGConfigOptionParser._get_ordered_configuration_items.<locals>.<dictcomp>z7Ignoring configuration key '%s' as it's value is empty.�.r)rhri�items�logger�debugrGr')rZoverride_orderZ
section_itemsZsection_keyrZ�sectionrjrrr� _get_ordered_configuration_items�s
z3ConfigOptionParser._get_ordered_configuration_items)rTrcs�tj�j��_t�}�x��j�D�]�\�}�jd����dkrBq �jdk	sPt��j	d
kr�yt
|�}Wn&tk
r��jdj
|���YnX�n�j	dk�rtt��t
|�}WdQRXtt��t|�}WdQRXt|t�s�|dk�r��jdj
|���n��j	d	k�r,|j�}���fd
d�|D�}n|�j	dk�r��jdk	�sHt�|j�j��j�}�j||�}�j�prf}�j�p~i}�j�||�f|�|�n�j��|�}||�j<q Wx|D]�t�j��|�<�q�Wd�_|S)z�Updates the given defaults with values from the config files and
        the environ. Does a little special handling for certain types of
        options (lists).z--N�
store_true�store_falsezm{} is not a valid value for {} option, please specify a boolean value like yes/no, true/false or 1/0 instead.�countrz�{} is not a valid value for {} option, please instead specify either a non-negative integer or a boolean value like yes/no or false/true which is equivalent to 1/0.r'csg|]}�j��|��qSr)rq)rD�v)rjrrrrrF�sz7ConfigOptionParser._update_defaults.<locals>.<listcomp>�callback)rzr{)rL�ValuesrT�values�setryZ
get_optionr*r+�actionr�
ValueError�errorr.rrerQrGr~�add�get_opt_stringZ
convert_valueZ
callback_argsZcallback_kwargsrq�getattr)rrTZ	late_evalrZ�opt_strrrr)rjrrrrS�sP



z#ConfigOptionParser._update_defaultscCs�|jstj|j�Sy|jj�Wn2tk
rR}z|jtt	|��WYdd}~XnX|j
|jj��}xN|j�D]B}|j
dk	s�t�|j|j
�}t|t	�rn|j�}|j||�||j
<qnWtj|�S)z�Overriding to make updating the defaults after instantiation of
        the option parser possible, _update_defaults() does the dirty work.N)Zprocess_default_valuesrLrrTri�loadr
rorrNrS�copyZ_get_all_optionsr*r+rUrQr�rl)r�errrTr�defaultr�rrr�get_default_valuess"
z%ConfigOptionParser.get_default_values)r6rcCs"|jtj�|jt|�d��dS)Nr:)�print_usagern�stderrror)rr6rrrr�"szConfigOptionParser.error)rHrIrJrKrrN�boolrrLrMrqrrryrrSrr�r�rOrr)rrrR�s @rR)rKZloggingrLrrnr4�
contextlibrZtypingrrrrrZpip._internal.cli.status_codesrZpip._internal.configurationr	r
Zpip._internal.utils.miscrrZ	getLoggerrHrvZIndentedHelpFormatterr
rPZOptionParserr[rRrrrr�<module>s
R 

Youez - 2016 - github.com/yon3zu
LinuXploit