HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/certbot/display/__pycache__/completer.cpython-38.pyc
U

�]t�@sTdZddlZzddlZWn&ek
r>ddlmmZYnXGdd�de�ZdS)z8Provides Tab completion when prompting users for a path.�Nc@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.

    cCsd|_|_|_dS�N)�_iter�_original_completer�_original_delims��self�r	�;/usr/lib/python3/dist-packages/certbot/display/completer.py�__init__szCompleter.__init__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)�globZiglobr�next)r�text�stater	r	r
�completeszCompleter.completecCsXt��|_t��|_t�|j�t�d�tjdk	rJdtjkrJt�	d�n
t�	d�dS)Nz 	
;�libeditzbind ^I rl_completez
tab: complete)
�readlineZ
get_completerrZget_completer_delimsr�
set_completerr�set_completer_delims�__doc__�parse_and_bindrr	r	r
�	__enter__-s


zCompleter.__enter__cCst�|j�t�|j�dSr)rrrrr)rZunused_typeZunused_valueZunused_tracebackr	r	r
�__exit__;szCompleter.__exit__N)�__name__�
__module__�__qualname__rrrrrr	r	r	r
r
s
r)	rr
r�ImportErrorZcertbot.display.dummy_readlineZdisplayZdummy_readline�objectrr	r	r	r
�<module>s