summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-05-02 15:03:32 +0200
committerMatthias Schiffer <matthias@gamezock.de>2010-05-02 15:03:32 +0200
commit41fec54c305d4a81245e9e294c7fc29fed9b7b00 (patch)
tree592b0f38438d0a7217f0da3c0ba1975ba268e199
parent37df134314fb2112a088eec6f1ed1dc022d8b8e9 (diff)
downloadcurunir-41fec54c305d4a81245e9e294c7fc29fed9b7b00.tar
curunir-41fec54c305d4a81245e9e294c7fc29fed9b7b00.zip
Added config file
-rw-r--r--config.py5
-rw-r--r--connection/xmpp.py8
-rw-r--r--curunir.py3
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),
diff --git a/curunir.py b/curunir.py
index 3c6c442..7d14410 100644
--- a/curunir.py
+++ b/curunir.py
@@ -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: