view MoinMoin/macro/ @ 3085:fdb68a8f92da

fix wrong pagename when creating new pages on Mac OS X (ported from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 23 Feb 2008 00:28:53 +0100
parents 01f05e74aa9c
children 03b3c6fd70e3
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    EditedSystemPages - list system pages that has been edited in this wiki.

    @copyright: 2004 Nir Soffer <>
    @license: GNU GPL, see COPYING for details.

class EditedSystemPages:

    def __init__(self, macro, args):
        self.macro = macro
        self.request = macro.request
        self.formatter = macro.formatter

    def renderInPage(self):
        """ Render macro in page context

        The parser should decide what to do if this macro is placed in a
        paragraph context.
        from MoinMoin.Page import Page

        # Get page list for current user (use this as admin), filter
        # pages that are both underlay and standard pages.
        def filterfn(name):
            page = Page(self.request, name)
            return (page.isStandardPage(includeDeleted=0) and

        # Get page filtered page list. We don't need to filter by
        # exists, because our filter check this already.
        pages = self.request.rootpage.getPageList(filter=filterfn, exists=0)

        # Format as numberd list, sorted by page name
        result = []
        f = self.formatter
        for name in pages:
            result.append(f.pagelink(1, name, generated=1))
            result.append(f.pagelink(0, name))

        return ''.join(result)

def execute(macro, args):
    """ Temporary glue code to use with moin current macro system """
    return EditedSystemPages(macro, args).renderInPage()