##// END OF EJS Templates
Merge pull request #1851 from Carreau/newcomp_rebase...
Merge pull request #1851 from Carreau/newcomp_rebase New completer for qtconsole with rich keyboard navigation during completion search. add a completer to the qtconsole that is navigable by arrows keys and tab. One need to call it twice to get it on focus and be able to select completion with Return. looks like zsh completer, not the gui drop down list of --gui-completer. This also try to split the completion logic from console_widget, and try to keep the old completer qui around. The plain completer that never takes focus back, and the QlistWidget completer. To switch between the 3, the --gui-completion flag as been changed to take an argument (plain, droplist, ncurses): ipython qtconsole --gui-completion=ncurses

File last commit:

r6765:24cb7424
r7395:45d28c54 merge
Show More
hb_gil.py
31 lines | 574 B | text/x-python | PythonLexer
"""
Run this script in the qtconsole with one of:
%load hb_gil.py
or
%run hb_gil.py
Holding the GIL for too long could disrupt the heartbeat.
See Issue #1260: https://github.com/ipython/ipython/issues/1260
"""
import sys
import time
from cython import inline
def gilsleep(t):
"""gil-holding sleep with cython.inline"""
code = '\n'.join([
'from posix cimport unistd',
'unistd.sleep(t)',
])
while True:
inline(code, quiet=True, t=t)
print(time.time())
sys.stdout.flush() # this is important
gilsleep(5)