From: Ed Page Date: Thu, 26 Nov 2009 04:18:23 +0000 (-0600) Subject: Cleaned up presence and cleaned up the exceptions X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=5dfd64ee4ce4d38f44cddd566dafa59e6139cad7 Cleaned up presence and cleaned up the exceptions --- diff --git a/src/simple_presence.py b/src/simple_presence.py index 56b81af..29deb88 100644 --- a/src/simple_presence.py +++ b/src/simple_presence.py @@ -34,6 +34,13 @@ class SimplePresenceMixin(telepathy.server.ConnectionInterfaceSimplePresence): """ raise NotImplementedError() + @property + def handle(self): + """ + @abstract + """ + raise NotImplementedError("Abstract property called") + @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: - 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: + raise telepathy.errors.NotAvailable("DnD support not yet added to TheOneRing") 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)