File tree Expand file tree Collapse file tree 4 files changed +1
-21
lines changed
Expand file tree Collapse file tree 4 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -95,16 +95,13 @@ def matplotlib_options(mpl):
9595 mpqt )
9696
9797def get_options ():
98- print (f'`get_options` called with { os .environ .get ("QT_API" , None )= } ' )
9998 """Return a list of acceptable QT APIs, in decreasing order of preference."""
10099 #already imported Qt somewhere. Use that
101100 loaded = loaded_api ()
102101 if loaded is not None :
103- print (f"`QtCore` already imported: { loaded = } " )
104102 return [loaded ]
105103
106104 mpl = sys .modules .get ("matplotlib" , None )
107- print (f"{ mpl = } " ) # will be None of matplotlib has not yet been imported
108105
109106 if mpl is not None and tuple (mpl .__version__ .split ("." )) < ("1" , "0" , "2" ):
110107 # 1.0.1 only supports PyQt4 v1
@@ -126,12 +123,9 @@ def get_options():
126123 raise RuntimeError ("Invalid Qt API %r, valid values are: %r" %
127124 (qt_api , ', ' .join (_qt_apis )))
128125 else :
129- print (f"{ qt_api = } " )
130126 return [qt_api ]
131127
132128
133129api_opts = get_options ()
134- print (f"Importing `IPython.terminal.pt_inputhooks.qt` with { api_opts = } " )
135130QtCore , QtGui , QtSvg , QT_API = load_qt (api_opts )
136- print (f"Loaded Qt with { QT_API = } " )
137131enum_helper = enum_factory (QT_API , QtCore )
Original file line number Diff line number Diff line change @@ -711,14 +711,12 @@ def inputhook(self, context):
711711
712712 active_eventloop = None
713713 def enable_gui (self , gui = None ):
714- print (f"Someone called `enable_gui` with { gui = } ." )
715714 if self ._inputhook is not None and gui is not None :
716715 raise RuntimeError ("Shell already running a gui event loop." )
717716 if gui and (gui not in {"inline" , "webagg" }):
718717 # This hook runs with each cycle of the `prompt_toolkit`'s event loop.
719718 self .active_eventloop , self ._inputhook = get_inputhook_name_and_func (gui )
720719 else :
721- print (f"Disconnecting event loop { self ._inputhook = } " )
722720 self .active_eventloop = self ._inputhook = None
723721
724722 # For prompt_toolkit 3.0. We have to create an asyncio event loop with
Original file line number Diff line number Diff line change @@ -129,15 +129,13 @@ def set_qt_api(gui):
129129
130130
131131def get_inputhook_name_and_func (gui ):
132- print (f"`get_inputhook_name_and_func` called with { gui = } " )
133132 if gui in registered :
134133 return gui , registered [gui ]
135134
136135 if gui not in backends :
137136 raise UnknownBackend (gui )
138137
139138 if gui in aliases :
140- print ("gui has an alias" )
141139 return get_inputhook_name_and_func (aliases [gui ])
142140
143141 gui_mod = gui
Original file line number Diff line number Diff line change @@ -20,9 +20,6 @@ def _reclaim_excepthook():
2020 sys .excepthook = shell .excepthook
2121
2222
23- announced = 0
24-
25-
2623def inputhook (context ):
2724 global _appref
2825 app = QtCore .QCoreApplication .instance ()
@@ -59,14 +56,7 @@ def inputhook(context):
5956 QtCore .QTimer .singleShot (0 , _reclaim_excepthook )
6057
6158 event_loop = QtCore .QEventLoop (app )
62- global announced
63- if announced == 0 :
64- print (f"`inputhook` running Qt { QtCore .qVersion ()} event loop." )
65- announced += 1
66- elif announced == 10 :
67- announced = 0
68- else :
69- announced += 1
59+
7060 if sys .platform == 'win32' :
7161 # The QSocketNotifier method doesn't appear to work on Windows.
7262 # Use polling instead.
You can’t perform that action at this time.
0 commit comments