From 2645d57d89c578d7a1c0c26516164f3a71b2113c Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Mon, 3 Oct 2011 16:35:25 +0000 Subject: [PATCH] * lyxpreview_tool.py : Allow to look for commands with arguments. For example, find_exe(["bibtex -min-crossrefs=7"]) should search for bibtex and if it is found, return the string "bibtex -min-crossrefs=7". git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39794 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/lyxpreview_tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py index 7f2dcd75e7..767689f98c 100644 --- a/lib/scripts/lyxpreview_tools.py +++ b/lib/scripts/lyxpreview_tools.py @@ -88,7 +88,8 @@ def make_texcolor(hexcolor, graphics): def find_exe(candidates): global extlist, path - for prog in candidates: + for command in candidates: + prog = command.split()[0] for directory in path: for ext in extlist: full_path = os.path.join(directory, prog + ext) @@ -97,7 +98,7 @@ def find_exe(candidates): # have found it). Return just the basename to avoid # problems when the path to the executable contains # spaces. - return os.path.basename(full_path) + return command return None -- 2.39.2