Colour the state of a pull request
This commit is contained in:
parent
c45fcb34d1
commit
e4a4b193fe
1 changed files with 13 additions and 0 deletions
|
@ -142,6 +142,19 @@ class Module(ModuleManager.BaseModule):
|
||||||
removed = self._removed(page.data["deletions"])
|
removed = self._removed(page.data["deletions"])
|
||||||
url = self._short_url(page.data["html_url"])
|
url = self._short_url(page.data["html_url"])
|
||||||
|
|
||||||
|
state = page.data["state"]
|
||||||
|
state_color = None
|
||||||
|
if page.data["merged"]:
|
||||||
|
state = "merged"
|
||||||
|
state_color = utils.consts.GREEN
|
||||||
|
elif state == "open":
|
||||||
|
state_color = utils.consts.GREEN
|
||||||
|
elif state == "closed":
|
||||||
|
state_color = utils.consts.RED
|
||||||
|
|
||||||
|
if state_color:
|
||||||
|
state = utils.irc.color(state, state_color)
|
||||||
|
|
||||||
event["stdout"].write(
|
event["stdout"].write(
|
||||||
"(%s pull#%s, %s) %s → %s [%s/%s] %s %s" % (
|
"(%s pull#%s, %s) %s → %s [%s/%s] %s %s" % (
|
||||||
repo, number, page.data["state"], branch_from, branch_to,
|
repo, number, page.data["state"], branch_from, branch_to,
|
||||||
|
|
Loading…
Reference in a new issue