ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python33/lib/python3.3/site-packages/pip/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyc

�
�2{Yc@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
mZddlmZdejfd	��YZd
efd��YZdejfd
��YZdefd��YZdS(sBase option parser setupi����N(t	strtobool(tConfigParsertstring_types(tdefault_config_file(tget_terminal_sizetget_prog(t
pkg_resourcestPrettyHelpFormattercBs\eZdZd�Zd�Zddd�Zd�Zd�Zd�Zd	�Z	d
�Z
RS(s4A prettier/less verbose help formatter for optparse.cOsCd|d<d|d<t�dd|d<tjj|||�dS(Nitmax_help_positionitindent_incrementiitwidth(RtoptparsetIndentedHelpFormattert__init__(tselftargstkwargs((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyR
s

cCs|j|dd�S(Ns <%s>s, (t_format_option_strings(Rtoption((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytformat_option_stringsss <%s>s, cCs�g}|jr&|j|jd�n|jrF|j|jd�nt|�dkrk|jd|�n|j�r�|jp�|jj�}|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 - evaluated as mvarfmt % metavar
        :param optsep:  separator
        iit(
t_short_optstappendt
_long_optstlentinsertttakes_valuetmetavartdesttlowertjoin(RRtmvarfmttoptseptoptsR((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRs		cCs|dkrdS|dS(NtOptionsRs:
((Rtheading((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytformat_heading3scCs#d|jtj|�d�}|S(sz
        Ensure there is only one newline between usage and the first heading
        if there is no description.
        s
Usage: %s
s  (tindent_linesttextwraptdedent(Rtusagetmsg((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytformat_usage8scCsy|rqt|jd�r!d}nd}|jd�}|j�}|jtj|�d�}d||f}|SdSdS(NtmaintCommandstDescriptions
s  s%s:
%s
R(thasattrtparsertlstriptrstripR%R&R'(Rtdescriptiontlabel((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytformat_description@s	cCs|r
|SdSdS(NR((Rtepilog((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyt
format_epilogRscCs3g|jd�D]}||^q}dj|�S(Ns
(tsplitR(Rttexttindenttlinet	new_lines((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyR%Ys&(t__name__t
__module__t__doc__R
RRR$R*R4R6R%(((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRs						tUpdatingDefaultsHelpFormattercBseZdZd�ZRS(s�Custom help formatter for use in ConfigOptionParser that updates
    the defaults before expanding them, allowing them to show up correctly
    in the help listingcCs;|jdk	r(|jj|jj�ntjj||�S(N(R/tNonetupdate_defaultstdefaultsRRtexpand_default(RR((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRCcs(R<R=R>RC(((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyR?^stCustomOptionParsercBs eZd�Zed��ZRS(cOs6|j||�}|jj�|jj||�|S(s*Insert an OptionGroup at a given position.(tadd_option_groupt
option_groupstpopR(RtidxRRtgroup((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytinsert_option_groupjs
cCs2|j}x!|jD]}|j|j�qW|S(s<Get a list of all options, including those in option groups.(toption_listRFtextend(Rtresti((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytoption_list_allss
(R<R=RJtpropertyRO(((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRDis		tConfigOptionParsercBsbeZdZd�Zd�Zd�Zd�Zd�Zd�Zdd�Z	d	�Z
d
�ZRS(ssCustom option parser which updates its defaults by checking the
    configuration files and environmental variablescOsxtj�|_|jd�|_|j�|_|jrO|jj|j�n|js^t�t	j
j|||�dS(Ntname(RtRawConfigParsertconfigRGRRtget_config_filestfilestreadtAssertionErrorRtOptionParserR
(RRR((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyR
�s	cCsNtjjdt�}|tjkr(gS|rGtjj|�rG|gStgS(NtPIP_CONFIG_FILE(tostenvirontgettFalsetdevnulltpathtexistsR(Rtconfig_file((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRU�scCsUy|j||�SWn:tjk
rPtj�d}d|GHtjd�nXdS(Nis*An error occurred during configuration: %si(tcheck_valueRtOptionValueErrortsystexc_infotexit(RRtkeytvalte((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyt
check_default�s	cCs,i}x6d|jfD]%}|j|j|j|���qW|j|j|j���x�|j�D]�\}}|j|�}|dk	rh|s�qhn|jdkr�t	|�}n|jdkr�|j
�}g|D]}|j|||�^q�}n|j|||�}|||j<qhqhW|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).tglobalt
store_truetstore_falsetcountRN(RmRnscount(
RRtupdatetnormalize_keystget_config_sectiontget_environ_varstitemst
get_optionR@tactionRR7RkR(RRBRTtsectionRhRiRtv((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRA�s"#+cCsYi}xL|D]D\}}|jdd�}|jd�sGd|}n|||<q
W|S(s�Return a config dictionary with normalized keys regardless of
        whether the keys were specified in environment variables or in config
        filest_t-s--s--%s(treplacet
startswith(RRtt
normalizedRhRi((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRq�s
cCs&|jj|�r"|jj|�SgS(s Get a section of a configuration(RTthas_sectionRt(RRR((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRr�stPIP_ccsSxLtjj�D];\}}|j|�r|j|d�j�|fVqqWdS(s@Returns a generator with all environmental vars with prefix PIP_RN(R[R\RtR|R{R(RtprefixRhRi((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRs�scCs�|jstj|j�S|j|jj��}x]|j�D]O}|j|j�}t	|t
�r>|j�}|j||�||j<q>q>Wtj|�S(s�Overridding to make updating the defaults after instantiation of
        the option parser possible, update_defaults() does the dirty work.(
tprocess_default_valuesRtValuesRBRAtcopyt_get_all_optionsR]Rt
isinstanceRtget_opt_stringRc(RRBRtdefaulttopt_str((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pytget_default_values�s	 cCs(|jtj�|jdd|�dS(Nis%s
(tprint_usageRetstderrRg(RR)((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyterror�s(R<R=R>R
RURkRARqRrRsR�R�(((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyRQ}s								(R>ReRR[R&tdistutils.utilRtpip.backwardcompatRRt
pip.locationsRtpip.utilRRtpip._vendorRRRR?RYRDRQ(((s?/opt/alt/python33/lib/python3.3/site-packages/pip/baseparser.pyt<module>sO

Zerion Mini Shell 1.0