Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.macro.StatsChart Namespace Reference

Functions

def macro_StatsChart

Variables

list Dependencies = ["time24:00"]

Function Documentation

def MoinMoin.macro.StatsChart.macro_StatsChart (   macro,
  chart_type = '' 
)

Definition at line 15 of file StatsChart.py.

00015 
00016 def macro_StatsChart(macro, chart_type=''):
00017     _ = macro.request.getText
00018     formatter = macro.request.formatter
00019 
00020     if not chart_type:
00021         return (formatter.sysmsg(1) +
00022                 formatter.text(_('You need to provide a chart type!')) +
00023                 formatter.sysmsg(0))
00024 
00025     try:
00026         # stats module without 'linkto' will raise AttributeError
00027         func = pysupport.importName("MoinMoin.stats.%s" % chart_type, "linkto")
00028     except ImportError:
00029         return (formatter.sysmsg(1) +
00030                 formatter.text(_('Bad chart type "%s"!') % chart_type) +
00031                 formatter.sysmsg(0))
00032 
00033     return func(macro.formatter.page.page_name, macro.request)
00034 

Variable Documentation

Definition at line 13 of file StatsChart.py.