mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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.
This commit is contained in:
parent
3e5c9e51de
commit
5e030858e6
@ -63,6 +63,7 @@ def find_exe(candidates, path):
|
||||
extlist = ['']
|
||||
if "PATHEXT" in os.environ:
|
||||
extlist = extlist + os.environ["PATHEXT"].split(os.pathsep)
|
||||
extlist.append('.py')
|
||||
|
||||
for prog in candidates:
|
||||
for directory in path:
|
||||
@ -73,6 +74,8 @@ def find_exe(candidates, path):
|
||||
# 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 '"%s" "%s"' % (sys.executable, full_path)
|
||||
return os.path.basename(full_path)
|
||||
|
||||
return None
|
||||
|
@ -71,6 +71,8 @@ What's new
|
||||
|
||||
- Insets in a bibliography entry are shown as text in the citation dialog.
|
||||
|
||||
- Correctly detect python scripts required by the preview mechanism.
|
||||
|
||||
|
||||
* DOCUMENTATION AND LOCALIZATION
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user