MCPcopy Create free account
hub / github.com/ipython/ipython / enable

Method enable

IPython/lib/inputhook.py:400–433  ·  view source on GitHub ↗

DEPRECATED since IPython 5.0 Enable event loop integration with PyQt4. Parameters ---------- app : Qt Application, optional. Running application to use. If not given, we probe Qt for an existing application object, and create a new o

(self, app=None)

Source from the content-addressed store, hash-verified

398@inputhook_manager.register('qt', 'qt4')
399class Qt4InputHook(InputHookBase):
400 def enable(self, app=None):
401 """DEPRECATED since IPython 5.0
402
403 Enable event loop integration with PyQt4.
404
405 Parameters
406 ----------
407 app : Qt Application, optional.
408 Running application to use. If not given, we probe Qt for an
409 existing application object, and create a new one if none is found.
410
411 Notes
412 -----
413 This methods sets the PyOS_InputHook for PyQt4, which allows
414 the PyQt4 to integrate with terminal based applications like
415 IPython.
416
417 If ``app`` is not given we probe for an existing one, and return it if
418 found. If no existing app is found, we create an :class:`QApplication`
419 as follows::
420
421 from PyQt4 import QtCore
422 app = QtGui.QApplication(sys.argv)
423 """
424 warn("This function is deprecated since IPython 5.0 and will be removed in future versions.",
425 DeprecationWarning, stacklevel=2)
426 from IPython.lib.inputhookqt4 import create_inputhook_qt4
427 app, inputhook_qt4 = create_inputhook_qt4(self.manager, app)
428 self.manager.set_inputhook(inputhook_qt4)
429 if _use_appnope():
430 from appnope import nope
431 nope()
432
433 return app
434
435 def disable_qt4(self):
436 """DEPRECATED since IPython 5.0

Callers

nothing calls this directly

Calls 3

create_inputhook_qt4Function · 0.90
_use_appnopeFunction · 0.85
set_inputhookMethod · 0.80

Tested by

no test coverage detected