changeset 2677:da70a91c03db

Doc/argument type fixes.
author Karol Nowak <grzywacz@sul.uni.lodz.pl>
date Tue, 14 Aug 2007 23:58:46 +0200
parents ea982442f84a
children 00b746e6be07
files jabberbot/commands.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/commands.py	Tue Aug 14 15:12:30 2007 +0200
+++ b/jabberbot/commands.py	Tue Aug 14 23:58:46 2007 +0200
@@ -12,12 +12,13 @@
 # First, XML RPC -> XMPP commands
 class NotificationCommand:
     """Class representing a notification request"""
-    def __init__(self, jids, notification, msg_type="message", async=True):
+    def __init__(self, jids, notification, msg_type=u"message", async=True):
         """A constructor
 
         @param jids: a list of jids to sent this message to
+        @param notification: dictionary with notification data
+        @param async: async notifications get queued if contact is DnD
         @type jids: list
-        @param async: async notifications get queued if contact is DnD
 
         """
         if type(jids) != list:
@@ -131,6 +132,10 @@
 
     def __init__(self, jid, search_type, *args, **kwargs):
         BaseDataCommand.__init__(self, jid)
+
+        if not JID(jid).resource:
+            raise ValueError("The jid argument must be a full jabber id!")
+
         self.term = ' '.join(args)
         self.search_type = search_type
         self.presentation = kwargs.get('presentation', 'text') # "text" or "dataforms"