##// END OF EJS Templates
Improve messaging when turning off event loops
Emilio Graff -
Show More
@@ -915,9 +915,14 b' class TerminalInteractiveShell(InteractiveShell):'
915 def enable_gui(self, gui=None):
915 def enable_gui(self, gui=None):
916 if self._inputhook is not None and gui is not None:
916 if self._inputhook is not None and gui is not None:
917 print(
917 print(
918 f"Shell is already running a gui event loop for {self.active_eventloop}."
918 f"Shell is already running a gui event loop for {self.active_eventloop}. "
919 "Call with no arguments to disable current loop."
919 )
920 )
920 return
921 return
922 if self._inputhook is not None and gui is None:
923 print('GUI event loop hook disabled.')
924 self.active_eventloop = self._inputhook = None
925
921 if gui and (gui not in {"inline", "webagg"}):
926 if gui and (gui not in {"inline", "webagg"}):
922 # This hook runs with each cycle of the `prompt_toolkit`'s event loop.
927 # This hook runs with each cycle of the `prompt_toolkit`'s event loop.
923 self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui)
928 self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui)
General Comments 0
You need to be logged in to leave comments. Login now