@@ -93,6 +93,9 @@ def __init__(self):
93
93
}
94
94
95
95
def _backend_module_name (self , backend ):
96
+ if backend .startswith ("module://" ):
97
+ return backend [9 :]
98
+
96
99
# Return name of module containing the specified backend.
97
100
# Does not check if the backend is valid, use is_valid_backend for that.
98
101
backend = backend .lower ()
@@ -189,7 +192,8 @@ def _validate_and_store_entry_points(self, entries):
189
192
def backend_for_gui_framework (self , framework ):
190
193
"""
191
194
Return the name of the backend corresponding to the specified GUI framework.
192
-
195
+ :
196
+ return backend[9:]
193
197
Parameters
194
198
----------
195
199
framework : str
@@ -224,7 +228,8 @@ def is_valid_backend(self, backend):
224
228
bool
225
229
True if backend is valid, False otherwise.
226
230
"""
227
- backend = backend .lower ()
231
+ if not backend .startswith ("module://" ):
232
+ backend = backend .lower ()
228
233
229
234
# For backward compatibility, convert ipympl and matplotlib-inline long
230
235
# module:// names to their shortened forms.
@@ -342,7 +347,8 @@ def resolve_backend(self, backend):
342
347
The GUI framework, which will be None for a backend that is non-interactive.
343
348
"""
344
349
if isinstance (backend , str ):
345
- backend = backend .lower ()
350
+ if not backend .startswith ("module://" ):
351
+ backend = backend .lower ()
346
352
else : # Might be _auto_backend_sentinel or None
347
353
# Use whatever is already running...
348
354
from matplotlib import get_backend
@@ -395,7 +401,8 @@ def resolve_gui_or_backend(self, gui_or_backend):
395
401
framework : str or None
396
402
The GUI framework, which will be None for a backend that is non-interactive.
397
403
"""
398
- gui_or_backend = gui_or_backend .lower ()
404
+ if not gui_or_backend .startswith ("module://" ):
405
+ gui_or_backend = gui_or_backend .lower ()
399
406
400
407
# First check if it is a gui loop name.
401
408
backend = self .backend_for_gui_framework (gui_or_backend )
0 commit comments