mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Fix instant preview on windows when dvipng is not available.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36545 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
912fc37ec4
commit
4feb6cf62b
@ -60,19 +60,20 @@ def make_texcolor(hexcolor, graphics):
|
||||
|
||||
|
||||
def find_exe(candidates, path):
|
||||
extlist = ['']
|
||||
if os.environ.has_key("PATHEXT"):
|
||||
extlist = extlist + os.environ["PATHEXT"].split(os.pathsep)
|
||||
|
||||
for prog in candidates:
|
||||
for directory in path:
|
||||
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):
|
||||
# The thing is in the PATH already (or we wouldn't
|
||||
# have found it). Return just the basename to avoid
|
||||
# problems when the path to the executable contains
|
||||
# spaces.
|
||||
return os.path.basename(full_path)
|
||||
for ext in extlist:
|
||||
full_path = os.path.join(directory, prog + ext)
|
||||
if os.access(full_path, os.X_OK):
|
||||
# The thing is in the PATH already (or we wouldn't
|
||||
# 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 None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user