Color/bold status
state (github)
This commit is contained in:
parent
c401c45a02
commit
58cd6338fd
1 changed files with 9 additions and 1 deletions
|
@ -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)]
|
||||
|
||||
|
|
Loading…
Reference in a new issue