view MoinMoin/script/maint/ @ 1973:286e315935ae

refactor usage of constants don't import from config module, but from constants.* use uppercase for constant names
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Feb 2013 22:50:21 +0100
parents 54be46b8a0b4
children 384555088cab
line wrap: on
line source
# Copyright: 2004 Nir Soffer <>
# Copyright: 2008,2011 MoinMoin:ThomasWaldmann
# Copyright: 2011 MoinMoin:ReimarBauer
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

    MoinMoin - list system items that has been edited in this wiki.


from flask import current_app as app
from flask.ext.script import Command

from MoinMoin.constants.keys import IS_SYSITEM, SYSITEM_VERSION

class Modified_SystemItems(Command):
    description = 'This command can be used to list system items that has been edited in this wiki.'

    def run(self):
        edited_sys_items = []
        for current_rev in
            is_sysitem = current_rev.meta.get(IS_SYSITEM, False)
            if is_sysitem:
                version = current_rev.meta.get(SYSITEM_VERSION)
                if version is None:
                    # if we don't have the version, it was edited:

        # Format as numbered list, sorted by item name
        if edited_sys_items:
            print "Edited system items:"
            for item_name in edited_sys_items:
                print item_name
            print "Not any modified system items found!"