[LyX/master] Remove wmf2eps as EMF > EPS converter

2017-10-29 Thread Juergen Spitzmueller
commit a47bc7f799e1f97bcb8e94445ee96dcf14650d3c
Author: Juergen Spitzmueller 
Date:   Sun Oct 29 16:09:12 2017 +0100

Remove wmf2eps as EMF > EPS converter

The program can only deal with WMF.
---
 lib/configure.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 40066d6..63b88f7 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1018,7 +1018,7 @@ def checkConverterEntries():
% (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'\converter wmfeps"%%"   ""'])
 #
-checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o 
$$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-eps=%s$$o'
+checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 
inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-eps=%s$$o'
% (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'\converter emfeps"%%"   ""'])
 #


[LyX/master] Only use full path for inkscape file arguments on Mac.

2017-10-29 Thread Juergen Spitzmueller
commit 22125fa6de76ec884a0a0c41506e78a8fdae575c
Author: Juergen Spitzmueller 
Date:   Sun Oct 29 08:52:15 2017 +0100

Only use full path for inkscape file arguments on Mac.
---
 lib/configure.py |   24 +---
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index f13dcbe..40066d6 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1014,16 +1014,18 @@ def checkConverterEntries():
 \converter tgif   png"tgif -print -color -png -o $$d $$i"  ""
 \converter tgif   pdf6   "tgif -print -color -pdf -stdout $$i > $$o"   
""'''])
 #
-checkProg('a WMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o 
$$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui 
--export-eps=$$p$$o'],
+checkProg('a WMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o 
$$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-eps=%s$$o'
+   % (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'\converter wmfeps"%%"   ""'])
 #
-checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o 
$$o $$i', inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui 
--export-eps=$$p$$o'],
+checkProg('an EMF -> EPS converter', ['metafile2eps $$i $$o', 'wmf2eps -o 
$$o $$i', inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-eps=%s$$o'
+   % (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'\converter emfeps"%%"   ""'])
 #
-checkProg('a WMF -> PDF converter', [inkscape_name + ' --file=$$p$$i 
--export-area-drawing --without-gui --export-pdf=$$p$$o'],
+checkProg('a WMF -> PDF converter', [inkscape_name + ' --file=%s$$i 
--export-area-drawing --without-gui --export-pdf=%s$$o' % (inkscape_fileprefix, 
inkscape_fileprefix)],
 rc_entry = [ r'\converter wmfpdf6"%%"  ""'])
 #
-checkProg('an EMF -> PDF converter', [inkscape_name + ' --file=$$p$$i 
--export-area-drawing --without-gui --export-pdf=$$p$$o'],
+checkProg('an EMF -> PDF converter', [inkscape_name + ' --file=%s$$i 
--export-area-drawing --without-gui --export-pdf=%s$$o' % (inkscape_fileprefix, 
inkscape_fileprefix)],
 rc_entry = [ r'\converter emfpdf6"%%"  ""'])
 # Only define a converter to pdf6 for graphics
 checkProg('an EPS -> PDF converter', ['epstopdf'],
@@ -1069,17 +1071,20 @@ def checkConverterEntries():
 rc_entry = [ r'\converter svgsvgz   "%%"   ""'])
 # Only define a converter to pdf6 for graphics
 # Prefer rsvg-convert over inkscape since it is faster (see 
http://www.lyx.org/trac/ticket/9891)
-checkProg('a SVG -> PDF converter', ['rsvg-convert -f pdf -o $$o $$i', 
inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui 
--export-pdf=$$p$$o'],
+checkProg('a SVG -> PDF converter', ['rsvg-convert -f pdf -o $$o $$i', 
inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-pdf=%s$$o'
+   % (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'''\converter svgpdf6   "%%"""
 \converter svgz   pdf6   "%%"""'''],
 path = ['', inkscape_path])
 #
-checkProg('a SVG -> EPS converter', ['rsvg-convert -f ps -o $$o $$i', 
inkscape_name + ' --file=$$p$$i --export-area-drawing --without-gui 
--export-eps=$$p$$o'],
+checkProg('a SVG -> EPS converter', ['rsvg-convert -f ps -o $$o $$i', 
inkscape_name + ' --file=%s$$i --export-area-drawing --without-gui 
--export-eps=%s$$o'
+   % (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'''\converter svgeps"%%"""
 \converter svgz   eps"%%"""'''],
 path = ['', inkscape_path])
 #
-checkProg('a SVG -> PNG converter', ['rsvg-convert -f png -o $$o $$i', 
inkscape_name + ' --without-gui --file=$$i --export-png=$$o'],
+checkProg('a SVG -> PNG converter', ['rsvg-convert -f png -o $$o $$i', 
inkscape_name + ' --without-gui --file=%s$$i --export-png=%s$$o'
+   % (inkscape_fileprefix, inkscape_fileprefix)],
 rc_entry = [ r'''\converter svgpng"%%""",
 \converter svgz   png"%%"""'''],
 path = ['', inkscape_path])
@@ -1850,6 +1855,11 @@ Format %i
 java = checkProg('a java interpreter', ['java'])[1]
 perl = checkProg('a perl interpreter', ['perl'])[1]
 (inkscape_path, inkscape_name) = os.path.split(checkInkscape())
+# On MacOSX, Inkscape requires full path file arguments. This
+# is not needed on Linux and Win and even breaks the latter.
+inkscape_fileprefix = ""
+if sys.platform == 'darwin':
+inkscape_fileprefix = "$$p"
 checkFormatEntries(dtl_tools)
 checkConverterEntries()
 (chk_docbook, bool_docbook, docbook_cmd) = 

[LyX/master] cmake documentation handling: sort out encoding problems. Let srcipt work under Python2 and Python3, also if the locale is not set to utf8.

2017-10-29 Thread Kornel Benko
commit 51e32a36d696f3f4e2c43642b6f5587a8f5855aa
Author: Kornel Benko 
Date:   Sun Oct 29 09:49:39 2017 +0100

cmake documentation handling: sort out encoding problems.
Let srcipt work under Python2 and Python3,
also if the locale is not set to utf8.

Patch from Günter Milde, sort of cherry-pick from 
9086db662d47e1b4be93551ccfefa8c1090e040b
---
 development/cmake/doc/ReplaceValues.py |   34 
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/development/cmake/doc/ReplaceValues.py 
b/development/cmake/doc/ReplaceValues.py
index ded26cb..da1d42a 100755
--- a/development/cmake/doc/ReplaceValues.py
+++ b/development/cmake/doc/ReplaceValues.py
@@ -19,13 +19,12 @@ Subst = {}  # map of desired substitutions
 prog = re.compile("")
 
 def createProg():
-matchingS = "\\b|\\b".join(Subst.keys())
-pattern = "".join(["(.*)(\\b", matchingS, "\\b)(.*)"])
+matchingS = u"\\b|\\b".join(Subst.keys())
+pattern = u"".join(["(.*)(\\b", matchingS, "\\b)(.*)"])
 return re.compile(pattern)
 
 def SubstituteDataInLine(line):
-result = line
-m = prog.match(result)
+m = prog.match(line)
 if m:
 return "".join([SubstituteDataInLine(m.group(1)),
 Subst[m.group(2)],
@@ -34,25 +33,26 @@ def SubstituteDataInLine(line):
 
 
 def SubstituteDataInFile(InFile):
-for line in codecs.open(InFile, 'r', 'utf-8'):
+for line in codecs.open(InFile, 'r', 'UTF-8'):
 print(SubstituteDataInLine(line[:-1]))
 
 ##
 
-
-args = sys.argv
-
-del args[0] # we don't need the name ot this script
-while len(args) > 0:
-arg = args[0]
-entry = args[0].split("=",1)
+# ensure standard output with UTF8 encoding:
+if sys.version_info < (3,0):
+sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
+else:
+sys.stdout = codecs.getwriter('UTF-8')(sys.stdout.buffer)
+
+for arg in sys.argv[1:]: # skip first arg (name of this script)
+if sys.version_info < (3,0):
+# support non-ASCII characters in arguments
+arg = arg.decode(sys.stdin.encoding or 'UTF-8')
+entry = arg.split("=", 1)
 if len(entry) == 2:
-key=entry[0]
-val=entry[1]
+key, val = entry
 if len(key) > 0:
 Subst[key] = val
 else:
 prog = createProg()
-SubstituteDataInFile(args[0])
-del args[0]
-
+SubstituteDataInFile(arg)