Cleaned up presence and cleaned up the exceptions
authorEd Page <eopage@byu.net>
Thu, 26 Nov 2009 04:18:23 +0000 (22:18 -0600)
committerEd Page <eopage@byu.net>
Thu, 26 Nov 2009 04:18:23 +0000 (22:18 -0600)
src/simple_presence.py

index 56b81af..29deb88 100644 (file)
@@ -34,6 +34,13 @@ class SimplePresenceMixin(telepathy.server.ConnectionInterfaceSimplePresence):
                """
                raise NotImplementedError()
 
                """
                raise NotImplementedError()
 
+       @property
+       def handle(self):
+               """
+               @abstract
+               """
+               raise NotImplementedError("Abstract property called")
+
        @gtk_toolbox.log_exception(_moduleLogger)
        def GetPresences(self, contacts):
                """
        @gtk_toolbox.log_exception(_moduleLogger)
        def GetPresences(self, contacts):
                """
@@ -55,14 +62,15 @@ class SimplePresenceMixin(telepathy.server.ConnectionInterfaceSimplePresence):
        @gtk_toolbox.log_exception(_moduleLogger)
        def SetPresence(self, status, message):
                if message:
        @gtk_toolbox.log_exception(_moduleLogger)
        def SetPresence(self, status, message):
                if message:
-                       raise telepathy.errors.InvalidArgument
+                       raise telepathy.errors.InvalidArgument("Messages aren't supported")
 
                if status == TheOneRingPresence.ONLINE:
                        self.gvoice_backend.mark_dnd(True)
                elif status == TheOneRingPresence.BUSY:
 
                if status == TheOneRingPresence.ONLINE:
                        self.gvoice_backend.mark_dnd(True)
                elif status == TheOneRingPresence.BUSY:
+                       raise telepathy.errors.NotAvailable("DnD support not yet added to TheOneRing")
                        self.gvoice_backend.mark_dnd(False)
                else:
                        self.gvoice_backend.mark_dnd(False)
                else:
-                       raise telepathy.errors.InvalidArgument
+                       raise telepathy.errors.InvalidArgument("Unsupported status: %r" % status)
                _moduleLogger.info("Setting Presence to '%s'" % status)
 
 
                _moduleLogger.info("Setting Presence to '%s'" % status)