X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftheonering.py;h=4ac5700b07f95fd85da938dba23c07bbc7777a4f;hb=82d3b4a7ae787eaaf1ac5ff07bc60aa25c84d50a;hp=9209162bd252245150d9bd9f14f8f22ace83f02f;hpb=548c58651ec7849619b9d823fdeee169be6c87b5;p=theonering diff --git a/src/theonering.py b/src/theonering.py index 9209162..4ac5700 100755 --- a/src/theonering.py +++ b/src/theonering.py @@ -34,9 +34,6 @@ import constants import connection_manager -IDLE_TIMEOUT = 5 - - def run_theonering(persist): linux_utils.set_process_name(constants.__app_name__) @@ -60,7 +57,10 @@ def run_theonering(persist): if persist: shutdown_callback = None else: - gobject_utils.timeout_add_seconds(IDLE_TIMEOUT, timeout_cb) + gobject_utils.timeout_add_seconds( + connection_manager.TheOneRingConnectionManager.IDLE_TIMEOUT, + timeout_cb + ) shutdown_callback = on_quit signal.signal(signal.SIGTERM, lambda: on_quit) @@ -73,6 +73,8 @@ def run_theonering(persist): mainloop = gobject.MainLoop(is_running=True) + gobject.threads_init() + dbus.glib.init_threads() while mainloop.is_running(): try: mainloop.run() @@ -88,17 +90,19 @@ def main(logToFile): raise telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE')) + logFormat = '(%(asctime)s) %(levelname)-5s %(threadName)s.%(name)s: %(message)s' + logging.raiseExceptions = True # Getting funky shutdown behavior, checking it out if logToFile: logging.basicConfig( level=logging.DEBUG, filename=constants._user_logpath_, - format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', + format=logFormat, datefmt='%H:%M:%S', ) else: logging.basicConfig( level=logging.DEBUG, - format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', + format=logFormat, datefmt='%H:%M:%S', ) logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))