From: Richard Heck Date: Tue, 18 Jan 2011 19:35:54 +0000 (+0000) Subject: Update prefs2prefs again. Thanks Vincent. X-Git-Tag: 2.0.0~1060 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=18a015081b00eb8aae20e290b6197a389f7cc843;p=features.git Update prefs2prefs again. Thanks Vincent. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37255 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py index 936b95711f..55ada5959a 100644 --- a/lib/scripts/prefs2prefs_prefs.py +++ b/lib/scripts/prefs2prefs_prefs.py @@ -21,8 +21,17 @@ # # Conversion chain +def simple_renaming(line, old, new): + if line.find(old) == -1: + return no_match + line = line.replace(old, new) + return (True, line) + no_match = (False, []) +######################## +### Format 1 conversions + def remove_obsolete(line): tags = ("\\use_tempdir", "\\spell_command", "\\personal_dictionary", "\\plaintext_roff_command", "\\use_alt_language", @@ -47,9 +56,17 @@ def language_use_babel(line): newline = "\\language_package_selection " + newval return (True, newline) +def language_package(line): + return simple_renaming(line, "\\language_package", "\\language_custom_package") + + +######################## + + conversions = [ [ # this will be a long list of conversions for format 0 remove_obsolete, - language_use_babel + language_use_babel, + language_package ] # end conversions for format 0 ]