]> git.lyx.org Git - features.git/blob - lib/scripts/prefs2prefs_prefs.py
dab1d81cc816b0d1c59bb464344b2e6d2e8a7724
[features.git] / lib / scripts / prefs2prefs_prefs.py
1 #! /usr/bin/env python
2 # -*- coding: utf-8 -*-
3
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.
7
8 # author Richard Heck
9
10 # Full author contact details are available in file CREDITS
11
12 # This file houses conversion information for the preferences file.
13
14 # The converter functions take a line as argument and return a list: 
15 #       (Bool, NewLine), 
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.
18
19
20 ###########################################################
21 #
22 # Conversion chain
23
24 no_match = (False, [])
25
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",
31         "\\use_spell_lib")
32   line = line.lstrip()
33   for tag in tags:
34     if line.startswith(tag):
35       return (True, "")
36   return no_match
37
38
39 conversions = [
40         [ # this will be a long list of conversions for format 0
41     remove_obsolete
42         ] # end conversions for format 0
43 ]