X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftheonering.py;h=9209162bd252245150d9bd9f14f8f22ace83f02f;hb=cf6bbc96c0e4b3bb240c61df09e0e71afdd602a8;hp=23ad1ee4b18455f3601877482c898343ae59b7f5;hpb=f289412744a4bc95f9b06beb2ed3a1fa5df4bfb1;p=theonering diff --git a/src/theonering.py b/src/theonering.py index 23ad1ee..9209162 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) @@ -97,11 +97,11 @@ def main(logToFile): ) else: logging.basicConfig( - level=logging.INFO, + level=logging.DEBUG, format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', datefmt='%H:%M:%S', ) - logging.debug("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__)) + logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__)) logging.debug("OS: %s" % (os.uname()[0], )) logging.debug("Kernel: %s (%s) for %s" % os.uname()[2:]) logging.debug("Hostname: %s" % os.uname()[1])