From 6eb8b1ba6d9aaaf7df42f3d705149f02b6a1b871 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 27 Sep 2018 12:08:07 +0100 Subject: Move all exports to @Utils.export calls --- modules/sasl.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'modules/sasl.py') diff --git a/modules/sasl.py b/modules/sasl.py index cbebb31e..ebe305b9 100644 --- a/modules/sasl.py +++ b/modules/sasl.py @@ -1,18 +1,16 @@ import base64 -from src import Utils +from src import ModuleManager, Utils -class Module(object): - def __init__(self, bot, events, exports): - exports.add("serverset", {"setting": "sasl", - "help": "Set the sasl username/password for this server", - "validate": self._validate}) - - def _validate(self, s): - mechanism = s - if " " in s: - mechanism, arguments = s.split(" ", 1) - return {"mechanism": mechanism, "args": arguments} +def _validate(self, s): + mechanism = s + if " " in s: + mechanism, arguments = s.split(" ", 1) + return {"mechanism": mechanism, "args": arguments} +@Utils.export("serverset", {"setting": "sasl", + "help": "Set the sasl username/password for this server", + "validate": _validate}) +class Module(ModuleManager.BaseModule): @Utils.hook("received.cap.ls") def on_cap(self, event): has_sasl = "sasl" in event["capabilities"] -- cgit v1.3.1-10-gc9f91