X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Ftelepathy-theonering;h=33decda1d9bf359ce3fe1e0f29ec464dcdae4b53;hb=3a95b01afcab5f60dbda3761f85138077c2485f7;hp=8f25a8520b9d8fd2974b95fc5f5f1d92f10f697f;hpb=ab4da214c520d763bbbddeb828c8e7c838374fe3;p=theonering diff --git a/src/telepathy-theonering b/src/telepathy-theonering index 8f25a85..33decda 100755 --- a/src/telepathy-theonering +++ b/src/telepathy-theonering @@ -31,7 +31,7 @@ import telepathy.utils as telepathy_utils import util.linux as linux_utils import util.go_utils as gobject_utils import constants -from butterfly import ButterflyConnectionManager +import connection_manager IDLE_TIMEOUT = 5000 @@ -45,13 +45,13 @@ def run_theonering(): manager.quit() mainloop.quit() + def timeout_cb(): + if len(manager._connections) == 0: + logging.info('No connection received - quitting') + quit() + return False - if 'BUTTERFLY_PERSIST' not in os.environ: - def timeout_cb(): - if len(manager._connections) == 0: - logging.info('No connection received - quitting') - quit() - return False + if 'THEONERING_PERSIST' not in os.environ: gobject.timeout_add(IDLE_TIMEOUT, timeout_cb) shutdown_callback = quit else: @@ -60,7 +60,7 @@ def run_theonering(): signal.signal(signal.SIGTERM, quit) try: - manager = ButterflyConnectionManager(shutdown_func=shutdown_callback) + manager = connection_manager.TheOneRingConnectionManager(shutdown_func=shutdown_callback) except dbus.exceptions.NameExistsException: logging.warning('Failed to acquire bus name, connection manager already running?') sys.exit(1) @@ -75,6 +75,6 @@ def run_theonering(): if __name__ == '__main__': - telepathy_utils.debug_divert_messages(os.getenv('BUTTERFLY_LOGFILE')) + telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE')) logging.basicConfig(level=logging.DEBUG) run_theonering()