def get_tex_path_variable_texlive(variable, env=None):
 print('Reading path for {0}...'.format(variable))
 if (env is None):
  env = os.environ
 try:
  t = SubprocessTimeoutThread(30, ['kpsewhich', ('--expand-path=$' + variable)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, env=env)
  t.start()
  stdout = t.stdout
  if (stdout is None):
   return None
  return u'\n'.join(re.split('\\r?\\n', stdout.decode('utf-8').strip()))
 except:
  return None

def get_tex_path_variable_texlive ( variable , env = None ) : print ( 'Reading path for {0}...' . format ( variable ) ) if ( env is None ) : env = os . environ try : t = SubprocessTimeoutThread ( 30 , [ 'kpsewhich' , ( '--expand-path=$' + variable ) ] , stdout = subprocess . PIPE , stderr = subprocess . STDOUT , shell = False , env = env ) t . start ( ) stdout = t . stdout if ( stdout is None ) : return None return u'\n' . join ( re . split ( '\\r?\\n' , stdout . decode ( 'utf-8' ) . strip ( ) ) ) except : return None
uses kpsewhich to read the value of a given tex path variable .