diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 15:03:32 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-05-02 15:03:32 +0200 |
commit | 41fec54c305d4a81245e9e294c7fc29fed9b7b00 (patch) | |
tree | 592b0f38438d0a7217f0da3c0ba1975ba268e199 | |
parent | 37df134314fb2112a088eec6f1ed1dc022d8b8e9 (diff) | |
download | curunir-41fec54c305d4a81245e9e294c7fc29fed9b7b00.tar curunir-41fec54c305d4a81245e9e294c7fc29fed9b7b00.zip |
Added config file
-rw-r--r-- | config.py | 5 | ||||
-rw-r--r-- | connection/xmpp.py | 8 | ||||
-rw-r--r-- | curunir.py | 3 |
3 files changed, 9 insertions, 7 deletions
diff --git a/config.py b/config.py new file mode 100644 index 0000000..11be75e --- /dev/null +++ b/config.py @@ -0,0 +1,5 @@ +config = { + 'jid': '', + 'password': '', + 'cacertfile': '' + } diff --git a/connection/xmpp.py b/connection/xmpp.py index 1b2dcf1..2c45291 100644 --- a/connection/xmpp.py +++ b/connection/xmpp.py @@ -112,12 +112,8 @@ class VersionHandler(object): class XMPPConnection(Client): - _jid = JID('curunir@jabber.ccc.de/Orthanc') - _password = '' - _cert_file = 'cacert.pem' - - def __init__(self): - Client.__init__(self, self._jid, self._password, tls_settings = TLSSettings(require = True, cacert_file = self._cert_file)) + def __init__(self, config): + Client.__init__(self, JID(config['jid']), config['password'], tls_settings = TLSSettings(require = True, cacert_file = config['cacertfile'])) self.interface_providers = [ MessageHandler(self), @@ -1,6 +1,7 @@ from connection.xmpp import XMPPConnection import signal, sys +from config import config run = True @@ -12,7 +13,7 @@ signal.signal(signal.SIGINT, exithandler) signal.signal(signal.SIGTERM, exithandler) signal.signal(signal.SIGQUIT, exithandler) -connection = XMPPConnection() +connection = XMPPConnection(config) connection.connect() while run: |