@lru_cache()
def _call_fc_list():
 timer = Timer(5, (lambda : warnings.warn(u'Matplotlib is building the font cache using fc-list. This may take a moment.')))
 timer.start()
 try:
  out = subprocess.check_output([str(u'fc-list'), u'--format=%{file}\\n'])
 except (OSError, subprocess.CalledProcessError):
  return []
 finally:
  timer.cancel()
 fnames = []
 for fname in out.split('\n'):
  try:
   fname = six.text_type(fname, sys.getfilesystemencoding())
  except UnicodeDecodeError:
   continue
  fnames.append(fname)
 return fnames

@ lru_cache ( ) def _call_fc_list ( ) : timer = Timer ( 5 , ( lambda : warnings . warn ( u'Matplotlib is building the font cache using fc-list. This may take a moment.' ) ) ) timer . start ( ) try : out = subprocess . check_output ( [ str ( u'fc-list' ) , u'--format=%{file}\\n' ] ) except ( OSError , subprocess . CalledProcessError ) : return [ ] finally : timer . cancel ( ) fnames = [ ] for fname in out . split ( '\n' ) : try : fname = six . text_type ( fname , sys . getfilesystemencoding ( ) ) except UnicodeDecodeError : continue fnames . append ( fname ) return fnames
cache and list the font filenames known to fc-list .