#2598: Code Snippet From BuildBot Documentation Incorrect
---------------------------+-----------------------
Reporter: Jeremy.Cornett | Owner:
Type: defect | Status: new
Priority: minor | Milestone: undecided
Version: 0.8.7p1 | Keywords: mail
---------------------------+-----------------------
http://docs.buildbot.net/latest/manual/cfg-statustargets.html#mailnotifier
http://docs.buildbot.net/0.8.7p1/manual/cfg-
statustargets.html#mailnotifier
This problem is present in the documentation for at least 0.8.7.p1 and
0.8.8. I haven't checked the previous versions.
An example of a function delivering a customized html email containing the
last 80 log lines of logs of the last build step is given, and it contains
a bug. Near the end of the snippet, these lines are given:
{{{
text.append(u'<pre>'.join([uniline for uniline in unilist]))
text.append(u'</pre>')
}}}
The idea being that we take lines from the STDIO log and include them in
the email sent by the MailNotifier object. Unfortunately, using a join
there will introduce multiple instances of the <pre> tag.
Example:
{{{
>>> text = []
>>> unilist = ["blah", "apple", "rose"]
>>> text.append(u'<pre>'.join([uniline for uniline in unilist]))
>>> text.append(u'</pre>')
>>> print text
[u'blah<pre>apple<pre>rose', u'</pre>']
}}}
Here is a suggested fix:
{{{
text.append(u'<pre>')
text.extend(unilist)
text.append(u'</pre>')
}}}
--
Ticket URL: <http://trac.buildbot.net/ticket/2598>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Buildbot-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/buildbot-commits