def find_exe(candidates, path):
for prog in candidates:
for directory in path:
- full_path = os.path.join(directory, prog)
+ if os.name == "nt":
+ full_path = os.path.join(directory, prog + ".exe")
+ else:
+ full_path = os.path.join(directory, prog)
+
if os.access(full_path, os.X_OK):
return full_path
path = string.split(os.getenv("PATH"), os.pathsep)
latex = find_exe_or_terminate(["pplatex", "latex2e", "latex"], path)
dvips = find_exe_or_terminate(["dvips"], path)
- gs = find_exe_or_terminate(["gs"], path)
+ gs = find_exe_or_terminate(["gswin32", "gs"], path)
pnmcrop = find_exe(["pnmcrop"], path)
# Move color information into the latex file.