Color/bold status state (github)

This commit is contained in:
jesopo 2019-02-07 15:49:36 +00:00
parent c401c45a02
commit 58cd6338fd

View file

@ -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)]