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

Function get_options

IPython/external/qt_for_kernel.py:68–92  ·  view source on GitHub ↗

Return a list of acceptable QT APIs, in decreasing order of preference

()

Source from the content-addressed store, hash-verified

66 mpqt)
67
68def get_options():
69 """Return a list of acceptable QT APIs, in decreasing order of
70 preference
71 """
72 #already imported Qt somewhere. Use that
73 loaded = loaded_api()
74 if loaded is not None:
75 return [loaded]
76
77 mpl = sys.modules.get('matplotlib', None)
78
79 if mpl is not None and not check_version(mpl.__version__, '1.0.2'):
80 #1.0.1 only supports PyQt4 v1
81 return [QT_API_PYQT_DEFAULT]
82
83 qt_api = os.environ.get('QT_API', None)
84 if qt_api is None:
85 #no ETS variable. Ask mpl, then use default fallback path
86 return matplotlib_options(mpl) or [QT_API_PYQT_DEFAULT, QT_API_PYSIDE,
87 QT_API_PYQT5, QT_API_PYSIDE2]
88 elif qt_api not in _qt_apis:
89 raise RuntimeError("Invalid Qt API %r, valid values are: %r" %
90 (qt_api, ', '.join(_qt_apis)))
91 else:
92 return [qt_api]
93
94api_opts = get_options()
95QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)

Callers 1

qt_for_kernel.pyFile · 0.85

Calls 3

loaded_apiFunction · 0.90
check_versionFunction · 0.90
matplotlib_optionsFunction · 0.85

Tested by

no test coverage detected