X-Git-Url: http://git.maemo.org/git/?p=theonering;a=blobdiff_plain;f=src%2Fconnection_manager.py;h=d21c8a7e93ff09bb38faf79f21af1424768cc5a7;hp=0f75671548dc6e2294002bf1c01ece24533fdc9d;hb=472d5669384d85ddc85aff8050fbb6150b47152e;hpb=e340453399d61b19111cb56233673cd74223552c diff --git a/src/connection_manager.py b/src/connection_manager.py index 0f75671..d21c8a7 100644 --- a/src/connection_manager.py +++ b/src/connection_manager.py @@ -1,23 +1,15 @@ -""" -Empathy Experience: - Can't call - When first started, reports all read conversations when some might have been read - When first started, reports all of an SMS conversation even though some has been reported previously - Still leaking one of two contact lists -""" - import logging -import gobject import telepathy import constants import tp -import gtk_toolbox +import util.go_utils as gobject_utils +import util.misc as misc_utils import connection -_moduleLogger = logging.getLogger("connection_manager") +_moduleLogger = logging.getLogger(__name__) class TheOneRingConnectionManager(tp.ConnectionManager): @@ -30,7 +22,7 @@ class TheOneRingConnectionManager(tp.ConnectionManager): self._on_shutdown = shutdown_func _moduleLogger.info("Connection manager created") - @gtk_toolbox.log_exception(_moduleLogger) + @misc_utils.log_exception(_moduleLogger) def GetParameters(self, proto): """ For org.freedesktop.telepathy.ConnectionManager @@ -72,17 +64,17 @@ class TheOneRingConnectionManager(tp.ConnectionManager): Overrides tp.ConnectionManager """ result = tp.ConnectionManager.disconnected(self, conn) - gobject.timeout_add(5000, self._shutdown) + gobject_utils.timeout_add_seconds(5, self._shutdown) def quit(self): """ Terminates all connections. Must be called upon quit """ - for connection in self._connections: - connection.Disconnect() + for conn in self._connections: + conn.Disconnect() _moduleLogger.info("Connection manager quitting") - @gtk_toolbox.log_exception(_moduleLogger) + @misc_utils.log_exception(_moduleLogger) def _shutdown(self): if ( self._on_shutdown is not None and