"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildbot/reporters/mail.py" between
buildbot-3.0.2.tar.gz and buildbot-3.1.0.tar.gz

About: Buildbot is a continuous integration testing framework (Python-based). It supports also automation of complex build systems, application deployment, and management of sophisticated software-release processes.

mail.py  (buildbot-3.0.2):mail.py  (buildbot-3.1.0)
skipping to change at line 170 skipping to change at line 170
# patches are specifically converted to unicode before entering the db # patches are specifically converted to unicode before entering the db
a = MIMEText(patch['body'].encode(ENCODING), _charset=ENCODING) a = MIMEText(patch['body'].encode(ENCODING), _charset=ENCODING)
# convert to base64 to conform with RFC 5322 2.1.1 # convert to base64 to conform with RFC 5322 2.1.1
del a['Content-Transfer-Encoding'] del a['Content-Transfer-Encoding']
encoders.encode_base64(a) encoders.encode_base64(a)
a.add_header('Content-Disposition', "attachment", a.add_header('Content-Disposition', "attachment",
filename="source patch " + str(index)) filename="source patch " + str(index))
return a return a
@defer.inlineCallbacks @defer.inlineCallbacks
def createEmail(self, msgdict, builderName, title, results, builds=None, def createEmail(self, msgdict, title, results, builds=None, patches=None, lo
patches=None, logs=None): gs=None):
text = msgdict['body'] text = msgdict['body']
type = msgdict['type'] type = msgdict['type']
subject = msgdict['subject'] subject = msgdict['subject']
assert '\n' not in subject, \ assert '\n' not in subject, \
"Subject cannot contain newlines" "Subject cannot contain newlines"
assert type in ('plain', 'html'), \ assert type in ('plain', 'html'), \
"'{}' message type must be 'plain' or 'html'.".format(type) "'{}' message type must be 'plain' or 'html'.".format(type)
skipping to change at line 243 skipping to change at line 242
"but it already exists in the Message - " "but it already exists in the Message - "
"not adding it.") "not adding it.")
m[k] = v m[k] = v
return m return m
@defer.inlineCallbacks @defer.inlineCallbacks
def sendMessage(self, reports): def sendMessage(self, reports):
body = merge_reports_prop(reports, 'body') body = merge_reports_prop(reports, 'body')
subject = merge_reports_prop_take_first(reports, 'subject') subject = merge_reports_prop_take_first(reports, 'subject')
type = merge_reports_prop_take_first(reports, 'type') type = merge_reports_prop_take_first(reports, 'type')
builderName = merge_reports_prop_take_first(reports, 'builder_name')
results = merge_reports_prop(reports, 'results') results = merge_reports_prop(reports, 'results')
builds = merge_reports_prop(reports, 'builds') builds = merge_reports_prop(reports, 'builds')
users = merge_reports_prop(reports, 'users') users = merge_reports_prop(reports, 'users')
patches = merge_reports_prop(reports, 'patches') patches = merge_reports_prop(reports, 'patches')
logs = merge_reports_prop(reports, 'logs') logs = merge_reports_prop(reports, 'logs')
worker = merge_reports_prop_take_first(reports, 'worker') worker = merge_reports_prop_take_first(reports, 'worker')
body = unicode2bytes(body) body = unicode2bytes(body)
msgdict = {'body': body, 'subject': subject, 'type': type} msgdict = {'body': body, 'subject': subject, 'type': type}
# ensure message body ends with double carriage return # ensure message body ends with double carriage return
if not body.endswith(b"\n\n"): if not body.endswith(b"\n\n"):
msgdict['body'] = body + b'\n\n' msgdict['body'] = body + b'\n\n'
m = yield self.createEmail(msgdict, builderName, self.master.config.titl m = yield self.createEmail(msgdict, self.master.config.title, results, b
e, uilds,
results, builds, patches, logs) patches, logs)
# now, who is this message going to? # now, who is this message going to?
if worker is None: if worker is None:
recipients = yield self.findInterrestedUsersEmails(list(users)) recipients = yield self.findInterrestedUsersEmails(list(users))
all_recipients = self.processRecipients(recipients, m) all_recipients = self.processRecipients(recipients, m)
else: else:
all_recipients = list(users) all_recipients = list(users)
yield self.sendMail(m, all_recipients) yield self.sendMail(m, all_recipients)
@defer.inlineCallbacks @defer.inlineCallbacks
 End of changes. 3 change blocks. 
6 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)