view data/plugin/macro/ @ 625:f4e63b74b969

FormSubmit: adapt to werkzeug MultiDict
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 17:47:30 +0100
parents dda4017bc8a4
children 127da830be6c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - ShortText macro

    It shows the first 180 chars of a wiki page without any processing instructions
    and only if the user is allowed to read that page.

    @copyright: 2005-2010 by MoinMoin:ReimarBauer
    @license: GNU GPL, see COPYING for details.
Dependencies = ["pages"]

from MoinMoin.Page import Page
from MoinMoin import wikiutil

def macro_ShortText(macro, pagename=unicode, length=180):
    request = macro.request
    _ = request.getText
        raw = Page(request, pagename).get_data()
        return request.formatter.text(raw[:length])
        return _("You are not allowed to view this page.")