MCPcopy Create free account
hub / github.com/LabPy/lantz / loaded_api

Function loaded_api

lantz/utils/qt_loaders.py:90–107  ·  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, 'pyside', 'pyqt', or 'pyqtv1'

()

Source from the content-addressed store, hash-verified

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

Callers 3

load_moduleMethod · 0.85
can_importFunction · 0.85
load_qtFunction · 0.85

Calls 1

qtapi_versionFunction · 0.85

Tested by

no test coverage detected