30
30
# Users may want multiple library paths, so store a list of paths.
31
31
USER_LIBRARY_PATHS = [os .path .join (mpl .get_configdir (), 'stylelib' )]
32
32
STYLE_EXTENSION = 'mplstyle'
33
+
34
+ # Deprecated in Matplotlib 3.5.
33
35
STYLE_FILE_PATTERN = re .compile (r'([\S]+).%s$' % STYLE_EXTENSION )
34
36
35
37
@@ -155,12 +157,14 @@ def context(style, after_reset=False):
155
157
yield
156
158
157
159
160
+ @_api .deprecated ("3.5" )
158
161
def load_base_library ():
159
162
"""Load style library defined in this package."""
160
163
library = read_style_directory (BASE_LIBRARY_PATH )
161
164
return library
162
165
163
166
167
+ @_api .deprecated ("3.5" )
164
168
def iter_user_libraries ():
165
169
for stylelib_path in USER_LIBRARY_PATHS :
166
170
stylelib_path = os .path .expanduser (stylelib_path )
@@ -170,7 +174,7 @@ def iter_user_libraries():
170
174
171
175
def update_user_library (library ):
172
176
"""Update style library with user-defined rc files."""
173
- for stylelib_path in iter_user_libraries ( ):
177
+ for stylelib_path in map ( os . path . expanduser , USER_LIBRARY_PATHS ):
174
178
styles = read_style_directory (stylelib_path )
175
179
update_nested_dict (library , styles )
176
180
return library
@@ -204,10 +208,8 @@ def update_nested_dict(main_dict, new_dict):
204
208
205
209
# Load style library
206
210
# ==================
207
- _base_library = load_base_library ()
208
-
211
+ _base_library = read_style_directory (BASE_LIBRARY_PATH )
209
212
library = None
210
-
211
213
available = []
212
214
213
215
0 commit comments