????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/cli/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pyc

�
}�\]c@sdZddlZddlZddlZddlmZddlmZmZddl	m
Z
d�Zd�Zd�Z
dS(	sBLogic that powers autocompletion installed by ``pip completion``.
i����N(tcreate_main_parser(t
commands_dictt
get_summaries(tget_installed_distributionscCs<dtjkrdStjdj�d}ttjd�}y||d}Wntk
rhd}nXgt�D]\}}|^qs}g}y-g|D]}||kr�|^q�d}Wntk
r�d}nXt�}	|rF|dkrtj	d�n|dko|j
d�}
|
r�g}|j�}xOtdt
�D]>}
|
jj
|�rG|
j|dkrG|j|
j�qGqGW|r�x|D]}
|
GHq�Wtj	d�q�nt|�}xZ|jjD]L}|jtjkr�x1|j|jD]}|j||jf�q�Wq�q�Wg|d|d!D]}|jd
�d^q4}g|D]$\}}||krZ||f^qZ}g|D]'\}}|j
|�r�||f^q�}t|||jj�}|r�t||�}d�|D�}nx0|D]@}|d}|dr:|dd dkr:|d
7}n|GHq�Wn�g|	jD]}|j^qP}|j|	j�d�|D�}|j
d�r�xd|D]/}|jtjkr�||j|j7}q�q�Wn*t|||�}|r�t||�}ndjg|D]}|j
|�r|^q�GHtj	d�dS(s?Entry Point for completion of main and subcommand options.
    tPIP_AUTO_COMPLETENt
COMP_WORDSit
COMP_CWORDtithelptshowt	uninstallt-t
local_onlyt=css|]}|dfVqdS(iN((t.0topt((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pys	<genexpr>Msis--css"|]}|D]}|Vq
qdS(N((Rtitto((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pys	<genexpr>Yst (sshows	uninstall(tostenvirontsplittintt
IndexErrorRtNoneRtsystexitt
startswithtlowerRtTruetkeytappendRtparsertoption_list_allRtoptparset
SUPPRESS_HELPt
_long_optst_short_optstnargstget_path_completion_typetauto_complete_pathst
option_groupstoption_listtjoin(tcwordstcwordtcurrenttcmdtsummarytsubcommandstoptionstwtsubcommand_nameR tshould_list_installedt	installedtlctdistt
subcommandRtopt_strtxt	prev_optstvtktcompletion_typetoptiont	opt_labeltitopts((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pytautocomplete
sx

"-

	%
	
!114



0cCs�|dks$||djd�r(dSx�|D]�}|jtjkrMq/nxtt|�jd�D]]}||djd�d|krc|js�td�|jjd�D��r�|jSqcqcWq/WdS(sLGet the type of path completion (``file``, ``dir``, ``path`` or None)

    :param cwords: same as the environmental variable ``COMP_WORDS``
    :param cword: same as the environmental variable ``COMP_CWORD``
    :param opts: The available options to check
    :return: path completion type (``file``, ``dir``, ``path`` or None)
    iRNt/R
icss|]}|dkVqdS(tpathtfiletdirN(spathsfilesdir((RR;((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pys	<genexpr>xs(RRR"R#tstrRtmetavartany(R,R-RCRR((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pyR'hs$
!
c#stjj|�\}�tjj|�}tj|tj�sCdStjj����fd�tj|�D�}x�|D]�}tjj||�}tjjtjj||��}|dkr�tjj	|�r�|Vq{tjj
|�r{tjj|d�Vq{q{WdS(soIf ``completion_type`` is ``file`` or ``path``, list all regular files
    and directories starting with ``current``; otherwise only list directories
    starting with ``current``.

    :param current: The word to be completed
    :param completion_type: path completion type(`file`, `path` or `dir`)i
    :return: A generator of regular files and/or directories
    Nc3s0|]&}tjj|�j��r|VqdS(N(RRFtnormcaseR(RR;(tfilename(s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pys	<genexpr>�sRHR(RRFRtabspathtaccesstR_OKRLtlistdirR+tisfiletisdir(R.R?t	directorytcurrent_patht	file_listtfRt	comp_file((RMs?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pyR(}s	
!(t__doc__R"RRtpip._internal.cli.main_parserRtpip._internal.commandsRRtpip._internal.utils.miscRRDR'R((((s?/tmp/pip-install-ewDPok/pip/pip/_internal/cli/autocompletion.pyt<module>s	[