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/github.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'modules/github.py') diff --git a/modules/github.py b/modules/github.py index 102f3ab2..633f1a0a 100644 --- a/modules/github.py +++ b/modules/github.py @@ -22,15 +22,13 @@ REGEX_REF = re.compile(r"(?:\S+(?:\/\S+)?)?#\d+") API_ISSUE_URL = "https://api.github.com/repos/%s/%s/issues/%s" API_PULL_URL = "https://api.github.com/repos/%s/%s/pulls/%s" -@utils.export("channelset", {"setting": "github-default-repo", - "help": "Set the default github repo for the current channel", - "example": "jesopo/bitbot"}) -@utils.export("channelset", {"setting": "auto-github", - "help": "Enable/disable automatically getting github issue/PR info", - "validate": utils.bool_or_none, "example": "on"}) -@utils.export("channelset", {"setting": "auto-github-cooldown", - "help": "Set amount of seconds between auto-github duplicates", - "validate": utils.int_or_none, "example": "300"}) +@utils.export("channelset", utils.Setting("github-default-repo", + "Set the default github repo for the current channel", + example="jesopo/bitbot")) +@utils.export("channelset", utils.Setting("auto-github", + "Enable/disable automatically getting github issue/PR info")) +@utils.export("channelset", utils.IntSetting("auto-github-cooldown", + "Set amount of seconds between auto-github duplicates", example="300")) class Module(ModuleManager.BaseModule): def _parse_ref(self, channel, ref): repo, _, number = ref.rpartition("#") -- cgit v1.3.1-10-gc9f91