3030# Users may want multiple library paths, so store a list of paths.
3131USER_LIBRARY_PATHS = [os .path .join (mpl .get_configdir (), 'stylelib' )]
3232STYLE_EXTENSION = 'mplstyle'
33+
34+ # Deprecated in Matplotlib 3.5.
3335STYLE_FILE_PATTERN = re .compile (r'([\S]+).%s$' % STYLE_EXTENSION )
3436
3537
@@ -155,12 +157,14 @@ def context(style, after_reset=False):
155157 yield
156158
157159
160+ @_api .deprecated ("3.5" )
158161def load_base_library ():
159162 """Load style library defined in this package."""
160163 library = read_style_directory (BASE_LIBRARY_PATH )
161164 return library
162165
163166
167+ @_api .deprecated ("3.5" )
164168def iter_user_libraries ():
165169 for stylelib_path in USER_LIBRARY_PATHS :
166170 stylelib_path = os .path .expanduser (stylelib_path )
@@ -170,7 +174,7 @@ def iter_user_libraries():
170174
171175def update_user_library (library ):
172176 """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 ):
174178 styles = read_style_directory (stylelib_path )
175179 update_nested_dict (library , styles )
176180 return library
@@ -204,10 +208,8 @@ def update_nested_dict(main_dict, new_dict):
204208
205209# Load style library
206210# ==================
207- _base_library = load_base_library ()
208-
211+ _base_library = read_style_directory (BASE_LIBRARY_PATH )
209212library = None
210-
211213available = []
212214
213215
0 commit comments