diff options
| author | 2018-09-27 12:08:07 +0100 | |
|---|---|---|
| committer | 2018-09-27 12:08:07 +0100 | |
| commit | 6eb8b1ba6d9aaaf7df42f3d705149f02b6a1b871 (patch) | |
| tree | ece91b1c4d871d5d2b9a3f6319598e33aa13f93f /modules/sasl.py | |
| parent | Use ModuleManager.BaseModule in more modules (diff) | |
| signature | ||
Move all exports to @Utils.export calls
Diffstat (limited to 'modules/sasl.py')
| -rw-r--r-- | modules/sasl.py | 22 |
1 files changed, 10 insertions, 12 deletions
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"] |
