Added config file
This commit is contained in:
parent
37df134314
commit
41fec54c30
3 changed files with 9 additions and 7 deletions
5
config.py
Normal file
5
config.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
config = {
|
||||
'jid': '',
|
||||
'password': '',
|
||||
'cacertfile': ''
|
||||
}
|
|
@ -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:
|
||||
|
|
Reference in a new issue