MCPcopy Create free account
hub / github.com/ipython/ipython / wait_using_filehandler

Function wait_using_filehandler

IPython/terminal/pt_inputhooks/tk.py:54–72  ·  view source on GitHub ↗

Run the TK eventloop until the file handler that we got from the inputhook becomes readable.

()

Source from the content-addressed store, hash-verified

52 root = tkinter._default_root
53
54 def wait_using_filehandler():
55 """
56 Run the TK eventloop until the file handler that we got from the
57 inputhook becomes readable.
58 """
59 # Add a handler that sets the stop flag when `prompt-toolkit` has input
60 # to process.
61 stop = [False]
62 def done(*a):
63 stop[0] = True
64
65 root.createfilehandler(inputhook_context.fileno(), _tkinter.READABLE, done)
66
67 # Run the TK event loop as long as we don't receive input.
68 while root.dooneevent(_tkinter.ALL_EVENTS):
69 if stop[0]:
70 break
71
72 root.deletefilehandler(inputhook_context.fileno())
73
74 def wait_using_polling():
75 """

Callers 1

inputhookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected