diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 06:20:00 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 14:55:53 +0200 |
commit | 37df134314fb2112a088eec6f1ed1dc022d8b8e9 (patch) | |
tree | b4ddd612505071820a4cd76dfe502c60d5518169 /curunir.py | |
download | curunir-37df134314fb2112a088eec6f1ed1dc022d8b8e9.tar curunir-37df134314fb2112a088eec6f1ed1dc022d8b8e9.zip |
Initial commit
Diffstat (limited to 'curunir.py')
-rw-r--r-- | curunir.py | 21 |
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() |