]> git.lyx.org Git - lyx.git/blob - lib/scripts/prefs2prefs_prefs.py
8eb3d2e65a336de20731861002b61d24a493ef61
[lyx.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 current_format = 1
21
22 ###########################################################
23 #
24 # Conversion chain
25
26 no_match = (False, [])
27
28 def remove_obsolete(line):
29   tags = ("\\use_tempdir", "\\spell_command", "\\personal_dictionary",
30         "\\plaintext_roff_command", "\\use_alt_language", 
31         "\\use_escape_chars", "\\use_input_encoding",
32         "\\use_personal_dictionary", "\\use_pspell")
33   line = line.lstrip()
34   for tag in tags:
35     if line.startswith(tag):
36       return (True, "")
37   return no_match
38
39
40 conversions = [
41         [ # this will be a long list of conversions for format 0
42     remove_obsolete
43         ] # end conversions for format 0
44 ]