view MoinMoin/macro/ @ 5597:ced05deb11ae 1.9.2

cfg.history_paging: fix grammar/remove performance warning (we don't do that at other places either)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 28 Feb 2010 23:49:03 +0100
parents 924a9abe5689
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
    MoinMoin - StatsChart Macro

    This macro creates charts from the data in "event.log".

    @copyright: 2002-2004 Juergen Hermann <>
    @license: GNU GPL, see COPYING for details.

from MoinMoin.util import pysupport

Dependencies = ["time24:00"]

def macro_StatsChart(macro, chart_type=''):
    _ = macro.request.getText
    formatter = macro.request.formatter

    if not chart_type:
        return (formatter.sysmsg(1) +
                formatter.text(_('You need to provide a chart type!')) +

        # stats module without 'linkto' will raise AttributeError
        func = pysupport.importName("MoinMoin.stats.%s" % chart_type, "linkto")
    except ImportError:
        return (formatter.sysmsg(1) +
                formatter.text(_('Bad chart type "%s"!') % chart_type) +

    return func(, macro.request)