Locked History Actions

MoinMoinMacro

A MoinMoinMacro is simply a Python module. This module must be installed into the /data/plugin/macro directory beneath the root of your MoinMoin instance. The design of MoinMoin macros is such that it requires a single entry point called execute, thus any macro module that you write should minimally contain a function called execute.

The execute function accepts two arguments: macro and args so the signaure of the method should look like this:

   1 Dependencies = []
   2 
   3  def execute(macro, args):
   4      return macro.formatter.text("I got these args from a macro %s: %s" %
   5      (str(macro), args))

The second paramete 'args' is an arbitrary set of arguments that you want passed from the macro invocation on a page sent to you macro. This object is of type tuple. The first agrument is a object of type Macro.