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

Function loaded_api

IPython/external/qt_loaders.py:85–106  ·  view source on GitHub ↗

Return which API is loaded, if any If this returns anything besides None, importing any other Qt binding is unsafe. Returns ------- None, 'pyside2', 'pyside', 'pyqt', 'pyqt5', or 'pyqtv1'

()

Source from the content-addressed store, hash-verified

83
84
85def loaded_api():
86 """Return which API is loaded, if any
87
88 If this returns anything besides None,
89 importing any other Qt binding is unsafe.
90
91 Returns
92 -------
93 None, 'pyside2', 'pyside', 'pyqt', 'pyqt5', or 'pyqtv1'
94 """
95 if 'PyQt4.QtCore' in sys.modules:
96 if qtapi_version() == 2:
97 return QT_API_PYQT
98 else:
99 return QT_API_PYQTv1
100 elif 'PySide.QtCore' in sys.modules:
101 return QT_API_PYSIDE
102 elif 'PySide2.QtCore' in sys.modules:
103 return QT_API_PYSIDE2
104 elif 'PyQt5.QtCore' in sys.modules:
105 return QT_API_PYQT5
106 return None
107
108
109def has_binding(api):

Callers 4

get_optionsFunction · 0.90
load_moduleMethod · 0.85
can_importFunction · 0.85
load_qtFunction · 0.85

Calls 1

qtapi_versionFunction · 0.85

Tested by

no test coverage detected