Return the gui and mpl backend.
()
| 58 | |
| 59 | |
| 60 | def find_gui_and_backend(): |
| 61 | """Return the gui and mpl backend.""" |
| 62 | matplotlib = sys.modules["matplotlib"] |
| 63 | # WARNING: this assumes matplotlib 1.1 or newer!! |
| 64 | backend = matplotlib.rcParams["backend"] |
| 65 | |
| 66 | # Translate to the real case as in 3.9 the case was forced to lowercase |
| 67 | # but our internal mapping is in the original case. |
| 68 | realcase_backend = lowercase_convert.get(backend, backend) |
| 69 | |
| 70 | # In this case, we need to find what the appropriate gui selection call |
| 71 | # should be for IPython, so we can activate inputhook accordingly |
| 72 | gui = backend2gui.get(realcase_backend, None) |
| 73 | return gui, backend |
| 74 | |
| 75 | |
| 76 | def _get_major_version(module): |
no test coverage detected