Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Jan 4, 2010
2 parents 13b4c43 + baa5c8d commit 8748d1d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test failures and summarises them on the waterfall page. It also makes server
error logs available for debugging failures, and optionally inserts
information about test runs and test failures into an external database.

** Python API Docs

The docstrings for buildbot are now available in a web-friendly format:
http://djmitche.github.com/buildbot/docs/latest/reference

** Many, many bugfixes

* Release 0.7.11p (July 16, 2009)
Expand Down
23 changes: 16 additions & 7 deletions buildbot/status/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,29 @@ def defaultMessage(self, mode, name, build, results, master_status):
text += "sincerely,\n"
text += " -The Buildbot\n"
text += "\n"
return (text, 'plain')
return { 'body' : text, 'type' : 'plain' }

def buildMessage(self, name, build, results):
if self.customMesg:
# the customMesg stuff can be *huge*, so we prefer not to load it
attrs = self.getCustomMesgData(self.mode, name, build, results, self.master_status)
text, type = self.customMesg(attrs)
msgdict = { 'body' : text, 'type' : type }
elif self.messageFormatter:
text, type = self.messageFormatter(self.mode, name, build, results, self.master_status)
msgdict = self.messageFormatter(self.mode, name, build, results, self.master_status)
else:
text, type = self.defaultMessage(self.mode, name, build, results, self.master_status)
msgdict = self.defaultMessage(self.mode, name, build, results, self.master_status)

text = msgdict['body']
type = msgdict['type']
if 'subject' in msgdict:
subject = msgdict['subject']
else:
subject = self.subject % { 'result': Results[results],
'projectName': self.master_status.getProjectName(),
'builder': name,
}


assert type in ('plain', 'html'), "'%s' message type must be 'plain' or 'html'." % type

Expand All @@ -404,10 +416,7 @@ def buildMessage(self, name, build, results):
m.set_type("text/%s" % type)

m['Date'] = formatdate(localtime=True)
m['Subject'] = self.subject % { 'result': Results[results],
'projectName': self.master_status.getProjectName(),
'builder': name,
}
m['Subject'] = subject
m['From'] = self.fromaddr
# m['To'] is added later

Expand Down
16 changes: 10 additions & 6 deletions docs/buildbot.texinfo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename buildbot.info
@settitle BuildBot Manual 0.7.11
@settitle BuildBot Manual 0.7.12
@defcodeindex cs
@defcodeindex sl
@defcodeindex bf
Expand All @@ -22,7 +22,7 @@
@copying
This is the BuildBot manual.

Copyright (C) 2005,2006 Brian Warner
Copyright (C) 2005, 2006, 2009, 2010 Brian Warner

Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty
Expand Down Expand Up @@ -8197,7 +8197,10 @@ def messageFormatter(name, build, results, master_status):
logLines = 10
text = list()
text.append("STATUS: %s" % result.title())
return ("\n".join(text), 'plain')
return {
'body' : "\n".join(text),
'type' : 'plain'
}
mn = MailNotifier(fromaddr="buildbot@@example.org",
sendToInterestedUsers=False,
Expand Down Expand Up @@ -8283,9 +8286,10 @@ This is a optional function that can be used to generate a custom mail message.
A @code{messageFormatter} function takes the mail mode (@code{mode}), builder
name (@code{name}), the build status (@code{build}), the result code
(@code{results}), and the BuildMaster status (@code{master_status}). It
returns a tuple of strings. The first string is the complete text of the
message and the second is the message type ('plain' or 'html'). The 'html' type
should be used when generating an HTML message.
returns a dictionary. The @code{body} key gives a string that is the complete
text of the message. The @code{type} key is the message type ('plain' or
'html'). The 'html' type should be used when generating an HTML message. The
@code{subject} key is optional, but gives the subject for the email.

@item extraHeaders
(dictionary) A dictionary containing key/value pairs of extra headers to add
Expand Down

0 comments on commit 8748d1d

Please sign in to comment.