aboutsummaryrefslogtreecommitdiff
path: root/modules/github
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-07 15:49:36 +0000
committerGravatar jesopo2019-02-07 15:49:36 +0000
commit58cd6338fd11f70c74bcbd250b1d651c5e1e9958 (patch)
treee8be4cfe3fcf0739926fec681b2062cf7e721582 /modules/github
parenttypo, "_short_id" -> "_short_hash" (github) (diff)
signature
Color/bold `status` state (github)
Diffstat (limited to 'modules/github')
-rw-r--r--modules/github/__init__.py10
1 files changed, 9 insertions, 1 deletions
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)]