[llvm-commits] [zorg] r78210 - /zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py
Daniel Dunbar
daniel at zuster.org
Wed Aug 5 09:42:17 PDT 2009
Author: ddunbar
Date: Wed Aug 5 11:42:10 2009
New Revision: 78210
URL: http://llvm.org/viewvc/llvm-project?rev=78210&view=rev
Log:
Implement the comparable mixin for the InformativeMailNotifier,
otherwise buildbot likes to infinite loop on reconfig.
Modified:
zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py
Modified: zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py?rev=78210&r1=78209&r2=78210&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py (original)
+++ zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py Wed Aug 5 11:42:10 2009
@@ -1,19 +1,22 @@
+import buildbot.util
from buildbot.status import builder, mail
-class InformativeMailNotifier(mail.MailNotifier):
+class InformativeMailNotifier(mail.MailNotifier, buildbot.util.ComparableMixin):
"""MailNotifier subclass which provides additional information about the
build failure inside the email."""
+ compare_attrs = ["num_lines", "only_failure_logs"]
+
# FIXME: The customMessage interface is fairly inefficient, switch to
# something new when it becomes available.
def __init__(self,
- numLines = 10, onlyFailureLogs = True,
+ num_lines = 10, only_failure_logs = True,
*attrs, **kwargs):
mail.MailNotifier.__init__(self, customMesg=self.customMessage,
*attrs, **kwargs)
- self.numLines = numLines
- self.onlyFailureLogs = onlyFailureLogs
+ self.num_lines = num_lines
+ self.only_failure_logs = only_failure_logs
def customMessage(self, attrs):
# Get the standard message.
@@ -27,14 +30,14 @@
data += '\n\n'
# Append log files.
- if self.numLines:
+ if self.num_lines:
data += 'LOGS:\n'
for name, url, lines, logstatus in attrs['logs']:
- if (self.onlyFailureLogs and logstatus != builder.FAILURE):
+ if (self.only_failure_logs and logstatus != builder.FAILURE):
continue
- data += "Last %d lines of '%s':\n" % (self.numLines, name)
- data += '\t' + '\n\t'.join(lines[-self.numLines:])
+ data += "Last %d lines of '%s':\n" % (self.num_lines, name)
+ data += '\t' + '\n\t'.join(lines[-self.num_lines:])
data += '\n\n'
return (data, 'plain')
More information about the llvm-commits
mailing list