Back to index

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

Functions

def execute

Variables

list Dependencies = ["language"]

Function Documentation

def MoinMoin.macro.GetText2.execute (   macro,
  args 
)
args consists of a character specifiying the separator and then a
packLine sequence describing a list. The first element of it is the message
and the remaining elements are substituted in the message using string
substitution.

Definition at line 18 of file GetText2.py.

00018 
00019 def execute(macro, args):
00020     """ args consists of a character specifiying the separator and then a
00021     packLine sequence describing a list. The first element of it is the message
00022     and the remaining elements are substituted in the message using string
00023     substitution.
00024     """
00025     msg = u''
00026     if args:
00027         sep = args[0]
00028         args = unpackLine(args[1:], sep)
00029         if args:
00030             msg, args = args[0], tuple(args[1:])
00031             msg = macro.request.getText(msg)
00032             try:
00033                 msg = msg % args
00034             except TypeError:
00035                 # % operator will raise TypeError if msg has named placeholders
00036                 msg = msg % dict([arg.split('=', 1) for arg in args if '=' in arg])
00037     return macro.formatter.text(msg)
00038 

Here is the call graph for this function:


Variable Documentation

Definition at line 16 of file GetText2.py.