]> git.lyx.org Git - features.git/commitdiff
prefs2prefs: While handling converters, make sure
authorKornel Benko <kornel@lyx.org>
Sat, 23 Mar 2013 14:31:21 +0000 (15:31 +0100)
committerKornel Benko <kornel@lyx.org>
Sat, 23 Mar 2013 14:31:21 +0000 (15:31 +0100)
the entry is really '\converter' and not e.g. '\converter_cache_maxage'

lib/scripts/prefs2prefs_prefs.py

index c8497fa3ebe2b5b7d3dd14abcd1d6be6f4abe306..3c0e10edfea31596474c7c3653d307928d1c3942 100644 (file)
@@ -239,6 +239,8 @@ def add_mime_types(line):
                converted = converted + '       ""'
        return (True, converted)
 
+re_converter = re.compile(r'^\\converter\s+', re.IGNORECASE)
+
 def split_pdf_format(line):
        # strictly speaking, a new format would not require to bump the
        # version number, but the old pdf format was hardcoded at several
@@ -259,7 +261,7 @@ def split_pdf_format(line):
                if entries[1] == 'pdf':
                        converted = line + "\n" + entries[0] + ' pdf6 "' + entries[2] + '"'
                        return (True, converted)
-       elif line.lower().startswith("\\converter"):
+       elif re_converter.match(line):
                entries = get_format(line)
                # The only converter from pdf that is touched is pdf->eps:
                # All other converters are likely meant for further processing on export.