ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyc

�
x�_c@sddlZddlZddlZddlmZddlmZmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZmZddlmZer�dd	lmZmZmZdd
lmZddlmZneje�Zdefd
��YZdS(i����N(tCommand(tERRORtSUCCESS(t
Configurationtget_configuration_filestkinds(tPipError(t
indent_log(tget_progtwrite_output(tMYPY_CHECK_RUNNING(tListtAnytOptional(tValues(tKindtConfigurationCommandcBs�eZdZeZdZd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�ZRS(sh
    Manage local and global configuration.

    Subcommands:

    - list: List the active configuration (or from the file specified)
    - edit: Edit the configuration file in an editor
    - get: Get the value associated with name
    - set: Set the name=value
    - unset: Unset the value associated with name
    - debug: List the configuration files and values defined under them

    If none of --user, --global and --site are passed, a virtual
    environment configuration file is used if one is active and the file
    exists. Otherwise, all modifications happen on the to the user file by
    default.
    s
        %prog [<file-option>] list
        %prog [<file-option>] [--editor <editor-path>] edit

        %prog [<file-option>] get name
        %prog [<file-option>] set name value
        %prog [<file-option>] unset name
        %prog [<file-option>] debug
    c
Cs�|jjddddddddd�|jjd	dd
dddtdd�|jjd
dddddtdd�|jjddddddtdd�|jjd|j�dS(Ns--editortdestteditortactiontstoretdefaultthelps\Editor to use to edit the file. Uses VISUAL or EDITOR environment variables if not provided.s--globaltglobal_filet
store_trues+Use the system-wide configuration file onlys--usert	user_files$Use the user configuration file onlys--sitet	site_files3Use the current environment configuration file onlyi(tcmd_optst
add_optiontNonetFalsetparsertinsert_option_group(tself((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pytadd_options8s2				c	Cs@i|jd6|jd6|jd6|jd6|jd6|jd6}|sY|d|kr|tjdd	jt	|���t
S|d}y|j|d
|dk�}Wn(tk
r�}tj|j
d�t
SXtd|jd|�|_|jj�y||||d
�Wn(tk
r;}tj|j
d�t
SXtS(NtlisttedittgettsettunsettdebugisNeed an action (%s) to perform.s, t
need_valuetisolatedt	load_onlyi(sgetssetR'R$(tlist_valuestopen_in_editortget_nametset_name_valuet
unset_nametlist_config_valuestloggerterrortjointsortedRt_determine_fileRtargsRt
isolated_modet
configurationtloadR(R!toptionsR7thandlersRR+te((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pytrun_s8







cCs�gtj|jftj|jftj|jffD]\}}|r4|^q4}|s�|sbdStd�t	�tjD��r�tjStjSnt
|�dkr�|dStd��dS(Ncss!|]}tjj|�VqdS(N(tostpathtexists(t.0tsite_config_file((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pys	<genexpr>�siisLNeed exactly one file to operate upon (--user, --site, --global) to perform.(RtUSERRtGLOBALRtSITERRtanyRtlenR(R!R;R)tkeytvaluetfile_options((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR6�s"
cCsP|j|ddd�x3t|jj��D]\}}td||�q,WdS(NR#tnis%s=%r(t_get_n_argsR5R9titemsR	(R!R;R7RIRJ((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR,�s"cCs;|j|ddd�}|jj|�}td|�dS(Ns
get [name]RLis%s(RMR9t	get_valueR	(R!R;R7RIRJ((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR.�scCs?|j|ddd�\}}|jj||�|j�dS(Nsset [name] [value]RLi(RMR9t	set_valuet_save_configuration(R!R;R7RIRJ((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR/�scCs6|j|ddd�}|jj|�|j�dS(Nsunset [name]RLi(RMR9tunset_valueRQ(R!R;R7RI((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR0�sc
Cs�|j|ddd�|j�x�t|jj��D]r\}}td|�xV|D]N}t��=tjj	|�}td||�|r�|j
|�nWdQXqVWq6WdS(s9List config key-value pairs across different config filesR(RLis%s:s%s, exists: %rN(RMtprint_env_var_valuesR5R9titer_config_filesR	RR?R@RAtprint_config_file_values(R!R;R7tvarianttfilestfnametfile_exists((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR1�s
"



c	CsMxF|jj|�j�D],\}}t��td||�WdQXqWdS(s.Get key-value pairs from the file of a variants%s: %sN(R9tget_values_in_configRNRR	(R!RVtnameRJ((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyRU�s
c	Csltdd�t��PxHt|jj��D]1\}}dj|j��}td||�q-WWdQXdS(s5Get key-values pairs present as environment variabless%s:tenv_varsPIP_{}s%s=%rN(R	RR5R9tget_environ_varstformattupper(R!RIRJR\((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyRS�s


"cCs�|j|�}|jj�}|dkr9td��nytj||g�Wn.tjk
r�}tdj|j	���nXdS(Ns%Could not determine appropriate file.s*Editor Subprocess exited with exit code {}(
t_determine_editorR9tget_file_to_editRRt
subprocesst
check_calltCalledProcessErrorR^t
returncode(R!R;R7RRXR=((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR-�scCsUt|�|kr9dj|t�|�}t|��n|dkrM|dS|SdS(sJHelper to make sure the command got the right number of arguments
        sJGot unexpected number of arguments, expected {}. (example: "{} config {}")iiN(RHR^RR(R!R7texampleRLtmsg((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyRM�scCsBy|jj�Wn*tk
r=tjd�td��nXdS(Ns:Unable to save configuration. Please report this as a bug.sInternal Error.(R9tsavet	ExceptionR2t	exceptionR(R!((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyRQs
cCsZ|jdk	r|jSdtjkr0tjdSdtjkrJtjdStd��dS(NtVISUALtEDITORs"Could not determine editor to use.(RRR?tenvironR(R!R;((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyR`s(t__name__t
__module__t__doc__tTruetignore_require_venvtusageR"R>R6R,R.R/R0R1RURSR-RMRQR`(((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyRs"		'	.												( tloggingR?Rbtpip._internal.cli.base_commandRtpip._internal.cli.status_codesRRtpip._internal.configurationRRRtpip._internal.exceptionsRtpip._internal.utils.loggingRtpip._internal.utils.miscRR	tpip._internal.utils.typingR
ttypingRRR
toptparseRRt	getLoggerRnR2R(((sU/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/commands/configuration.pyt<module>s

Zerion Mini Shell 1.0