2 # -*- coding: utf-8 -*-
4 # file prefs2prefs-lfuns.py
5 # This file is part of LyX, the document processor.
6 # Licence details can be found in the file COPYING.
10 # Full author contact details are available in file CREDITS
12 # This file houses conversion information for the preferences file.
14 # The converter functions take a line as argument and return a list:
16 # where the Bool says if we've modified anything and the NewLine is
17 # the new line, if so, which will be used to replace the old line.
20 ###########################################################
24 no_match = (False, [])
26 def remove_obsolete(line):
27 tags = ("\\use_tempdir", "\\spell_command", "\\personal_dictionary",
28 "\\plaintext_roff_command", "\\use_alt_language",
29 "\\use_escape_chars", "\\use_input_encoding",
30 "\\use_personal_dictionary", "\\use_pspell",
34 if line.startswith(tag):
38 def language_use_babel(line):
39 if not line.startswith("\language_use_babel"):
41 re_lub = re.compile(r'^\\language_use_babel\s+(true|false)')
42 m = re_lub.match(line)
47 newline = "\\language_package_selection " + newval
48 return (True, newline)
51 [ # this will be a long list of conversions for format 0
54 ] # end conversions for format 0