From 3e34d6f23c61268ec3f05e05123205e1584e241f Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 19 May 2004 14:56:33 +0000 Subject: [PATCH] Append ".exe" to the name of the searched-for program on Win32. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8765 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 6 ++++++ lib/scripts/legacy_lyxpreview2ppm.py | 6 +++++- lib/scripts/lyxpreview2bitmap.py | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 02fb40d2b7..0e004c2473 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2004-05-19 Angus Leeming + + * scripts/lyxpreview2bitmap.py (find_exe): + * scripts/legacy_lyxpreview2ppm.py (find_exe): append ".exe" to the + program name on Win32. + 2004-05-18 Angus Leeming * legacy_lyxpreview2ppm.py: search for "gswin32" also when looking diff --git a/lib/scripts/legacy_lyxpreview2ppm.py b/lib/scripts/legacy_lyxpreview2ppm.py index 6105e4418e..9b39354673 100644 --- a/lib/scripts/legacy_lyxpreview2ppm.py +++ b/lib/scripts/legacy_lyxpreview2ppm.py @@ -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 diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py index d7802edf70..bb7438bf06 100755 --- a/lib/scripts/lyxpreview2bitmap.py +++ b/lib/scripts/lyxpreview2bitmap.py @@ -67,7 +67,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 -- 2.39.5