]> git.lyx.org Git - features.git/commitdiff
Fix loading of files created by the development version
authorDekel Tsur <dekelts@tau.ac.il>
Fri, 14 Mar 2003 13:37:34 +0000 (13:37 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Fri, 14 Mar 2003 13:37:34 +0000 (13:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6503 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/lyx2lyx/lyx2lyx
src/ChangeLog
src/buffer.C

index 20383755ebd7428d0d714a22e2e3dfbd7652bdc5..9feb2274f0f817efc64ff590cd64356f01d04442 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-14  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * lyx2lyx/lyx2lyx (main): Handle development version files
+
 2003-03-12  Angus Leeming  <leeming@lyx.org>
 
        * images/font-free.xpm: renamed as font-free-apply.xpm.
index c69d1ca57d7de3d728143f849fdc29a2fe8d6da6..2dc120037f4398ca5c3d4c6fbc11af5fcf95da13 100755 (executable)
@@ -37,7 +37,7 @@ opt.quiet = 0
 
 format = re.compile(r"(\d)[\.,]?(\d\d)")
 fileformat = re.compile(r"\\lyxformat\s*(\S*)")
-lst_ft = ["210", "215", "216", "217", "218", "220", "221", "222"]
+lst_ft = ["210", "215", "216", "217", "218", "220", "221", "223"]
 
 def usage():
     print """Usage: lyx2lyx [options] file1
@@ -105,10 +105,17 @@ def lyxformat(fmt):
     else:
         sys.stderr.write(fmt + ": " + error.invalid_format)
         sys.exit(2)
-    if fmt not in lst_ft:
-        sys.stderr.write(fmt + ": " + error.format_not_supported)
-        sys.exit(1)
-    return fmt
+
+    if fmt in lst_ft:
+        return fmt
+
+    x = int(fmt)
+    if x < int(lst_ft[-1]) and x > int(lst_ft[-2]):
+        sys.stderr.write("lyx2lyx: A development version file.\n")
+        return lst_ft[-2]
+
+    sys.stderr.write(fmt + ": " + error.format_not_supported)
+    sys.exit(1)
 
 def read_file(file, header, body):
     """Reads a file into the header and body parts"""
@@ -164,7 +171,7 @@ def main(argv):
 
     if opt.start:
         if opt.start != fmt:
-            print warning.dont_match + ":", opt.start, fmt
+            sys.stderr.write("%s: %s %s\n" % (warning.dont_match, opt.start, fmt))
     else:
         opt.start = fmt
 
index e94795b0da9091f77b7f1901226bf3388691154f..c54fd8db95655104b95659218a679b635b6e4683 100644 (file)
@@ -1,3 +1,6 @@
+2003-03-14  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * buffer.C: increment LYX_FORMAT to 223
 
 2003-03-14 André Pönitz <poenitz@gmx.net>
 
index c17dc2e2cde9c7acbf2d24d177f400bcf0019a44..52595e0130ffd0605b9d81e23aca0285b85a8abf 100644 (file)
@@ -115,7 +115,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 222;
+const int LYX_FORMAT = 223;
 
 } // namespace anon