changeset 2474:d08d65a19718

Make _. This assumes that all commands have jid attr, which makes sense here.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 20 Jul 2007 13:24:36 +0200
parents 754e3eedb9e5
children 639a122cbc54 76f87ae87759
files jabberbot/xmppbot.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/xmppbot.py	Fri Jul 20 13:21:40 2007 +0200
+++ b/jabberbot/xmppbot.py	Fri Jul 20 13:24:36 2007 +0200
@@ -204,6 +204,8 @@
         @param ignore_dnd: if command results in user interaction, should DnD be ignored?
 
         """
+        _ = self.getText(command.jid)
+        
         # Handle normal notifications
         if isinstance(command, cmd.NotificationCommand):
             for recipient in command.jids:
@@ -233,7 +235,6 @@
             self.remove_subscription(jid)
 
         elif isinstance(command, cmd.GetPage) or isinstance(command, cmd.GetPageHTML):
-            _ = self.getText(command.jid)
             msg = _(u"""Here's the page "%(pagename)s" that you've requested:\n\n%(data)s""")
 
             self.send_message(command.jid, msg % {
@@ -242,14 +243,12 @@
             })
 
         elif isinstance(command, cmd.GetPageList):
-            _ = self.getText(command.jid)
             msg = _("uThat's the list of pages accesible to you:\n\n%s")
             pagelist = u"\n".join(command.data)
 
             self.send_message(command.jid, msg % (pagelist, ))
 
         elif isinstance(command, cmd.GetPageInfo):
-            _ = self.getText(command.jid)
             msg = _("""Following detailed information on page "%(pagename)s" \
 is available::\n\n%(data)s""")