Add use_ssl option
This change enables using the statusbot with a non ssl server. Change-Id: I4e79625316ebaa391941743bfd1a2ea29e14df09
This commit is contained in:
parent
6c55c0c444
commit
66c1629a41
|
@ -359,7 +359,7 @@ class AlertFile(UpdateInterface):
|
|||
self.write(None)
|
||||
|
||||
|
||||
class BaseStatusBot(SSL, irc.bot.SingleServerIRCBot):
|
||||
class BaseStatusBot(irc.bot.SingleServerIRCBot):
|
||||
log = logging.getLogger("statusbot.bot")
|
||||
|
||||
def on_pubmsg(self, c, e):
|
||||
|
@ -561,20 +561,29 @@ def _main(configpath):
|
|||
else:
|
||||
use_sasl = False
|
||||
if use_sasl:
|
||||
bot = SASLStatusBot(channels, nicks, publishers, successlog,
|
||||
thankslog,
|
||||
config.get('ircbot', 'nick'),
|
||||
config.get('ircbot', 'pass'),
|
||||
config.get('ircbot', 'server'),
|
||||
config.getint('ircbot', 'port'))
|
||||
base = SASLStatusBot
|
||||
else:
|
||||
bot = NoSASLStatusBot(channels, nicks, publishers, successlog,
|
||||
thankslog,
|
||||
config.get('ircbot', 'nick'),
|
||||
config.get('ircbot', 'pass'),
|
||||
config.get('ircbot', 'server'),
|
||||
config.getint('ircbot', 'port'))
|
||||
bot.start()
|
||||
base = NoSASLStatusBot
|
||||
|
||||
if config.has_option('ircbot', 'use_ssl'):
|
||||
use_ssl = config.getboolean('ircbot', 'use_ssl')
|
||||
else:
|
||||
use_ssl = False
|
||||
|
||||
# SSL is set through class inheritance.
|
||||
if use_ssl:
|
||||
class Bot(base, SSL):
|
||||
pass
|
||||
else:
|
||||
class Bot(base):
|
||||
pass
|
||||
|
||||
Bot(channels, nicks, publishers, successlog,
|
||||
thankslog,
|
||||
config.get('ircbot', 'nick'),
|
||||
config.get('ircbot', 'pass'),
|
||||
config.get('ircbot', 'server'),
|
||||
config.getint('ircbot', 'port')).start()
|
||||
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Reference in New Issue