X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Ftheonering.py;h=de0f8c0a42b554818e055a5ab6ce1a1fc926f07e;hb=912d17809ce114c36cc7f5e8f934ffca6b2d699c;hp=a3c30d9583e45c5e0f64442576c23692a118c177;hpb=407d5b467c28c20f2073833001ed871766a68bc5;p=theonering diff --git a/src/theonering.py b/src/theonering.py index a3c30d9..de0f8c0 100755 --- a/src/theonering.py +++ b/src/theonering.py @@ -34,7 +34,7 @@ import constants import connection_manager -IDLE_TIMEOUT = 5000 +IDLE_TIMEOUT = 5 def run_theonering(persist): @@ -47,23 +47,23 @@ def run_theonering(persist): raise @gobject_utils.async - def quit(): + def on_quit(): manager.quit() mainloop.quit() def timeout_cb(): if len(manager._connections) == 0: logging.info('No connection received - quitting') - quit() + on_quit() return False if persist: shutdown_callback = None else: - gobject.timeout_add(IDLE_TIMEOUT, timeout_cb) - shutdown_callback = quit + gobject_utils.timeout_add_seconds(IDLE_TIMEOUT, timeout_cb) + shutdown_callback = on_quit - signal.signal(signal.SIGTERM, quit) + signal.signal(signal.SIGTERM, lambda: on_quit) try: manager = connection_manager.TheOneRingConnectionManager(shutdown_func=shutdown_callback)