diff options
author | kongr45gpen <kongr45gpen@helit.org> | 2013-08-01 14:12:11 +0300 |
---|---|---|
committer | kongr45gpen <kongr45gpen@helit.org> | 2013-08-01 14:12:11 +0300 |
commit | 37b6c1351d9ddd56800e0250e8c1bb3f5e69427e (patch) | |
tree | 0d5c18f1e76913f666579f66f6b5eaa1f9aaa486 | |
parent | 472155a60589820058f539efe6d77affa3ba061c (diff) | |
download | supybot_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.py | 4 | ||||
-rw-r--r-- | plugin.py | 10 |
2 files changed, 10 insertions, 4 deletions
@@ -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: @@ -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']), |