mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +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):
|
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 prog in candidates:
|
||||||
for directory in path:
|
for directory in path:
|
||||||
if os.name == "nt":
|
for ext in extlist:
|
||||||
full_path = os.path.join(directory, prog + ".exe")
|
full_path = os.path.join(directory, prog + ext)
|
||||||
else:
|
if os.access(full_path, os.X_OK):
|
||||||
full_path = os.path.join(directory, prog)
|
# The thing is in the PATH already (or we wouldn't
|
||||||
|
# have found it). Return just the basename to avoid
|
||||||
if os.access(full_path, os.X_OK):
|
# problems when the path to the executable contains
|
||||||
# The thing is in the PATH already (or we wouldn't
|
# spaces.
|
||||||
# have found it). Return just the basename to avoid
|
return os.path.basename(full_path)
|
||||||
# problems when the path to the executable contains
|
|
||||||
# spaces.
|
|
||||||
return os.path.basename(full_path)
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user