]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/prefs2prefs_prefs.py
#7894 explain the status column of mac bindings
[lyx.git] / lib / scripts / prefs2prefs_prefs.py
index 73846524f764e1283ab35f61d740ac53533e3a7e..5ce10511bce434564cb85dde500db2c19ccb39e9 100644 (file)
 #   Support for multiple file extensions per format.
 #   No conversion necessary.
 
+# Incremented to format 3, r39705 by tommaso
+#   Support for file formats that are natively (g)zipped.
+#   We must add the flag zipped=native to formats that
+#   were previously hardcoded in the C++ source: dia.
+
+# Incremented to format 4, r40028 by vfr
+#   Remove support for default paper size.
+
+# Incremented to format 5, r40030 by vfr
+#   Add a default length unit.
+#   No conversion necessary.
+
+
 import re
 
 
@@ -101,6 +114,24 @@ def export_menu(line):
        return (True,
                "\\Format %s \"%s,menu=export\"" % (fmat, opts))
 
+zipre = re.compile(r'^\\[Ff]ormat\s+("?dia"?\s+.*)\s+"([^"]*?)"')
+def zipped_native(line):
+       if not line.lower().startswith("\\format"):
+               return no_match
+       m = zipre.match(line)
+       if not m:
+               return no_match
+       fmat = m.group(1)
+       opts = m.group(2)
+       return (True,
+               "\\Format %s \"%s,zipped=native\"" % (fmat, opts))
+
+def remove_default_papersize(line):
+       if not line.startswith("\\default_papersize"):
+               return no_match
+       return (True, "")
+
+
 ########################
 
 
@@ -113,4 +144,7 @@ conversions = [
                language_package
        ]],
        [  2, []],
+       [  3, [ zipped_native ]],
+       [  4, [ remove_default_papersize ]],
+       [  5, []],
 ]