prefs2prefs: While handling converters, make sure

the entry is really '\converter' and not e.g. '\converter_cache_maxage'
This commit is contained in:
Kornel Benko 2013-03-23 15:31:21 +01:00
parent 7dac3a2715
commit f9e41a159e

View File

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