From ae9d099a41b703ce875cf8746a94b6995bbaedfb Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 28 Jun 2019 23:16:05 +0100 Subject: Refactor set/channelset/serverset/botset in to 'utils.Setting' objects --- modules/title.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'modules/title.py') diff --git a/modules/title.py b/modules/title.py index a6e924cc..709b59ba 100644 --- a/modules/title.py +++ b/modules/title.py @@ -5,16 +5,12 @@ import hashlib, re, urllib.parse from src import EventManager, ModuleManager, utils -@utils.export("channelset", {"setting": "auto-title", - "help": "Disable/Enable automatically getting info titles from URLs", - "validate": utils.bool_or_none, "example": "on"}) -@utils.export("channelset", {"setting": "title-shorten", - "help": "Enable/disable shortening URLs when getting their title", - "validate": utils.bool_or_none, "example": "on"}) -@utils.export("channelset", {"setting": "auto-title-first", - "help": ("Enable/disable showing who first posted a URL that was " - "auto-titled"), - "validate": utils.bool_or_none, "exaple": "on"}) +@utils.export("channelset", utils.BoolSetting("auto-title", + "Disable/Enable automatically getting info titles from URLs")) +@utils.export("channelset", utils.BoolSetting("title-shorten", + "Enable/disable shortening URLs when getting their title")) +@utils.export("channelset", utils.BoolSetting("auto-title-first", + "Enable/disable showing who first posted a URL that was auto-titled")) class Module(ModuleManager.BaseModule): def _url_hash(self, url): return "sha256:%s" % hashlib.sha256(url.lower().encode("utf8") -- cgit v1.3.1-10-gc9f91