more debugging

This commit is contained in:
j 2015-11-19 18:40:42 +01:00
parent 3226fc969d
commit cc258fb5ee
2 changed files with 6 additions and 5 deletions

View file

@ -13,11 +13,6 @@ base = dirname(dirname(dirname(abspath(__file__))))
icon = os.path.join(base, 'openmedialibrary/static/png/oml.png')
title = "Open Media Library"
def drop_cb(wid, context, x, y, time):
print([str(t) for t in context.targets])
context.finish(True, False, time)
return True
def on_key_press_event(widget, event):
if event.state & Gdk.ModifierType.CONTROL_MASK and event.keyval == 113:
Gtk.main_quit()

View file

@ -118,15 +118,21 @@ def run():
def shutdown():
if state.downloads:
logger.debug('shutdown downloads')
state.downloads.join()
if state.scraping:
logger.debug('shutdown scraping')
state.scraping.join()
logger.debug('shutdown http_server')
http_server.stop()
if state.tasks:
logger.debug('shutdown tasks')
state.tasks.join()
if state.nodes:
logger.debug('shutdown nodes')
state.nodes.join()
if PID and os.path.exists(PID):
logger.debug('remove %s', PID)
os.unlink(PID)
signal.signal(signal.SIGTERM, shutdown)