##// END OF EJS Templates
Backport PR #9976: Let IPython.lib.guisupport detect terminal-integrated event loops...
Backport PR #9976: Let IPython.lib.guisupport detect terminal-integrated event loops Closes gh-9974 This is a bit more invasive than most backported changes, but it fixes a regression in IPython 5. My thinking: - The `guisupport` APIs that worked before should continue working until/unless we deprecate them. - There should be a common way to check if an event loop is already running in both the terminal and an IPython kernel. - It should be possible to check for any event loop, not just Qt and Wx (which `guisupport` has checks for). My plan is to make a public attribute `shell.active_eventloop`, which is either None or a string naming the event loop which IPython will run when waiting for input. E.g. `qt` or `gtk3`. (Todo: should we also expose the event loop object in cases where there is one? Not sure if anything useful can be done with it). This PR adds that attribute for terminal IPython; if we agree on it I'll make a separate PR for ipykernel. The functions in guisupport then become a convenient shortcut for checking this, and we can decide whether to deprecate them in favour or something more uniform, or add similar convenience functions for other common event loops. Signed-off-by: Thomas Kluyver <thomas@kluyver.me.uk>

File last commit:

r1234:52b55407
r23138:fb70b991
Show More
__init__.py
10 lines | 558 B | text/x-python | PythonLexer
# encoding: utf-8
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2005 Fernando Perez <fperez@colorado.edu>
# Brian E Granger <ellisonbg@gmail.com>
# Benjamin Ragan-Kelley <benjaminrk@gmail.com>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------------------------------------------------