view MoinMoin/action/ @ 1777:ed44b93599b5

remove unneeded request param from page.send_page()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Feb 2007 21:39:36 +0100
parents e866e8975431
children ebcebba1afb3
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - show some statistics chart

    @copyright: 2000-2004 by Jürgen Hermann <>,
                2006 by MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
from MoinMoin.util import pysupport

def execute(pagename, request):
    """ Show page charts """
    _ = request.getText
    if not
        msg = _("You are not allowed to view this page.")

    if not request.cfg.chart_options:
        msg = _("Charts are not available!")

    chart_type = request.form.get('type', [''])[0].strip()
    if not chart_type:
        msg = _('You need to provide a chart type!')

        func = pysupport.importName("MoinMoin.stats.%s" % chart_type, 'draw')
    except (ImportError, AttributeError), err:
        msg = _('Bad chart type "%s"!') % chart_type

    func(pagename, request)