aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorkongr45gpen <kongr45gpen@helit.org>2013-07-24 18:18:12 +0300
committerkongr45gpen <kongr45gpen@helit.org>2013-07-24 18:18:12 +0300
commit346c5f5400c610d06f6d4ff28b4474046c94525b (patch)
treea00e75c9f191d9c76040b2a51ce40d7bdc70846e /plugin.py
parenta42348f4cac5ad97fccc9aaaf08243ff426ec546 (diff)
downloadsupybot_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.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugin.py b/plugin.py
index 264c5d2..6b703cc 100644
--- a/plugin.py
+++ b/plugin.py
@@ -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)

© 2014-2024 Faster IT GmbH | imprint | privacy policy