|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
import argparse
|
|
|
+import blinker
|
|
|
import gi
|
|
|
gi.require_version('Notify', '0.7')
|
|
|
from gi.repository import Notify
|
|
@@ -38,6 +39,9 @@ import beewatch.server
|
|
|
|
|
|
import digilib.misc
|
|
|
|
|
|
+
|
|
|
+Notify.init("Bee Watch Server")
|
|
|
+
|
|
|
log = logging.getLogger(__name__+"")
|
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
@@ -119,6 +123,8 @@ bee_server = beewatch.server.BeeWatchServer(
|
|
|
log_ip=args.log_ip,
|
|
|
)
|
|
|
|
|
|
+sig_exit = blinker.signal("global-exit")
|
|
|
+
|
|
|
try:
|
|
|
bee_server.run()
|
|
|
except Exception as e:
|
|
@@ -128,14 +134,46 @@ except KeyboardInterrupt:
|
|
|
print("\r ", end="\r")
|
|
|
logging.warn("KeyboardInterrupt! aborting!")
|
|
|
finally:
|
|
|
-
|
|
|
+ sig_exit.send()
|
|
|
pass
|
|
|
|
|
|
|
|
|
-
|
|
|
sys.exit()
|
|
|
|
|
|
-log = logging.getLogger(__name__+".server")
|
|
|
-logc = logging.getLogger(__name__+".chat")
|
|
|
|
|
|
-Notify.init("Bee Watch Server")
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|