changeset 2585:cb899abca9a8

1.6 converter: add main function for testing, some fixes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 01 Aug 2007 02:12:27 +0200
parents efac33f4b9e4
children a838bdc4e40a
files MoinMoin/script/migration/1050800.py MoinMoin/script/migration/1059999.py
diffstat 2 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/migration/1050800.py	Wed Aug 01 01:23:54 2007 +0200
+++ b/MoinMoin/script/migration/1050800.py	Wed Aug 01 02:12:27 2007 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 """
     MoinMoin - 1st pass of 1.6 migration
@@ -14,3 +15,7 @@
     dc.pass1()
     return 1059999
 
+
+if __name__ == '__main__':
+    execute(None, './data', None)
+
--- a/MoinMoin/script/migration/1059999.py	Wed Aug 01 01:23:54 2007 +0200
+++ b/MoinMoin/script/migration/1059999.py	Wed Aug 01 02:12:27 2007 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 """
     MoinMoin - 2nd pass of 1.6 migration
@@ -11,15 +12,15 @@
 from _conv160 import DataConverter
 
 def execute(script, data_dir, rev):
-    rename_map1 = os.path.join(data_dir, 'rename1.txt')
-    rename_map2 = os.path.join(data_dir, 'rename2.txt')
-    if not os.path.exists(rename_map2):
+    rename1_map = os.path.join(data_dir, 'rename1.txt')
+    rename2_map = os.path.join(data_dir, 'rename2.txt')
+    if not os.path.exists(rename2_map):
         print "You must first edit %s." % rename1_map
         print "For editing it, please use an editor that honours TAB chars and is able to edit UTF-8 encoded files."
         print "Carefully edit - the fields are separated by a single TAB char, do not change this!"
-        print "You may ONLY edit the rightmost field (in case you want to rename the page or file)."
+        print "You may ONLY edit the rightmost field (this is the NEW name - in case you want to rename the page or file)."
         print
-        print "After you have finished editing, rename the file to %s and re-issue the moin migrate command" % rename2_map
+        print "After you have finished editing, rename the file to %s and re-issue the moin migrate command." % rename2_map
         return None # terminate here
     # the second pass does the conversion, reading <data_dir>/rename2.txt
     src_data_dir = os.path.abspath(os.path.join(data_dir, '..', 'data.pre160')) # keep the orig data_dir here
@@ -29,3 +30,7 @@
     dc.pass2()
     return 1060000
 
+
+if __name__ == '__main__':
+    execute(None, './data', None)
+