#NEWLINE# def update_user_library( base_library ) : #NEWLINE# #INDENT# 'Update style library with user-defined rc files' #NEWLINE# library = copy . deepcopy ( base_library ) #NEWLINE# stylelib_path = os . path . expanduser ( '~/.mplstylelib' ) #NEWLINE# if ( os . path . exists ( stylelib_path ) and os . path . isdir ( stylelib_path ) ) : #NEWLINE# #INDENT# styles = read_style_directory ( stylelib_path ) #NEWLINE# update_nested_dict ( library , styles ) #NEWLINE# #UNINDENT# for cfg in _config . iter_paths ( [ '~/.mplstyle' , './mplstyle' ] ) : #NEWLINE# #INDENT# styles = read_style_dict ( cfg ) #NEWLINE# update_nested_dict ( library , styles ) #NEWLINE# #UNINDENT# return library