aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-03-02 08:38:56 +0000
committerGravatar jesopo2019-03-02 08:38:56 +0000
commite4a4b193fe17e675ba4498490c9c882462498490 (patch)
tree4b383181dbd9e824ef9e2e7224bbe47a196a90a0 /modules
parentChange PR/issue number color to pink (diff)
signature
Colour the state of a pull request
Diffstat (limited to 'modules')
-rw-r--r--modules/github/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/github/__init__.py b/modules/github/__init__.py
index c43b5c67..7498950f 100644
--- a/modules/github/__init__.py
+++ b/modules/github/__init__.py
@@ -142,6 +142,19 @@ class Module(ModuleManager.BaseModule):
removed = self._removed(page.data["deletions"])
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(
"(%s pull#%s, %s) %s → %s [%s/%s] %s %s" % (
repo, number, page.data["state"], branch_from, branch_to,