changeset 3637:92d08c1975b0

jabber notifications: don't translate log messages, fix non-existing logger
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 23 May 2008 23:16:39 +0200
parents 4a1813f1cb61
children 715c0a9e4840
files MoinMoin/events/__init__.py MoinMoin/events/jabbernotify.py
diffstat 2 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/__init__.py	Fri May 23 22:59:30 2008 +0200
+++ b/MoinMoin/events/__init__.py	Fri May 23 23:16:39 2008 +0200
@@ -10,7 +10,7 @@
 """
 
 from MoinMoin import log
-log = log.getLogger(__name__)
+logging = log.getLogger(__name__)
 
 from MoinMoin import wikiutil
 from MoinMoin.util import pysupport
--- a/MoinMoin/events/jabbernotify.py	Fri May 23 22:59:30 2008 +0200
+++ b/MoinMoin/events/jabbernotify.py	Fri May 23 23:16:39 2008 +0200
@@ -10,6 +10,9 @@
 
 import xmlrpclib
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 from MoinMoin.Page import Page
 from MoinMoin.user import User, getUserList
 from MoinMoin.support.python_compatibility import set
@@ -47,18 +50,15 @@
 
     request = event.request
     server = request.cfg.notification_server
-    _ = request.getText
-
     try:
         if isinstance(event, ev.JabberIDSetEvent):
             server.addJIDToRoster(request.cfg.secret, event.jid)
         else:
             server.removeJIDFromRoster(request.cfg.secret, event.jid)
-
     except xmlrpclib.Error, err:
-        ev.logger.error(_("XML RPC error: %s"), str(err))
+        logging.error("XML RPC error: %s" % str(err))
     except Exception, err:
-        ev.logger.error(_("Low-level communication error: %s"), str(err))
+        logging.error("Low-level communication error: %s" % str(err))
 
 
 def handle_file_attached(event):
@@ -188,7 +188,6 @@
     @type url_list: list
 
     """
-    _ = request.getText
     server = request.cfg.notification_server
 
     if type(notification) != dict:
@@ -201,7 +200,7 @@
         server.send_notification(request.cfg.secret, jids, notification)
         return True
     except xmlrpclib.Error, err:
-        ev.logger.error(_("XML RPC error: %s"), str(err))
+        logging.error("XML RPC error: %s" % str(err))
     except Exception, err:
-        ev.logger.error(_("Low-level communication error: %s"), str(err))
+        logging.error("Low-level communication error: %s" % str(err))