diff options
author | kongr45gpen <kongr45gpen@helit.org> | 2013-07-24 18:18:12 +0300 |
---|---|---|
committer | kongr45gpen <kongr45gpen@helit.org> | 2013-07-24 18:18:12 +0300 |
commit | 346c5f5400c610d06f6d4ff28b4474046c94525b (patch) | |
tree | a00e75c9f191d9c76040b2a51ce40d7bdc70846e /plugin.py | |
parent | a42348f4cac5ad97fccc9aaaf08243ff426ec546 (diff) | |
download | supybot_github-346c5f5400c610d06f6d4ff28b4474046c94525b.tar.gz supybot_github-346c5f5400c610d06f6d4ff28b4474046c94525b.tar.bz2 supybot_github-346c5f5400c610d06f6d4ff28b4474046c94525b.zip |
Show more information on the messages
And add some colour
Diffstat (limited to 'plugin.py')
-rw-r--r-- | plugin.py | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -45,6 +45,10 @@ def plural(number, s, p): return p return s +# Possible colours: +# white, black, (light/dark) blue, (light) green, red, brown, purple, +# orange, yellow, teal, pink, light/dark gray/grey + class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(s): @@ -67,12 +71,18 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): msgs = [] commitno = len(data['commits']) - msgs.append( ircmsgs.privmsg("#main", "%s pushed %i %s, check them out" % - (data['pusher']['name'], + branch = data['ref'].split('/',2)[2] + + msgs.append( ircmsgs.privmsg("#main", "%s @ %s: %s pushed %i %s (%s)" % ( + ircutils.bold(ircutils.mircColor(branch, "blue")), + ircutils.bold(data['repository']['name']), + ircutils.mircColor(data['pusher']['name'], "green"), commitno, - plural(commitno, "commit", "commits"))) ) + plural(commitno, "commit", "commits"), + data['compare'] + )) ) - msgs.append( ircmsgs.privmsg("#main", "%s" % (data['compare'])) ) + #msgs.append( ircmsgs.privmsg("#main", "%s" % ()) ) for msg in msgs: irc.queueMsg(msg) |