changeset 2110:1ede132a9d38

Suggested fixes.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 08 Jun 2007 02:41:19 +0200
parents b39379ab47d3
children a3377b242e21
files MoinMoin/events/JabberNotification.py jabberbot/__init__.py jabberbot/main.py jabberbot/xmlrpcbot.py jabberbot/xmppbot.py
diffstat 5 files changed, 11 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/JabberNotification.py	Thu Jun 07 18:35:51 2007 +0200
+++ b/MoinMoin/events/JabberNotification.py	Fri Jun 08 02:41:19 2007 +0200
@@ -4,8 +4,8 @@
 
     This code sends notifications using a separate daemon.
 
-@copyright: 2007 by Karol Nowak <grywacz@gmail.com>
-@license: GNU GPL, see COPYING for details.
+    @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
+    @license: GNU GPL, see COPYING for details.
 """
 
 import xmlrpclib
--- a/jabberbot/__init__.py	Thu Jun 07 18:35:51 2007 +0200
+++ b/jabberbot/__init__.py	Fri Jun 08 02:41:19 2007 +0200
@@ -2,10 +2,6 @@
 """
     MoinMoin - jabber bot
 
-    This is a bot for notification and simple editing
-    operations. Developed as a Google Summer of Code 
-    project.
-
-@copyright: 2007 by Karol Nowak <grywacz@gmail.com>
-@license: GNU GPL, see COPYING for details.
+    @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
+    @license: GNU GPL, see COPYING for details.
 """
--- a/jabberbot/main.py	Thu Jun 07 18:35:51 2007 +0200
+++ b/jabberbot/main.py	Fri Jun 08 02:41:19 2007 +0200
@@ -2,10 +2,6 @@
 """
     MoinMoin - jabber bot main file
 
-    This is a bot for notification and simple editing
-    operations. Developed as a Google Summer of Code 
-    project.
-
     @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
     @license: GNU GPL, see COPYING for details.
 """
@@ -14,7 +10,7 @@
 import os
 from Queue import Queue
 
-from config import Config
+from config import BotConfig
 from jabberbot.xmppbot import XMPPBot
 from jabberbot.xmlrpcbot import XMLRPCServer, XMLRPCClient
 
@@ -36,9 +32,9 @@
     commands_to_xmpp = Queue()
     
     try:
-        xmpp_bot = XMPPBot(Config, commands_from_xmpp, commands_to_xmpp)
-        xmlrpc_client = XMLRPCClient(Config, commands_from_xmpp)
-        xmlrpc_server = XMLRPCServer(Config, commands_to_xmpp)
+        xmpp_bot = XMPPBot(BotConfig, commands_from_xmpp, commands_to_xmpp)
+        xmlrpc_client = XMLRPCClient(BotConfig, commands_from_xmpp)
+        xmlrpc_server = XMLRPCServer(BotConfig, commands_to_xmpp)
         
         xmpp_bot.start()
         xmlrpc_client.start()
--- a/jabberbot/xmlrpcbot.py	Thu Jun 07 18:35:51 2007 +0200
+++ b/jabberbot/xmlrpcbot.py	Fri Jun 08 02:41:19 2007 +0200
@@ -2,10 +2,6 @@
 """
     MoinMoin - a xmlrpc server and client for the notification bot
 
-    This is a bot for notification and simple editing
-    operations. Developed as a Google Summer of Code 
-    project.
-
     @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
     @license: GNU GPL, see COPYING for details.
 """
--- a/jabberbot/xmppbot.py	Thu Jun 07 18:35:51 2007 +0200
+++ b/jabberbot/xmppbot.py	Fri Jun 08 02:41:19 2007 +0200
@@ -1,10 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - a XMPP bot
-
-    This is a bot for notification and simple editing
-    operations. Developed as a Google Summer of Code 
-    project.
+    MoinMoin - jabber bot
 
     @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
     @license: GNU GPL, see COPYING for details.
@@ -69,10 +65,7 @@
                 max_prio = resource['priority']
                 max_prio_show = resource['show']
                 
-        if max_prio_show == u'dnd':
-            return True
-        else:
-            return False
+        return max_prio_show == u'dnd'
         
     def set_show(self, resource, show):
         """Sets show property for a given resource
@@ -231,7 +224,7 @@
         command = text.split()
         
         # Ignore empty commands
-        if len(command) == 0:
+        if not command:
             return
         
         response = self.reply_help()