diff options
| author | 2019-02-10 15:06:26 +0000 | |
|---|---|---|
| committer | 2019-02-10 15:06:26 +0000 | |
| commit | 9235d23350009fe71cf799c6f88a22150e3d2269 (patch) | |
| tree | 8b85e9c47fc5a98ae9011bcd70c0847129830e0b | |
| parent | Don't send empty space with JOIN if key=="" (src/IRCServer.py) (diff) | |
| signature | ||
Show when pushes are forced (github)
| -rw-r--r-- | modules/github/__init__.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/github/__init__.py b/modules/github/__init__.py index 55280ab3..7ef205da 100644 --- a/modules/github/__init__.py +++ b/modules/github/__init__.py @@ -406,6 +406,10 @@ class Module(ModuleManager.BaseModule): branch = data["ref"].split("/", 2)[2] branch = utils.irc.color(branch, utils.consts.LIGHTBLUE) + forced = "" + if data["forced"]: + forced = "%s " % utils.irc.color("force", utils.consts.RED) + if len(data["commits"]) <= 3: for commit in data["commits"]: id = self._short_hash(commit["id"]) @@ -417,8 +421,10 @@ class Module(ModuleManager.BaseModule): removed = self._removed(len(commit["removed"])) modified = self._modified(len(commit["modified"])) - outputs.append("[%s/%s/%s files] commit by %s to %s: %s - %s" - % (added, removed, modified, author, branch, message, url)) + outputs.append( + "[%s/%s/%s files] %s %spushed commit to %s: %s - %s" + % (added, removed, modified, author, forced, branch, + message, url)) else: first_id = self._short_hash(data["before"]) last_id = self._short_hash(data["commits"][-1]["id"]) @@ -432,9 +438,9 @@ class Module(ModuleManager.BaseModule): modified = self._modified(len(self._flat_unique(commits, "modified"))) - outputs.append("[%s/%s/%s files] %s pushed %d commits to %s - %s" - % (added, removed, modified, pusher, len(data["commits"]), - branch, url)) + outputs.append("[%s/%s/%s files] %s %spushed %d commits to %s - %s" + % (added, removed, modified, pusher, forced, + len(data["commits"]), branch, url)) return outputs |
