From 9b570a819f576b6ea5b593ad23f1d1356954d3f6 2008-03-22 14:03:05 From: Ville M. Vainio Date: 2008-03-22 14:03:05 Subject: [PATCH] twshell: do not install gtk2 reactor automatically --- diff --git a/IPython/twshell.py b/IPython/twshell.py index ad30ba2..1a5e444 100644 --- a/IPython/twshell.py +++ b/IPython/twshell.py @@ -1,13 +1,7 @@ import sys -from twisted.internet import gtk2reactor -gtk2reactor.install() - from twisted.internet import reactor, threads -""" change here to choose the plot shell with the MT option - which should cost extra """ - from IPython.ipmaker import make_IPython from IPython.iplib import InteractiveShell from IPython.ipstruct import Struct @@ -16,6 +10,11 @@ from signal import signal, SIGINT from IPython.genutils import Term,warn,error,flag_calls, ask_yes_no import shellglobals +def install_gtk2(): + """ Install gtk2 reactor, needs to be called bef """ + from twisted.internet import gtk2reactor + gtk2reactor.install() + def hijack_reactor(): """Modifies Twisted's reactor with a dummy so user code does @@ -125,8 +124,7 @@ class TwistedInteractiveShell(InteractiveShell): print "Warning: Timeout for mainloop thread exceeded" print "switching to nonthreaded mode (until mainloop wakes up again)" self.worker_ident = None - else: - shellglobals.CURRENT_COMPLETE_EV = completed_ev + else: completed_ev.wait() return False