Back to index

moin  1.9.0~rc2
1069999.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - migration from base rev 1069999
00004 
00005     We add a userprefs plugin dir here.
00006 
00007     @copyright: 2008 MoinMoin:ThomasWaldmann
00008     @license: GNU GPL, see COPYING for details.
00009 """
00010 from MoinMoin.script.migration.migutil import opj, listdir, copy_file, move_file, copy_dir, makedir
00011 
00012 def execute(script, data_dir, rev):
00013     plugindir = opj(data_dir, 'plugin')
00014     for d in ['userprefs', ]:
00015         thisdir = opj(plugindir, d)
00016         makedir(thisdir)
00017         fname = opj(thisdir, '__init__.py')
00018         f = open(fname, 'w')
00019         f.write("""\
00020 # -*- coding: iso-8859-1 -*-
00021 
00022 from MoinMoin.util import pysupport
00023 
00024 modules = pysupport.getPackageModules(__file__)
00025 """)
00026         f.close()
00027     return rev + 1
00028