MCPcopy Index your code
hub / github.com/ipython/ipython / get_options

Function get_options

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

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

()

Source from the content-addressed store, hash-verified

90 mpqt)
91
92def get_options():
93 """Return a list of acceptable QT APIs, in decreasing order of preference."""
94 #already imported Qt somewhere. Use that
95 loaded = loaded_api()
96 if loaded is not None:
97 return [loaded]
98
99 mpl = sys.modules.get("matplotlib", None)
100
101 if mpl is not None and tuple(mpl.__version__.split(".")) < ("1", "0", "2"):
102 # 1.0.1 only supports PyQt4 v1
103 return [QT_API_PYQT_DEFAULT]
104
105 qt_api = os.environ.get('QT_API', None)
106 if qt_api is None:
107 #no ETS variable. Ask mpl, then use default fallback path
108 return matplotlib_options(mpl) or [
109 QT_API_PYQT_DEFAULT,
110 QT_API_PYQT6,
111 QT_API_PYSIDE6,
112 QT_API_PYQT5,
113 QT_API_PYSIDE2,
114 ]
115 elif qt_api not in _qt_apis:
116 raise RuntimeError("Invalid Qt API %r, valid values are: %r" %
117 (qt_api, ', '.join(_qt_apis)))
118 else:
119 return [qt_api]
120
121
122api_opts = get_options()

Callers 1

qt_for_kernel.pyFile · 0.85

Calls 3

loaded_apiFunction · 0.90
matplotlib_optionsFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…