]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/layout2layout.py
French UserGuide.lyx: another update from Jean-Pierre
[lyx.git] / lib / scripts / layout2layout.py
index 1326a81f8faba7572dfe077ac974091bf7ecbf98..a87c300a8872af3725444f85e0da768d5364b9e0 100644 (file)
@@ -168,14 +168,44 @@ import os, re, string, sys
 # Incremented to format 50, 9 May 2014 by forenr
 # Removal of "Separator" layouts
 
+# Incremented to format 51, 29 May 2014 by spitz
+# New Style tag "ToggleIndent"
+
+# Incremented to format 52, 1 December 2014 by spitz
+# New InsetLayout tag "ForceOwnlines"
+
+# Incremented to format 53, 7 December 2014 by spitz
+# New InsetLayout tag "ObsoletedBy"
+
+# Incremented to format 54, 11 Jan 2014 by gb
+# New InsetLayout tag "FixedWidthPreambleEncoding"
+
+# Incremented to format 55, 20 April 2015 by spitz
+# New InsetLayout and Layout tags "PassThruChars"
+
+# Incremented to format 56, 20 May 2015 by spitz
+# New Float tags "AllowedPlacement", "AllowsWide", "AllowsSideways"
+
+# Incremented to format 57, 30 May 2015 by spitz
+# New Layout tag "ParagraphGroup"
+
+# Incremented to format 58, 5 December 2015, by rgh
+# New Layout tag "ProvideStyle"
+# Change "IfStyle" to "ModifyStyle"
+
+# Incremented to format 59, 22 November 2015 by gm
+# New Tag "OutlinerName"
+# New Layout tags "AddToToc", "IsTocCaption"
+# New Layout argument tag "IsTocCaption"
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
 # You might also want to consider running the
-# development/tools/updatelayouts.sh script to update all
+# development/tools/updatelayouts.py script to update all
 # layout files to the new format.
 
-currentFormat = 50
+currentFormat = 59
 
 
 def usage(prog_name):
@@ -244,6 +274,7 @@ def convert(lines):
     re_LabelStringAppendix = re.compile(r'^(\s*)(LabelStringAppendix)(\s+)(("[^"]+")|(\S+))', re.IGNORECASE)
     re_LatexType = re.compile(r'^(\s*)(LatexType)(\s+)(\S+)', re.IGNORECASE)
     re_Style = re.compile(r'^(\s*)(Style)(\s+)(\S+)', re.IGNORECASE)
+    re_IfStyle = re.compile(r'^(\s*)IfStyle(\s+\S+)', re.IGNORECASE)
     re_CopyStyle = re.compile(r'^(\s*)(CopyStyle)(\s+)(\S+)', re.IGNORECASE)
     re_NoStyle = re.compile(r'^(\s*)(NoStyle)(\s+)(\S+)', re.IGNORECASE)
     re_End = re.compile(r'^(\s*)(End)(\s*)$', re.IGNORECASE)
@@ -399,6 +430,28 @@ def convert(lines):
                 i += 1
             continue
 
+        if format == 58:
+            # nothing to do.
+            i += 1
+            continue
+
+        if format == 57:
+            match = re_IfStyle.match(lines[i])
+            if not match:
+                i += 1
+                continue
+            # r'^(\s*)IfStyle(\s+\S+)
+            lead  = match.group(1)
+            trail = match.group(2)
+            lines[i] = lead + "ModifyStyle" + trail
+            i += 1
+            continue
+
+        if format >= 50 and format <= 56:
+            # nothing to do.
+            i += 1
+            continue
+
         if format == 49:
             separator = []