mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-12-23 05:12:15 +03:00
ssl parameter added to conf file
This commit is contained in:
parent
6a1e08cf18
commit
9b96a6e286
30 changed files with 17 additions and 10 deletions
|
@ -2,8 +2,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
class EventBase():
|
||||
|
||||
class EventBase:
|
||||
"""
|
||||
This is base event class for event management.
|
||||
"""
|
||||
|
@ -24,13 +24,14 @@ class EventBase():
|
|||
self.listener_events.append({'event_name': event_name, 'callback_func': callback_func})
|
||||
|
||||
|
||||
class Event():
|
||||
class Event:
|
||||
"""
|
||||
This is event class. Takes two argument ;
|
||||
Args:
|
||||
event_name : name of event.
|
||||
callback_args : arguments specified by user. This function will transmit args to callback function directly.
|
||||
"""
|
||||
|
||||
def __init__(self, event_name, *callback_args):
|
||||
for listener in EventBase.listeners:
|
||||
for listener_cls in listener.listener_events:
|
|
@ -34,6 +34,11 @@ class Messenger(ClientXMPP):
|
|||
self.hostname = self.configuration_manager.get('CONNECTION', 'host')
|
||||
self.receiver_resource = self.configuration_manager.get('CONNECTION', 'receiverresource')
|
||||
|
||||
if self.configuration_manager.get('CONNECTION', 'use_tls').split().lower() == 'true':
|
||||
self.use_tls = True
|
||||
else:
|
||||
self.use_tls = False
|
||||
|
||||
self.receiver = self.configuration_manager.get('CONNECTION',
|
||||
'receiverjid') + '@' + self.configuration_manager.get(
|
||||
'CONNECTION', 'servicename')
|
||||
|
@ -67,7 +72,8 @@ class Messenger(ClientXMPP):
|
|||
def connect_to_server(self): # Connect to the XMPP server and start processing XMPP stanzas.
|
||||
try:
|
||||
self['feature_mechanisms'].unencrypted_plain = True
|
||||
self.connect((self.hostname, 5222), use_tls=False)
|
||||
|
||||
self.connect((self.hostname, 5222), use_tls=self.use_tls)
|
||||
self.process(block=False)
|
||||
self.logger.debug('[Messenger] Connection were established successfully')
|
||||
return True
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
from base.model.enum.MessageType import MessageType
|
||||
from base.model.enum.message_type import MessageType
|
||||
|
||||
|
||||
class MessageFactory(object):
|
|
@ -3,7 +3,7 @@
|
|||
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
||||
import json
|
||||
|
||||
from base.model.Plugin import Plugin
|
||||
from base.model.plugin import Plugin
|
||||
|
||||
|
||||
class Profile(object):
|
|
@ -3,7 +3,7 @@
|
|||
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
||||
import json
|
||||
|
||||
from base.model.PluginBean import PluginBean
|
||||
from base.model.plugin_bean import PluginBean
|
||||
|
||||
|
||||
class ProfileBean(object):
|
|
@ -4,7 +4,7 @@
|
|||
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
||||
import json
|
||||
|
||||
from base.model.Plugin import Plugin
|
||||
from base.model.plugin import Plugin
|
||||
|
||||
|
||||
class Task(object):
|
|
@ -8,7 +8,7 @@ import uuid
|
|||
from uuid import getnode as get_mac
|
||||
|
||||
from base.Scope import Scope
|
||||
from base.messaging.AnonymousMessenger import AnonymousMessenger
|
||||
from base.messaging.anonymous_messenger import AnonymousMessenger
|
||||
from base.system.system import System
|
||||
from base.timer.setup_timer import SetupTimer
|
||||
from base.timer.timer import Timer
|
|
@ -3,8 +3,8 @@
|
|||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
from base.Scope import Scope
|
||||
from base.model.MessageFactory import MessageFactory
|
||||
from base.model.enum.MessageType import MessageType
|
||||
from base.model.message_factory import MessageFactory
|
||||
from base.model.enum.message_type import MessageType
|
||||
|
||||
|
||||
class TaskManager(object):
|
Loading…
Reference in a new issue