HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //lib/python3.9/site-packages/certbot/_internal/display/__pycache__/completer.cpython-39.pyc
a

}|�g
�@s�dZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	zddl
Z
Wn*ey�ddlm
mmZ
Yn0Gd	d
�d
�ZdS)z8Provides Tab completion when prompting users for a path.�N)�
TracebackType)�Callable)�Iterator)�Literal)�Optional)�Typec@sfeZdZdZdd�dd�Zeeeed�dd�Zdd�d	d
�Z	ee
eeeeedd�d
d�Z
dS)�	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.

    N)�returncCs|||dS)N���selfr
r
�G/usr/lib/python3.9/site-packages/certbot/_internal/display/completer.py�__init__"szCompleter.__init__)�text�stater	cCs$|dkrt�|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)�globZiglobZ_iter�next)rrrr
r
r
�complete'szCompleter.completecCsXt��|_t��|_t�|j�t�d�tjdurJdtjvrJt�	d�n
t�	d�dS)Nz 	
;�libeditzbind ^I rl_completez
tab: complete)
�readlineZ
get_completer�_original_completerZget_completer_delims�_original_delims�
set_completerr�set_completer_delims�__doc__�parse_and_bindrr
r
r
�	__enter__6s


zCompleter.__enter__zLiteral[False])�unused_type�unused_value�unused_tracebackr	cCst�|j�t�|j�dS)NF)rrrrr)rrrr r
r
r
�__exit__DszCompleter.__exit__)�__name__�
__module__�__qualname__rr�str�intrrrr�
BaseExceptionrr!r
r
r
r
rs
�r)rr�typesr�typingrrrrrr�ImportErrorZ(certbot._internal.display.dummy_readlineZ	_internalZdisplayZdummy_readlinerr
r
r
r
�<module>s