MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / is_interactive_backend

Function is_interactive_backend

pydev_ipython/matplotlibtools.py:84–101  ·  view source on GitHub ↗

Check if backend is interactive

(backend)

Source from the content-addressed store, hash-verified

82
83
84def is_interactive_backend(backend):
85 """Check if backend is interactive"""
86 matplotlib = sys.modules["matplotlib"]
87 new_api_version = (3, 9)
88 installed_version = (_get_major_version(matplotlib), _get_minor_version(matplotlib))
89
90 if installed_version >= new_api_version:
91 interactive_bk = matplotlib.backends.backend_registry.list_builtin(matplotlib.backends.BackendFilter.INTERACTIVE)
92 non_interactive_bk = matplotlib.backends.backend_registry.list_builtin(matplotlib.backends.BackendFilter.NON_INTERACTIVE)
93 else:
94 from matplotlib.rcsetup import interactive_bk, non_interactive_bk # @UnresolvedImport
95
96 if backend in interactive_bk:
97 return True
98 elif backend in non_interactive_bk:
99 return False
100 else:
101 return matplotlib.is_interactive()
102
103
104def patch_use(enable_gui_function):

Callers 1

activate_matplotlibFunction · 0.85

Calls 3

_get_major_versionFunction · 0.85
_get_minor_versionFunction · 0.85
is_interactiveMethod · 0.80

Tested by

no test coverage detected