def find_tex_file(filename, format=None):
 cmd = ['kpsewhich']
 if (format is not None):
  cmd += [('--format=' + format)]
 cmd += [filename]
 matplotlib.verbose.report(('find_tex_file(%s): %s' % (filename, cmd)), 'debug')
 pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
 result = pipe.communicate()[0].rstrip()
 matplotlib.verbose.report(('find_tex_file result: %s' % result), 'debug')
 return result

def find_tex_file ( filename , format = None ) : cmd = [ 'kpsewhich' ] if ( format is not None ) : cmd += [ ( '--format=' + format ) ] cmd += [ filename ] matplotlib . verbose . report ( ( 'find_tex_file(%s): %s' % ( filename , cmd ) ) , 'debug' ) pipe = subprocess . Popen ( cmd , stdout = subprocess . PIPE ) result = pipe . communicate ( ) [ 0 ] . rstrip ( ) matplotlib . verbose . report ( ( 'find_tex_file result: %s' % result ) , 'debug' ) return result
call :program:kpsewhich to find a file in the texmf tree .