changeset 2505:0a90c1bad60f

Again, some fixes suggested by pylint.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sun, 22 Jul 2007 05:43:25 +0200
parents c27ee67397f0
children 426a8cb8e44c a791fc964e09
files MoinMoin/events/emailnotify.py MoinMoin/events/jabbernotify.py MoinMoin/events/notification.py
diffstat 3 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/emailnotify.py	Sun Jul 22 05:33:02 2007 +0200
+++ b/MoinMoin/events/emailnotify.py	Sun Jul 22 05:43:25 2007 +0200
@@ -107,8 +107,8 @@
 
     data = notification.user_created_message(event.request, sitename, username, email)
 
-    for id in user_ids:
-        usr = User(event.request, id=id)
+    for usr_id in user_ids:
+        usr = User(event.request, id=usr_id)
 
         # Currently send this only to super users
         if usr.isSuperUser() and event_name in usr.email_subscribed_events:
--- a/MoinMoin/events/jabbernotify.py	Sun Jul 22 05:33:02 2007 +0200
+++ b/MoinMoin/events/jabbernotify.py	Sun Jul 22 05:43:25 2007 +0200
@@ -149,7 +149,7 @@
     send_notification(event.request, jids, data['body'], data['subject'])
 
 
-def page_change(type, request, page, subscribers, **kwargs):
+def page_change(change_type, request, page, subscribers, **kwargs):
     """Sends notification about page being changed in some way"""
     _ = request.getText
 
@@ -160,7 +160,7 @@
         for lang in subscribers:
             jids = [u.jid for u in subscribers[lang] if u.jid]
             names = [u.name for u in subscribers[lang] if u.jid]
-            msg = notification.page_change_message(type, request, page, lang, **kwargs)
+            msg = notification.page_change_message(change_type, request, page, lang, **kwargs)
             result = send_notification(request, jids, msg)
 
             if result:
--- a/MoinMoin/events/notification.py	Sun Jul 22 05:33:02 2007 +0200
+++ b/MoinMoin/events/notification.py	Sun Jul 22 05:43:25 2007 +0200
@@ -42,7 +42,7 @@
         """
         self.recipients = recipients
 
-class UnknownChangeType:
+class UnknownChangeType(Exception):
     """ Used to signal an invalid page change event """
     pass
 
@@ -73,7 +73,7 @@
     pagelink = request.getQualifiedURL(page.url(request, querystr, relative=False))
 
     if msgtype == "page_changed":
-        messageBody = _("Dear Wiki user,\n\n"
+        msg_body = _("Dear Wiki user,\n\n"
         'You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification.\n\n'
         "The following page has been changed by %(editor)s:\n"
         "%(pagelink)s\n\n", formatted=False) % {
@@ -84,19 +84,19 @@
 
         # append a diff (or append full page text if there is no diff)
         if len(revisions) < 2:
-            messageBody = messageBody + \
+            messageBody = msg_body + \
                 _("New page:\n", formatted=False) + \
                 page.get_raw_body()
         else:
             lines = wikiutil.pagediff(request, page.page_name, revisions[1],
                                       page.page_name, revisions[0])
             if lines:
-                messageBody = messageBody + "%s\n%s\n" % (("-" * 78), '\n'.join(lines))
+                msg_body = msg_body + "%s\n%s\n" % (("-" * 78), '\n'.join(lines))
             else:
-                messageBody = messageBody + _("No differences found!\n", formatted=False)
+                msg_body = msg_body + _("No differences found!\n", formatted=False)
 
     elif msgtype == "page_deleted":
-        messageBody = _("Dear wiki user,\n\n"
+        msg_body = _("Dear wiki user,\n\n"
             'You have subscribed to a wiki page "%(sitename)s" for change notification.\n\n'
             "The following page has been deleted by %(editor)s:\n"
             "%(pagelink)s\n\n", formatted=False) % {
@@ -106,7 +106,7 @@
         }
 
     elif msgtype == "page_renamed":
-        messageBody = _("Dear wiki user,\n\n"
+        msg_body = _("Dear wiki user,\n\n"
             'You have subscribed to a wiki page "%(sitename)s" for change notification.\n\n'
             "The following page has been renamed from %(oldname)s by %(editor)s:\n"
             "%(pagelink)s\n\n", formatted=False) % {
@@ -119,10 +119,10 @@
         raise UnknownChangeType()
 
     if 'comment' in kwargs and kwargs['comment']:
-        messageBody = messageBody + \
+        msg_body = msg_body + \
             _("The comment on the change is:\n%(comment)s", formatted=False) % {'comment': kwargs['comment']}
 
-    return messageBody
+    return msg_body
 
 def user_created_message(request, sitename, username, email):
     """Formats a message used to notify about accounts being created