+ elif not overwrite:
+ lyxfile1 = getlyxinput(lyx,
+ os.path.join(inputdir, base + ".lyx.lyx"),
+ os.path.join(outputdir, base + ".lyx1.lyx") , uselyx2lyx)
+ if lyxfile1 is None:
+ errors.append(f)
+ else:
+ lyxfile2 = getlyxinput(lyx,
+ os.path.join(outputdir, base + ".lyx"),
+ os.path.join(outputdir, base + ".lyx2.lyx"), uselyx2lyx)
+ if lyxfile2 is None:
+ errors.append(f)
+ else:
+ t1 = time.ctime(os.path.getmtime(lyxfile1))
+ t2 = time.ctime(os.path.getmtime(lyxfile2))
+ f1 = open(lyxfile1, 'r')
+ f2 = open(lyxfile2, 'r')
+ lines1 = f1.readlines()
+ i1 = 0
+ for linex in lines1:
+ if linex[:-1] == '\origin ' + inputdir + '/':
+ lines1[i1] = '\origin ' + outputdir + '/' + "\n"
+ break
+ i1 = i1+1
+ lines2 = f2.readlines()
+ f1.close()
+ f2.close()
+ # ignore the first line e.g. the version of lyx
+ if not compareLyx(lines1, lines2):
+ diff = difflib.unified_diff(lines1, lines2, lyxfile1, lyxfile2, t1, t2)
+ sys.stdout.writelines(diff)
+ errors.append(f)
+