]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/legacy_lyxpreview2ppm.py
make sure docs are disted
[lyx.git] / lib / scripts / legacy_lyxpreview2ppm.py
index dd126afd99a7ca9e01db27831123c226450e3d21..9b39354673a52da2dd5d34dc324f220af8b20687 100644 (file)
@@ -36,7 +36,11 @@ def error(message):
 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
 
@@ -241,7 +245,7 @@ def crop_files(pnmcrop, basename):
         new = t.open(file, "r")
         copyfileobj(new, tmp)
         if not new.close():
-            copyfileobj(tmp, open(file,"wb"))
+            copyfileobj(tmp, open(file,"wb"), 1)
 
 
 def legacy_conversion(argv):
@@ -263,7 +267,7 @@ def legacy_conversion(argv):
     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.