view MoinMoin/macro/ @ 51:54d5932d5a03

merge moin--main--1.3--patch-930: fix error handling in plugins, fix broken chart action Patches applied: * fix error handling in plugins, fix broken chart action * merge from main * fix error handling in plugins * merge from main * update changes with chart action fix imported from: moin--main--1.5--patch-52
author Nir Soffer <>
date Thu, 29 Sep 2005 00:36:27 +0000
parents 77665d8e2254
children bb2e053067fb
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 by Jürgen Hermann <>
    @license: GNU GPL, see COPYING for details.

from MoinMoin.util import pysupport

Dependencies = ["time24:00"]

def execute(macro, args, **kw):
    _ = macro.request.getText
    formatter = macro.request.formatter

    if not args:
        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." + args, "linkto")
    except ImportError:
        return (formatter.sysmsg(1) +
                formatter.text(_('Bad chart type "%s"!') % args) +

    return func(, macro.request)