view MoinMoin/script/migration/1069999.py @ 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
children
line wrap: on
line source
# -*- 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