aboutsummaryrefslogtreecommitdiffstats
path: root/local/theme
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2016-09-16 14:14:41 +0300
committerkongr45gpen <electrovesta@gmail.com>2016-09-16 14:29:53 +0300
commit97483dc403c2ac89f9647bfb5f4982c7f1e83259 (patch)
treefdef8d0566452a52cb66b89ca5d08d0b7e926a67 /local/theme
parent3902f3b980c0e2a885b965b4f2503244c3e68782 (diff)
downloadsupybot_github-97483dc403c2ac89f9647bfb5f4982c7f1e83259.tar.gz
supybot_github-97483dc403c2ac89f9647bfb5f4982c7f1e83259.tar.bz2
supybot_github-97483dc403c2ac89f9647bfb5f4982c7f1e83259.zip
Don't send the issue name if it appears too often
Diffstat (limited to 'local/theme')
-rw-r--r--local/theme/DefaultTheme.py7
-rw-r--r--local/theme/Theme.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/local/theme/DefaultTheme.py b/local/theme/DefaultTheme.py
index 2cd6226..3442383 100644
--- a/local/theme/DefaultTheme.py
+++ b/local/theme/DefaultTheme.py
@@ -76,6 +76,7 @@ class DefaultTheme(Theme):
def issue(self, actor, action, type, issueNo, issueTitle, creator, milestone, url, assignee = None, comment = None, labelName = None, labelColor = None):
formattedActor = ircutils.mircColor(actor, "green")
+ showName = showIssueName(self.repoId, issueNo)
if actor == assignee:
formattedActor = ircutils.bold(formattedActor)
@@ -88,18 +89,18 @@ class DefaultTheme(Theme):
elif action == 'labeled' or action == 'unlabeled':
extra = " as %s" % ircutils.mircColor(labelName, hexToMirc(labelColor))
- self.msgs.append( "%s: %s %s %s #%s \"%s\"%s%s %s%s" % (
+ self.msgs.append( "%s: %s %s %s #%s%s%s%s %s%s" % (
self.repo(),
formattedActor,
colorAction(action),
type,
issueNo,
- ircutils.bold(issueTitle),
+ " \"%s\"" % (ircutils.bold(issueTitle)) if showName else '',
" by %s" % ircutils.mircColor(creator,"green") if creator != actor else '',
extra,
self.enclose("%s%s" % (
ircutils.mircColor(milestone, "brown") + ' - ' if milestone else '',
- url
+ url if (showName or comment) else ''
)),
": %s" % maxLen(comment, 70) if comment else ''
))
diff --git a/local/theme/Theme.py b/local/theme/Theme.py
index c209e49..df8929a 100644
--- a/local/theme/Theme.py
+++ b/local/theme/Theme.py
@@ -2,6 +2,7 @@ class Theme(object):
def __init__(self, repository, brackets = "()"):
self.msgs = []
self.repoInfo = repository
+ self.repoId = repository['id']
self.brackets = brackets
def finalize(self):

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