HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/certbot/_internal/display/__pycache__/completer.cpython-310.pyc
o

6��a��@szdZddlZddlmZddlmZddlmZzddlZWney3ddlm	m
mZYnwGdd�d�ZdS)z8Provides Tab completion when prompting users for a path.�N)�Callable)�Iterator)�Optionalc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	Completera/Provides Tab completion when prompting users for a path.

    This class is meant to be used with readline to provide Tab
    completion for users entering paths. The complete method can be
    passed to readline.set_completer directly, however, this function
    works best as a context manager. For example:

    with Completer():
        raw_input()

    In this example, Tab completion will be available during the call to
    raw_input above, however, readline will be restored to its previous
    state when exiting the body of the with statement.

    cCs|||dS�N���selfrr�E/usr/lib/python3/dist-packages/certbot/_internal/display/completer.py�__init__szCompleter.__init__cCs$|dkrt�|d�|_t|jd�S)a(Provides path completion for use with readline.

        :param str text: text to offer completions for
        :param int state: which completion to return

        :returns: possible completion for text or ``None`` if all
            completions have been returned
        :rtype: str

        r�*N)�glob�iglob�_iter�next)r	�text�staterrr
�complete$szCompleter.completecCsZt��|_t��|_t�|j�t�d�tjdur&dtjvr&t�	d�dSt�	d�dS)Nz 	
;�libeditzbind ^I rl_completez
tab: complete)
�readline�
get_completer�_original_completer�get_completer_delims�_original_delims�
set_completerr�set_completer_delims�__doc__�parse_and_bindrrrr
�	__enter__3s


zCompleter.__enter__cCst�|j�t�|j�dSr)rrrrr)r	�unused_type�unused_value�unused_tracebackrrr
�__exit__AszCompleter.__exit__N)�__name__�
__module__�__qualname__rrrrr"rrrr
rsr)
rr
�typingrrrr�ImportError�(certbot._internal.display.dummy_readline�	_internal�display�dummy_readlinerrrrr
�<module>s�