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

Function inputhook

IPython/terminal/pt_inputhooks/gtk.py:44–58  ·  view source on GitHub ↗

When the eventloop of prompt-toolkit is idle, call this inputhook. This will run the GTK main loop until the file descriptor `context.fileno()` becomes ready. :param context: An `InputHookContext` instance.

(context)

Source from the content-addressed store, hash-verified

42gtk.gdk.threads_init()
43
44def inputhook(context):
45 """
46 When the eventloop of prompt-toolkit is idle, call this inputhook.
47
48 This will run the GTK main loop until the file descriptor
49 `context.fileno()` becomes ready.
50
51 :param context: An `InputHookContext` instance.
52 """
53 def _main_quit(*a, **kw):
54 gtk.main_quit()
55 return False
56
57 gobject.io_add_watch(context.fileno(), gobject.IO_IN, _main_quit)
58 gtk.main()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected