ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyo

�
x�_c@@sdZddlmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZmZddlmZeje�Zd	ejfd
��YZdefd��YZd
ejfd��YZdefd��YZd�ZdS(sBase option parser setupi(tabsolute_importN(t	strtobool(tstring_types(t
UNKNOWN_ERROR(t
ConfigurationtConfigurationError(tget_terminal_sizetPrettyHelpFormattercB@s\eZdZd�Zd�Zddd�Zd�Zd�Zd�Zd	�Z	d
�Z
RS(s4A prettier/less verbose help formatter for optparse.cO@sCd|d<d|d<t�dd|d<tjj|||�dS(Nitmax_help_positionitindent_incrementiitwidth(RtoptparsetIndentedHelpFormattert__init__(tselftargstkwargs((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyR
s

cC@s
|j|�S(N(t_format_option_strings(Rtoption((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytformat_option_strings!ss <{}>s, cC@s�g}|jr&|j|jd�n|jrF|j|jd�nt|�dkrk|jd|�n|j�r�|jp�|jj�}|j|j	|j���ndj
|�S(s�
        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
        iit(t_short_optstappendt
_long_optstlentinsertttakes_valuetmetavartdesttlowertformattjoin(RRtmvarfmttoptseptoptsR((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyR$s		cC@s|dkrdS|dS(NtOptionsRs:
((Rtheading((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytformat_heading;scC@s(dj|jtj|�d��}|S(sz
        Ensure there is only one newline between usage and the first heading
        if there is no description.
        s
Usage: {}
s  (Rtindent_linesttextwraptdedent(Rtusagetmsg((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytformat_usage@scC@s{|rst|jd�r!d}nd}|jd�}|j�}|jtj|�d�}dj||�}|SdSdS(NtmaintCommandstDescriptions
s  s{}:
{}
R(thasattrtparsertlstriptrstripR&R'R(R(Rtdescriptiontlabel((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytformat_descriptionIs	cC@s|r
|SdSdS(NR((Rtepilog((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyt
format_epilog[scC@s3g|jd�D]}||^q}dj|�S(Ns
(tsplitR(Rttexttindenttlinet	new_lines((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyR&bs&(t__name__t
__module__t__doc__R
RRR%R+R5R7R&(((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRs							tUpdatingDefaultsHelpFormattercB@seZdZd�ZRS(s�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.
    cC@s;|jdk	r(|jj|jj�ntjj||�S(N(R0tNonet_update_defaultstdefaultsRRtexpand_default(RR((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRDns(R=R>R?RD(((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyR@gstCustomOptionParsercB@s eZd�Zed��ZRS(cO@s6|j||�}|jj�|jj||�|S(s*Insert an OptionGroup at a given position.(tadd_option_groupt
option_groupstpopR(RtidxRRtgroup((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytinsert_option_groupvs
cC@s2|j}x!|jD]}|j|j�qW|S(s<Get a list of all options, including those in option groups.(toption_listRGtextend(Rtresti((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytoption_list_alls
(R=R>RKtpropertyRP(((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyREts		tConfigOptionParsercB@sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(ssCustom option parser which updates its defaults by checking the
    configuration files and environmental variablescO@sM|jd�|_|jdt�}t|�|_tjj|||�dS(Ntnametisolated(RHRStFalseRtconfigRtOptionParserR
(RRRRT((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyR
�scC@sLy|j||�SWn1tjk
rG}dj|�GHtjd�nXdS(Ns*An error occurred during configuration: {}i(tcheck_valueRtOptionValueErrorRtsystexit(RRtkeytvaltexc((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyt
check_default�s
cc@s�d|jdg}d�|D�}xw|jj�D]f\}}|sZtjd|�q2n|jdd�\}}||kr2||j||f�q2q2Wx4|D],}x#||D]\}}||fVq�Wq�WdS(Ntglobals:env:cS@si|]}g|�qS(((t.0RS((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pys
<dictcomp>�s	s7Ignoring configuration key '%s' as it's value is empty.t.i(RSRVtitemstloggertdebugR8R(Rtoverride_ordert
section_itemstsection_keyR]tsectionR\((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyt _get_ordered_configuration_items�s
c
C@s�tj|j�|_t�}xy|j�D]k\}}|jd|�}|dkr\q+n|jdkr�yt	|�}Wq�t
k
r�t|j||�}|j|�q�Xn�|jdkr�|j
�}g|D]}|j|||�^q�}n�|jdkrt|j|j�|j�}|j||�}|jpCd	}	|jpRi}
|j|||||	|
�n|j|||�}|||j<q+Wx$|D]}t|j|�||<q�Wd|_|S(
s�Updates the given defaults with values from the config files and
        the environ. Does a little special handling for certain types of
        options (lists).s--t
store_truetstore_falsetcountRtcallbackN(RkRlscount((RtValuesRCtvaluestsetRjt
get_optionRAtactionRt
ValueErrortinvalid_config_error_messageterrorR8R_taddRtget_opt_stringt
convert_valuet
callback_argstcallback_kwargsRntgetattr(RRCt	late_evalR\R]Rt	error_msgtvtopt_strRR((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRB�s:	
+
	cC@s�|jstj|j�Sy|jj�Wn)tk
rU}|jtt	|��nX|j
|jj��}x]|j�D]O}|j
|j�}t|t�r{|j�}|j||�||j<q{q{Wtj|�S(s�Overriding to make updating the defaults after instantiation of
        the option parser possible, _update_defaults() does the dirty work.(tprocess_default_valuesRRoRCRVtloadRR[RtstrRBtcopyt_get_all_optionstgetRt
isinstanceRRxRX(RterrRCRtdefaultR�((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pytget_default_values�s	 cC@s-|jtj�|jtdj|��dS(Ns{}
(tprint_usageRZtstderrR[RR(RR*((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRv�s(	R=R>R?R
R_RjRBR�Rv(((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRR�s					1	cC@s,|dkrdj||�Sdj||�S(sQReturns a better error message when invalid configuration option
    is provided.RkRlso{0} is not a valid value for {1} option, please specify a boolean value like yes/no, true/false or 1/0 instead.s[{0} is not a valid value for {1} option, please specify a numerical value like 1/0 instead.(s
store_truesstore_false(R(RsR\R]((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyRus

(R?t
__future__RtloggingRRZR'tdistutils.utilRtpip._vendor.sixRtpip._internal.cli.status_codesRtpip._internal.configurationRRtpip._internal.utils.compatRt	getLoggerR=RdRRR@RWRERRRu(((sI/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/parser.pyt<module>s P
w

Zerion Mini Shell 1.0