mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fixup inkscape detection on Windows
(cherry picked from commit 53ada26596
)
This commit is contained in:
parent
3df1e0d70e
commit
6c6e1c1e17
@ -542,6 +542,17 @@ def checkInkscape():
|
|||||||
try:
|
try:
|
||||||
aKey = winreg.OpenKey(aReg, r"inkscape.svg\DefaultIcon")
|
aKey = winreg.OpenKey(aReg, r"inkscape.svg\DefaultIcon")
|
||||||
val = winreg.QueryValueEx(aKey, "")
|
val = winreg.QueryValueEx(aKey, "")
|
||||||
|
valentry = str(val[0])
|
||||||
|
if valentry.find('"') > 0:
|
||||||
|
return valentry.split('"')[1]
|
||||||
|
elif valentry.find(',') > 0:
|
||||||
|
return valentry.split(',')[0]
|
||||||
|
else:
|
||||||
|
return 'inkscape'
|
||||||
|
except EnvironmentError:
|
||||||
|
try:
|
||||||
|
aKey = winreg.OpenKey(aReg, r"inkscape.SVG\shell\open\command")
|
||||||
|
val = winreg.QueryValueEx(aKey, "")
|
||||||
return str(val[0]).split('"')[1]
|
return str(val[0]).split('"')[1]
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
try:
|
try:
|
||||||
@ -551,9 +562,14 @@ def checkInkscape():
|
|||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
return 'inkscape'
|
return 'inkscape'
|
||||||
|
|
||||||
|
|
||||||
def checkInkscapeStable():
|
def checkInkscapeStable():
|
||||||
''' Check whether we use Inkscape >= 1.0 '''
|
''' Check whether we use Inkscape >= 1.0 '''
|
||||||
version_string = cmdOutput("inkscape --version")
|
inkscape_bin = inkscape_cl
|
||||||
|
if os.name == 'nt':
|
||||||
|
# Windows needs the full path, quoted if it contains spaces
|
||||||
|
inkscape_bin = quoteIfSpace(os.path.join(inkscape_path, inkscape_cl))
|
||||||
|
version_string = cmdOutput(inkscape_bin + " --version")
|
||||||
if version_string.find(' 0.') > 0:
|
if version_string.find(' 0.') > 0:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
@ -1936,11 +1952,11 @@ Format %i
|
|||||||
# On Windows, we need to call the "inkscape.com" wrapper
|
# On Windows, we need to call the "inkscape.com" wrapper
|
||||||
# for command line purposes. Other OSes do not differentiate.
|
# for command line purposes. Other OSes do not differentiate.
|
||||||
inkscape_cl = inkscape_gui
|
inkscape_cl = inkscape_gui
|
||||||
inkscape_stable = checkInkscapeStable()
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
inkscape_cl = inkscape_gui.replace('.exe', '.com')
|
inkscape_cl = inkscape_gui.replace('.exe', '.com')
|
||||||
# On MacOSX, Inkscape requires full path file arguments. This
|
# On MacOSX, Inkscape requires full path file arguments. This
|
||||||
# is not needed on Linux and Win and even breaks the latter.
|
# is not needed on Linux and Win and even breaks the latter.
|
||||||
|
inkscape_stable = checkInkscapeStable()
|
||||||
checkFormatEntries(dtl_tools)
|
checkFormatEntries(dtl_tools)
|
||||||
checkConverterEntries()
|
checkConverterEntries()
|
||||||
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
|
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
|
||||||
|
Loading…
Reference in New Issue
Block a user