Your IP : 3.137.181.194


Current Path : /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/autocompletion.pyc

�
�Rec@s�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZer�ddlmZmZmZmZnd	�Zd
�Zd�ZdS(sBLogic that powers autocompletion installed by ``pip completion``.
i����N(tchain(tcreate_main_parser(t
commands_dicttcreate_command(tget_installed_distributions(tMYPY_CHECK_RUNNING(tAnytIterabletListtOptionalcCs%dtjkrdStjdj�d}ttjd�}y||d}Wntk
rhd}nXt�}tt�}g}d}x$|D]}||kr�|}Pq�q�W|dk	r*|dkr�t	j
d�n|dko�|jd
�}|r�g}	|j�}
xOt
dt�D]>}|jj|
�r|j|dkr|	j|j�qqW|	r�x|	D]}|GHqlWt	j
d�q�nt|�}xZ|jjD]L}
|
jtjkr�x1|
j|
jD]}|j||
jf�q�Wq�q�Wg|d|d!D]}|jd�d
^q	}g|D]$\}}||kr/||f^q/}g|D]'\}}|j|�r`||f^q`}t|||jj�}|r�t||�}g|D]}|d
f^q�}nx5|D]@}|d
}|dr|d
d dkr|d7}n|GHq�Wn�g|jD]}|j^q4}|j|j�tj|�}|jd
�r�xj|D]/}
|
jtjkr~||
j|
j7}q~q~Wn0t|||�}|r�tt||��}ndj g|D]}|j|�r�|^q��GHt	j
d�dS(s?Entry Point for completion of main and subcommand options.
    tPIP_AUTO_COMPLETENt
COMP_WORDSit
COMP_CWORDtthelptshowt	uninstallt-t
local_onlyt=iis--t (RR(!tostenvirontsplittintt
IndexErrorRtlistRtNonetsystexitt
startswithtlowerRtTruetkeytappendRtparsertoption_list_allRtoptparset
SUPPRESS_HELPt
_long_optst_short_optstnargstget_path_completion_typetauto_complete_pathst
option_groupstoption_listRt
from_iterabletjoin(tcwordstcwordtcurrentR#tsubcommandstoptionstsubcommand_nametwordtshould_list_installedt	installedtlctdistt
subcommandtopttopt_strtxt	prev_optstvtktcompletion_typetpathstpathtoptiont	opt_labeltitoptstflattened_opts((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pytautocompletes~

	
%
	!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)
    iRt/Ricss|]}|dkVqdS(RDtfiletdirN(RDRLRM((t.0R>((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pys	<genexpr>�sN(	RRRR%R&tstrRtmetavartany(R0R1RHR<to((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pyR*qs	$
!
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(RRDtnormcaseR(RNR>(tfilename(s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pys	<genexpr>�sRMR
(RRDRtabspathtaccesstR_OKRStlistdirR/tisfiletisdir(R2RBt	directorytcurrent_patht	file_listtfR<t	comp_file((RTs�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pyR+�s

!(t__doc__R%RRt	itertoolsRtpip._internal.cli.main_parserRtpip._internal.commandsRRtpip._internal.utils.miscRtpip._internal.utils.typingRttypingRRRR	RJR*R+(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.pyt<module>s%	_	

?>