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

Function _stop_on_read

IPython/terminal/pt_inputhooks/osx.py:116–124  ·  view source on GitHub ↗

Register callback to stop eventloop when there's data on fd

(fd)

Source from the content-addressed store, hash-verified

114
115
116def _stop_on_read(fd):
117 """Register callback to stop eventloop when there's data on fd"""
118 _triggered.clear()
119 fdref = CFFileDescriptorCreate(None, fd, False, _c_input_callback, None)
120 CFFileDescriptorEnableCallBacks(fdref, kCFFileDescriptorReadCallBack)
121 source = CFFileDescriptorCreateRunLoopSource(None, fdref, 0)
122 loop = CFRunLoopGetCurrent()
123 CFRunLoopAddSource(loop, source, kCFRunLoopCommonModes)
124 CFRelease(source)
125
126
127def inputhook(context):

Callers 1

inputhookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected