]> git.lyx.org Git - lyx.git/commitdiff
A little more work on prefs2prefs.
authorRichard Heck <rgheck@comcast.net>
Sun, 16 Jan 2011 03:59:43 +0000 (03:59 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 16 Jan 2011 03:59:43 +0000 (03:59 +0000)
More to come, Pavel!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37225 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/prefs2prefs.py
lib/scripts/prefs2prefs_lfuns.py
lib/scripts/prefs2prefs_prefs.py

index 046c58f36a1723789009412388346fd391814891..bdbc7e327a90646dced7c0a0c79c2ce7b6bab5ae 100644 (file)
@@ -137,8 +137,8 @@ def main(argv):
                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()
index 0606736dfde18767360bfe6fb64d6024677c626a..55a95edc8a430349a6d6b131877302df67ec9e1b 100644 (file)
@@ -28,8 +28,8 @@ current_format = 1
 #
 # These accept a line as argument and should return a list:
 #  (bool, newline)
-# where the bool indicates whether we changed anything. I
-# that case, one normally returns: (False, []).
+# where the bool indicates whether we changed anything. If not,
+# one normally returns: (False, []).
 
 no_match = (False, [])
 
index f1404614ad184029c42cb4194c1403fac313a7ac..8eb3d2e65a336de20731861002b61d24a493ef61 100644 (file)
@@ -23,8 +23,22 @@ current_format = 1
 #
 # 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
 ]