From 37df134314fb2112a088eec6f1ed1dc022d8b8e9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 2 May 2010 06:20:00 +0200 Subject: Initial commit --- curunir.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 curunir.py (limited to 'curunir.py') 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() -- cgit v1.2.3