Imitiating buttfly in being explicitly typed
[theonering] / src / presence.py
index 8c38252..986abe8 100644 (file)
@@ -1,21 +1,20 @@
 import logging
 
-import telepathy
-
-import gtk_toolbox
+import tp
+import util.misc as misc_utils
 import simple_presence
 
 
-_moduleLogger = logging.getLogger('presence')
+_moduleLogger = logging.getLogger(__name__)
 
 
-class PresenceMixin(telepathy.server.ConnectionInterfacePresence, simple_presence.TheOneRingPresence):
+class PresenceMixin(tp.ConnectionInterfacePresence, simple_presence.TheOneRingPresence):
 
        def __init__(self):
-               telepathy.server.ConnectionInterfacePresence.__init__(self)
+               tp.ConnectionInterfacePresence.__init__(self)
                simple_presence.TheOneRingPresence.__init__(self)
 
-       @gtk_toolbox.log_exception(_moduleLogger)
+       @misc_utils.log_exception(_moduleLogger)
        def GetStatuses(self):
                # the arguments are in common to all on-line presences
                arguments = {}
@@ -25,16 +24,16 @@ class PresenceMixin(telepathy.server.ConnectionInterfacePresence, simple_presenc
                        for (localType, telepathyType) in self.TO_PRESENCE_TYPE.iteritems()
                )
 
-       @gtk_toolbox.log_exception(_moduleLogger)
+       @misc_utils.log_exception(_moduleLogger)
        def RequestPresence(self, contactIds):
                presences = self.__get_presences(contactIds)
                self.PresenceUpdate(presences)
 
-       @gtk_toolbox.log_exception(_moduleLogger)
+       @misc_utils.log_exception(_moduleLogger)
        def GetPresence(self, contactIds):
                return self.__get_presences(contactIds)
 
-       @gtk_toolbox.log_exception(_moduleLogger)
+       @misc_utils.log_exception(_moduleLogger)
        def SetStatus(self, statuses):
                assert len(statuses) == 1
                status, arguments = statuses.items()[0]