From 10b2ef1af5fdeced877ef01171ac49828b47c1dd Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Wed, 27 Jun 2012 13:41:19 +0200 Subject: [PATCH] lyxpreview: Allow to find python scripts. In particular, lilypond-book is just a python script. On windows, we need to call the python interpreter, using the full path to the script while being wary of spaces in the path. --- lib/scripts/lyxpreview_tools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py index 546ed24248..8408b3a08f 100644 --- a/lib/scripts/lyxpreview_tools.py +++ b/lib/scripts/lyxpreview_tools.py @@ -36,6 +36,7 @@ path = os.environ["PATH"].split(os.pathsep) extlist = [''] if "PATHEXT" in os.environ: extlist += os.environ["PATHEXT"].split(os.pathsep) +extlist.append('.py') use_win32_modules = 0 if os.name == "nt": @@ -99,6 +100,9 @@ def find_exe(candidates): # have found it). Return just the basename to avoid # problems when the path to the executable contains # spaces. + if full_path.lower().endswith('.py'): + return command.replace(prog, '"%s" "%s"' + % (sys.executable, full_path)) return command return None -- 2.39.2