Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
jabberbot.commands.NotificationCommandI18n Class Reference
Inheritance diagram for jabberbot.commands.NotificationCommandI18n:
Inheritance graph
Collaboration diagram for jabberbot.commands.NotificationCommandI18n:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def translate

Public Attributes


Detailed Description

Notification request that should be translated by the XMPP bot

Definition at line 34 of file

Constructor & Destructor Documentation

def jabberbot.commands.NotificationCommandI18n.__init__ (   self,
  msg_type = "normal",
  async = True 
A constructor

Params as in NotificationCommand.

Reimplemented from jabberbot.commands.NotificationCommand.

Definition at line 36 of file

00037     def __init__(self, jids, notification, msg_type="normal", async=True):
00038         """A constructor
00040         Params as in NotificationCommand.
00042         """
00043         NotificationCommand.__init__(self, jids, notification, msg_type, async)

Member Function Documentation

def jabberbot.commands.NotificationCommandI18n.translate (   self,
Translate the message using a provided gettext function

@param gettext_func: a unary gettext function
@return: translated message and subject
@rtype: tuple

Definition at line 44 of file

00045     def translate(self, gettext_func):
00046         """Translate the message using a provided gettext function
00048         @param gettext_func: a unary gettext function
00049         @return: translated message and subject
00050         @rtype: tuple
00051         """
00052         if self.notification.has_key('data'):
00053             msg =  gettext_func(self.notification['text']) % self.notification['data']
00054         else:
00055             msg = gettext_func(self.notification['text'])
00057         return (msg, gettext_func(self.notification.get('subject', '')))

Member Data Documentation

Definition at line 31 of file

Definition at line 30 of file

Definition at line 32 of file

Definition at line 29 of file

The documentation for this class was generated from the following file: