# Full author contact details are available in file CREDITS
-# This script will update a .layout file to format 3
+# This script will update a .layout file to format 6
import os, re, string, sys
+# Incremented to format 4, 6 April 2007, lasgouttes
+# Introduction of generic "Provides" declaration
+
+# Incremented to format 5, 22 August 2007 by vermeer
+# InsetLayout material
+
+# Incremented to format 6, 7 January 2008 by spitz
+# Requires tag added to layout files
+
+# Incremented to format 7, 24 March 2008 by rgh
+# AddToPreamble tag added to layout files
+currentFormat = 7
+
def usage(prog_name):
return ("Usage: %s inputfile outputfile\n" % prog_name +
match = re_Format.match(lines[i])
if match:
format = int(match.group(4))
- if format > 1 and format < 5:
+ if format > 1 and format < currentFormat:
lines[i] = "Format %d" % (format + 1)
only_comment = 0
- elif format == 5:
+ elif format == currentFormat:
# nothing to do
return format
else:
i += 1
continue
+ if format == 6:
+ i += 1
+ continue
+
+ if format == 5:
+ i += 1
+ continue
+
if format == 4:
# Handle conversion to long CharStyle names
match = re_CharStyle.match(lines[i])
# Do the real work
lines = read(input)
format = 1
- while (format < 4):
+ while (format < currentFormat):
format = convert(lines)
write(output, lines)