)L idZddlmZddlmZmZddlmZddlm Z m Z m Z ddl m Z gdZGdd e ZGd d eZGd deZeddZy)z Abstraction of CLI Input. ) annotations)ABCMetaabstractmethod)contextmanager)CallableContextManager Generator)KeyPress)Input PipeInput DummyInputceZdZdZeddZeddZeddZddZddZ e eddZ eddZ edd Z edd Zedd Zdd Zy )r z Abstraction for any input. An instance of this class can be given to the constructor of a :class:`~prompt_toolkit.application.Application` and will also be passed to the :class:`~prompt_toolkit.eventloop.base.EventLoop`. cy)z; Fileno for putting this in an event loop. Nselfs _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/input/base.pyfilenoz Input.filenocy)z@ Identifier for storing type ahead key presses. Nrrs rtypeahead_hashzInput.typeahead_hash#rrcy)zT Return a list of Key objects which are read/parsed from the input. Nrrs r read_keyszInput.read_keys)rrcgS)zk Flush the underlying parser. and return the pending keys. (Used for vt100 input.) rrs r flush_keyszInput.flush_keys/s  rcy)z>The event loop can call this when the input has to be flushed.Nrrs rflushz Input.flush6 rcy)z/Should be true when the input stream is closed.Frrs rclosedz Input.closed:srcy)zE Context manager that turns the input into raw mode. Nrrs rraw_modezInput.raw_mode@rrcy)zH Context manager that turns the input into cooked mode. Nrrs r cooked_modezInput.cooked_modeFrrcy)zj Return a context manager that makes this input active in the current event loop. Nrrinput_ready_callbacks rattachz Input.attachLrrcy)z{ Return a context manager that makes sure that this input is not active in the current event loop. Nrrs rdetachz Input.detachSrrcy)z Close input.Nrrs rclosez Input.closeZrrNreturnintr/strr/zlist[KeyPress])r/Noner/boolr/ContextManager[None]r(zCallable[[], None]r/r8)__name__ __module__ __qualname____doc__rrrrrrpropertyr!r#r%r)r+r-rrrr r s                rr ) metaclassc4eZdZdZeddZeddZy)r z% Abstraction for pipe input. cy)zFeed byte string into the pipeNrrdatas r send_byteszPipeInput.send_bytesdrrcy)z Feed a text string into the pipeNrrBs r send_textzPipeInput.send_texthrrN)rCbytesr/r4)rCr2r/r4)r:r;r<r=rrDrFrrrr r _s/--//rr cZeZdZdZd dZd dZd dZeddZddZ ddZ ddZ dd Z y )r z Input for use in a `DummyApplication` If used in an actual application, it will make the application render itself once and exit immediately, due to an `EOFError`. ctN)NotImplementedErrorrs rrzDummyInput.filenous!!rcdt|S)Nzdummy-)idrs rrzDummyInput.typeahead_hashxs4z""rcgSrJrrs rrzDummyInput.read_keys{s rcy)NTrrs rr!zDummyInput.closed~srctSrJ_dummy_context_managerrs rr#zDummyInput.raw_mode %''rctSrJrQrs rr%zDummyInput.cooked_moderSrc$|tSrJrQr's rr)zDummyInput.attachs %''rctSrJrQrs rr+zDummyInput.detachrSrNr.r1r3r5r7r9) r:r;r<r=rrrr>r!r#r%r)r+rrrr r ms>"# ((((rr c#KdywrJrrrrrRrRs  sN)r/zGenerator[None, None, None])r= __future__rabcrr contextlibrtypingrrr prompt_toolkit.key_bindingr __all__r r r rRrrrr^sa#'%66/ H gH V / /((((V  r