changeset 3231:df7bde127d24

mig scripts: add a userprefs plugin dir for 1.7.0
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Mar 2008 22:30:31 +0100
parents 8d6f935ac0e0
children 005153087ebc
files MoinMoin/script/migration/1060000.py MoinMoin/script/migration/1060100.py MoinMoin/script/migration/1069999.py MoinMoin/script/migration/1070000.py
diffstat 4 files changed, 42 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/migration/1060000.py	Sun Mar 09 20:18:06 2008 +0100
+++ b/MoinMoin/script/migration/1060000.py	Sun Mar 09 22:30:31 2008 +0100
@@ -9,5 +9,5 @@
 """
 
 def execute(script, data_dir, rev):
-    return 1060100
+    return 1069999
 
--- a/MoinMoin/script/migration/1060100.py	Sun Mar 09 20:18:06 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-"""
-    MoinMoin - dummy migration terminator script
-
-    This must be the last migration script.
-
-    @copyright: 2006 by Thomas Waldmann
-    @license: GNU GPL, see COPYING for details.
-"""
-
-def execute(script, data_dir, rev):
-    return None
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/script/migration/1069999.py	Sun Mar 09 22:30:31 2008 +0100
@@ -0,0 +1,28 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - migration from base rev 1069999
+
+    We add a userprefs plugin dir here.
+
+    @copyright: 2008 MoinMoin:ThomasWaldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+from MoinMoin.script.migration.migutil import opj, listdir, copy_file, move_file, copy_dir, makedir
+
+def execute(script, data_dir, rev):
+    plugindir = opj(data_dir, 'plugin')
+    for d in ['userprefs', ]:
+        thisdir = opj(plugindir, d)
+        makedir(thisdir)
+        fname = opj(thisdir, '__init__.py')
+        f = open(fname, 'w')
+        f.write("""\
+# -*- coding: iso-8859-1 -*-
+
+from MoinMoin.util import pysupport
+
+modules = pysupport.getPackageModules(__file__)
+""")
+        f.close()
+    return rev + 1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/script/migration/1070000.py	Sun Mar 09 22:30:31 2008 +0100
@@ -0,0 +1,13 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - dummy migration terminator script
+
+    This must be the last migration script.
+
+    @copyright: 2006 by Thomas Waldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+
+def execute(script, data_dir, rev):
+    return None
+