|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /usr/local/lib/python3.9/site-packages/prompt_toolkit/input/__pycache__/ |
a
��Sh� � @ sn d dl mZ d dlZd dlZd dlmZmZ ddlmZm Z m
Z
ddgZdd d
dd�d
d�Zdd�dd�Z
dS )� )�annotationsN)�ContextManager�TextIO� )�
DummyInput�Input� PipeInput�create_input�create_pipe_inputFz
TextIO | None�boolr )�stdin�always_prefer_tty�returnc C s� t jdkr<ddlm} | du r.t jdu r.t� S || p8t j�S ddlm} | du r�t j} |r�t jt jt j fD ]}|�
� rj|} q�qjz| �� W n tj
y� t� Y S 0 || �S dS )a�
Create the appropriate `Input` object for the current os/environment.
:param always_prefer_tty: When set, if `sys.stdin` is connected to a Unix
`pipe`, check whether `sys.stdout` or `sys.stderr` are connected to a
pseudo terminal. If so, open the tty for reading instead of reading for
`sys.stdin`. (We can open `stdout` or `stderr` for reading, this is how
a `$PAGER` works.)
�win32r )�
Win32InputN)�
Vt100Input)�sys�platformr r r r Zvt100r �stdout�stderr�isatty�fileno�io�UnsupportedOperation)r r
r r �obj� r �G/usr/local/lib/python3.9/site-packages/prompt_toolkit/input/defaults.pyr s$
zContextManager[PipeInput])r c C s6 t jdkrddlm} | �� S ddlm} |�� S dS )aA
Create an input pipe.
This is mostly useful for unit testing.
Usage::
with create_pipe_input() as input:
input.send_text('inputdata')
Breaking change: In prompt_toolkit 3.0.28 and earlier, this was returning
the `PipeInput` directly, rather than through a context manager.
r r )�Win32PipeInput)�PosixPipeInputN)r r Z
win32_piper �createZ
posix_piper )r r r r r r
; s
)NF)�
__future__r r r �typingr r �baser r r �__all__r r
r r r r �<module> s �,