Author: rgheck
Date: Sun Jan 16 04:59:43 2011
New Revision: 37225
URL: http://www.lyx.org/trac/changeset/37225
Log:
A little more work on prefs2prefs.
More to come, Pavel!
Modified:
lyx-devel/trunk/lib/scripts/prefs2prefs.py
lyx-devel/trunk/lib/scripts/prefs2prefs_lfuns.py
lyx-devel/trunk/lib/scripts/prefs2prefs_prefs.py
Modified: lyx-devel/trunk/lib/scripts/prefs2prefs.py
==============================================================================
--- lyx-devel/trunk/lib/scripts/prefs2prefs.py Sat Jan 15 23:39:46 2011
(r37224)
+++ lyx-devel/trunk/lib/scripts/prefs2prefs.py Sun Jan 16 04:59:43 2011
(r37225)
@@ -137,8 +137,8 @@
source = sys.stdin
output = sys.stdout
elif len(args) == 2:
- source = open(args[1], 'rb')
- output = open(args[2], 'wb')
+ source = open(args[0], 'rb')
+ output = open(args[1], 'wb')
opened_files = True
else:
usage()
Modified: lyx-devel/trunk/lib/scripts/prefs2prefs_lfuns.py
==============================================================================
--- lyx-devel/trunk/lib/scripts/prefs2prefs_lfuns.py Sat Jan 15 23:39:46
2011 (r37224)
+++ lyx-devel/trunk/lib/scripts/prefs2prefs_lfuns.py Sun Jan 16 04:59:43
2011 (r37225)
@@ -28,8 +28,8 @@
#
# These accept a line as argument and should return a list:
# (bool, newline)
-# where the bool indicates whether we changed anything. In
-# that case, one normally returns: (False, []).
+# where the bool indicates whether we changed anything. If not,
+# one normally returns: (False, []).
no_match = (False, [])
Modified: lyx-devel/trunk/lib/scripts/prefs2prefs_prefs.py
==============================================================================
--- lyx-devel/trunk/lib/scripts/prefs2prefs_prefs.py Sat Jan 15 23:39:46
2011 (r37224)
+++ lyx-devel/trunk/lib/scripts/prefs2prefs_prefs.py Sun Jan 16 04:59:43
2011 (r37225)
@@ -23,8 +23,22 @@
#
# Conversion chain
+no_match = (False, [])
+
+def remove_obsolete(line):
+ tags = ("\\use_tempdir", "\\spell_command", "\\personal_dictionary",
+ "\\plaintext_roff_command", "\\use_alt_language",
+ "\\use_escape_chars", "\\use_input_encoding",
+ "\\use_personal_dictionary", "\\use_pspell")
+ line = line.lstrip()
+ for tag in tags:
+ if line.startswith(tag):
+ return (True, "")
+ return no_match
+
+
conversions = [
[ # this will be a long list of conversions for format 0
-
+ remove_obsolete
] # end conversions for format 0
]