From 58cd6338fd11f70c74bcbd250b1d651c5e1e9958 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 7 Feb 2019 15:49:36 +0000 Subject: [PATCH] Color/bold `status` state (github) --- modules/github/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/github/__init__.py b/modules/github/__init__.py index 3a977f08..e823cb06 100644 --- a/modules/github/__init__.py +++ b/modules/github/__init__.py @@ -528,9 +528,17 @@ class Module(ModuleManager.BaseModule): def status(self, full_name, data): context = data["context"] - state = data["state"] url = data["target_url"] commit = self._short_hash(data["sha"]) + + state = data["state"] + if state == "success": + state = utils.irc.color(state, utils.consts.GREEN) + elif state == "failure" or state == "error": + state = utils.irc.color(state, utils.consts.RED) + elif state == "pending": + state = utils.irc.bold(state) + return ["[%s status] %s is '%s' - %s" % (commit, context, state, url)]