summaryrefslogtreecommitdiffstats
path: root/curunir.py
diff options
context:
space:
mode:
Diffstat (limited to 'curunir.py')
-rw-r--r--curunir.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/curunir.py b/curunir.py
new file mode 100644
index 0000000..3c6c442
--- /dev/null
+++ b/curunir.py
@@ -0,0 +1,21 @@
+from connection.xmpp import XMPPConnection
+
+import signal, sys
+
+run = True
+
+def exithandler(signum, frame):
+ global run
+ run = False
+
+signal.signal(signal.SIGINT, exithandler)
+signal.signal(signal.SIGTERM, exithandler)
+signal.signal(signal.SIGQUIT, exithandler)
+
+connection = XMPPConnection()
+connection.connect()
+
+while run:
+ connection.stream.loop_iter(1)
+
+connection.disconnect()