def read_style_directory(style_dir):
 styles = dict()
 for (path, name) in iter_style_files(style_dir):
  with warnings.catch_warnings(record=True) as warns:
   styles[name] = rc_params_from_file(path, use_default_template=False)
  for w in warns:
   message = (u'In %s: %s' % (path, w.message))
   warnings.warn(message)
 return styles

def read_style_directory ( style_dir ) : styles = dict ( ) for ( path , name ) in iter_style_files ( style_dir ) : with warnings . catch_warnings ( record = True ) as warns : styles [ name ] = rc_params_from_file ( path , use_default_template = False ) for w in warns : message = ( u'In %s: %s' % ( path , w . message ) ) warnings . warn ( message ) return styles
return dictionary of styles defined in style_dir .