aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkongr45gpen <kongr45gpen@helit.org>2013-08-01 14:12:11 +0300
committerkongr45gpen <kongr45gpen@helit.org>2013-08-01 14:12:11 +0300
commit37b6c1351d9ddd56800e0250e8c1bb3f5e69427e (patch)
tree0d5c18f1e76913f666579f66f6b5eaa1f9aaa486
parent472155a60589820058f539efe6d77affa3ba061c (diff)
downloadsupybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.tar.gz
supybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.tar.bz2
supybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.zip
Add showMilestone configuration variable
Lower the length of the shown message
-rw-r--r--config.py4
-rw-r--r--plugin.py10
2 files changed, 10 insertions, 4 deletions
diff --git a/config.py b/config.py
index eeccb02..bf2638d 100644
--- a/config.py
+++ b/config.py
@@ -34,4 +34,8 @@ conf.registerGlobalValue(Github, 'disallowChannelOverride',
registry.Boolean(False,
"""Don't let the user select the channel where the messages will be sent to on the URL"""))
+conf.registerGlobalValue(Github, 'showMilestone',
+ registry.Boolean(True,
+ """Show the name of the milestone when reporting issues or issue comments"""))
+
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
diff --git a/plugin.py b/plugin.py
index e8cf51c..ddfda65 100644
--- a/plugin.py
+++ b/plugin.py
@@ -300,7 +300,7 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
creator = " by %s" % (ircutils.mircColor(data['issue']['user']['login'],"green"),)
milestone = ''
- if data['issue']['milestone']:
+ if data['issue']['milestone'] and configValue("showMilestone"):
milestone = ircutils.mircColor(" (%s" % (data['issue']['milestone']['title']),"brown")
if milestone:
@@ -332,7 +332,7 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
creator = " by %s" % (ircutils.mircColor(data['issue']['user']['login'],"green"),)
milestone = ''
- if data['issue']['milestone']:
+ if data['issue']['milestone'] and configValue("showMilestone"):
milestone = ircutils.mircColor(" (%s" % (data['issue']['milestone']['title']),"brown")
if milestone:
@@ -342,8 +342,10 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
lines = data['comment']['body'].splitlines()
line = lines[0]
- if len(line) > 100:
- line = "%s..." % (line[0:97])
+ if len(line) > 70:
+ line = "%s..." % (line[0:67])
+ elif len(lines) > 1:
+ line += "..."
msgs.append( ircmsgs.privmsg(channel, "%s: %s commented on issue %s \"%s\"%s%s %s%s): %s" % (
ircutils.bold(data['repository']['name']),

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