Change added/removed/modified order, change modified symbol and added colors to

added/removed/modified
This commit is contained in:
jesopo 2018-11-12 08:35:16 +00:00
parent 8b135d8310
commit 102d7491ef

View file

@ -76,14 +76,17 @@ class Module(ModuleManager.BaseModule):
author = "%s <%s>" % (commit["author"]["username"], author = "%s <%s>" % (commit["author"]["username"],
commit["author"]["email"]) commit["author"]["email"])
modified_count = len(commit["modified"])
added_count = len(commit["added"])
removed_count = len(commit["removed"])
url = COMMIT_URL % (full_name, id[:8]) url = COMMIT_URL % (full_name, id[:8])
outputs.append("(%s) [files: +%d%d -%d] commit by '%s': %s - %s" added = utils.irc.color("+%d" % len(commit["added"]),
% (full_name, added_count, modified_count, removed_count, utils.irc.COLOR_GREEN)
author, message, url)) removed = utils.irc.color("-%d" % len(commit["removed"]),
utils.irc.COLOR_RED)
modified = utils.irc.color("±%d" % len(commit["modified"]),
utils.irc.COLOR_YELLOW)
outputs.append("(%s) [files: %s %s %s] commit by '%s': %s - %s"
% (full_name, added, removed, modified, author, message, url))
return outputs return outputs