Use program suffix to address lyx-executable, according to suffix

of tex2lyx.

Still the is error in tex2lyx, which searches for invalid suffix to
find the correct lyx executable.
This commit is contained in:
Kornel Benko 2013-01-03 13:02:34 +01:00
parent 5a3a071fc3
commit bd2468c341

View File

@ -43,7 +43,12 @@ def main(argv):
else: else:
error(usage(argv[0])) error(usage(argv[0]))
lyx = os.path.join(os.path.dirname(tex2lyx), "lyx") suffixre = re.search(r'\d+\.\d+$', tex2lyx)
if suffixre:
suffix = suffixre.group()
else:
suffix = ""
lyx = os.path.join(os.path.dirname(tex2lyx), "lyx" + suffix)
inputdir = os.path.dirname(argv[0]) inputdir = os.path.dirname(argv[0])
if len(argv) >= 4+skipcount: if len(argv) >= 4+skipcount:
outputdir = sys.argv[3+skipcount] outputdir = sys.argv[3+skipcount]
@ -103,7 +108,6 @@ def main(argv):
# e.g. '#LyX file created ...' # e.g. '#LyX file created ...'
# '\lyxformat ...' # '\lyxformat ...'
if lines1[2:] != lines2[2:]: if lines1[2:] != lines2[2:]:
sys.stdout.writelines("lines1 != lines2")
diff = difflib.unified_diff(lines1, lines2, lyxfile1, lyxfile2, t1, t2) diff = difflib.unified_diff(lines1, lines2, lyxfile1, lyxfile2, t1, t2)
sys.stdout.writelines(diff) sys.stdout.writelines(diff)
errors.append(f) errors.append(f)