summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: