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
[legend]
Collaboration diagram for jabberbot.commands.NotificationCommandI18n:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def translate

Public Attributes

 notification
 jids
 async
 msg_type

Detailed Description

Notification request that should be translated by the XMPP bot

Definition at line 34 of file commands.py.


Constructor & Destructor Documentation

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

Params as in NotificationCommand.

Reimplemented from jabberbot.commands.NotificationCommand.

Definition at line 36 of file commands.py.

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


Member Function Documentation

def jabberbot.commands.NotificationCommandI18n.translate (   self,
  gettext_func 
)
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 commands.py.

00044 
00045     def translate(self, gettext_func):
00046         """Translate the message using a provided gettext function
00047 
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'])
00056 
00057         return (msg, gettext_func(self.notification.get('subject', '')))


Member Data Documentation

Definition at line 31 of file commands.py.

Definition at line 30 of file commands.py.

Definition at line 32 of file commands.py.

Definition at line 29 of file commands.py.


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