projects
/
theonering
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing indentation issue
[theonering]
/
src
/
theonering.py
diff --git
a/src/theonering.py
b/src/theonering.py
index
a3c30d9
..
49a173f
100755
(executable)
--- a/
src/theonering.py
+++ b/
src/theonering.py
@@
-34,7
+34,7
@@
import constants
import connection_manager
import connection_manager
-IDLE_TIMEOUT = 5000
+IDLE_TIMEOUT = 10
def run_theonering(persist):
def run_theonering(persist):
@@
-47,23
+47,23
@@
def run_theonering(persist):
raise
@gobject_utils.async
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')
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:
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)
try:
manager = connection_manager.TheOneRingConnectionManager(shutdown_func=shutdown_callback)
@@
-73,6
+73,8
@@
def run_theonering(persist):
mainloop = gobject.MainLoop(is_running=True)
mainloop = gobject.MainLoop(is_running=True)
+ gobject.threads_init()
+ dbus.glib.init_threads()
while mainloop.is_running():
try:
mainloop.run()
while mainloop.is_running():
try:
mainloop.run()
@@
-88,17
+90,18
@@
def main(logToFile):
raise
telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE'))
raise
telepathy_utils.debug_divert_messages(os.getenv('THEONERING_LOGFILE'))
+ logFormat = '(%(asctime)s) %(levelname)-5s %(threadName)s.%(name)s: %(message)s'
if logToFile:
logging.basicConfig(
level=logging.DEBUG,
filename=constants._user_logpath_,
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(
datefmt='%H:%M:%S',
)
else:
logging.basicConfig(
- level=logging.INFO,
- format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s',
+ level=logging.DEBUG,
+ format=logFormat,
datefmt='%H:%M:%S',
)
logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))
datefmt='%H:%M:%S',
)
logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))