]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx2lyx
Fix previous leftover transformation. (opt -> file)
[lyx.git] / lib / lyx2lyx / lyx2lyx
index 4d9b2d126e1a92c84eba7b664d9a8603fd9a33e0..162c348e05913c9fa521fa6a27a925a7cdc08d4c 100755 (executable)
@@ -59,7 +59,7 @@ def parse_options(argv):
         if o in ("-q", "--quiet"):
             debug = 0
         if o in ("-l", "--list"):
-            # list available formats
+            print LyX.formats_list()
             sys.exit()
         if o in ("-o", "--output"):
             output = a
@@ -73,15 +73,12 @@ def parse_options(argv):
     return end_format, input, output, error, debug
 
 
-if __name__ == "__main__":
-    end_format, input, output, error, debug = parse_options(sys.argv)
-    file = LyX.FileInfo(end_format, input, output, error, debug)
-
-    mode, convertion_chain = file.chain()
-    file.warning("convertion chain: " + str(convertion_chain), 3)
-
-    for step in convertion_chain:
-        convert = getattr(__import__("lyx_" + step), mode)
-        convert(file)
+def main(argv):
+    end_format, input, output, error, debug = parse_options(argv)
+    file = LyX.File(end_format, input, output, error, debug)
 
+    file.convert()
     file.write()
+
+if __name__ == "__main__":
+    main(sys.argv)