[Buildbot-devel] Dynamically updating text displayed in build step status

Grig Gheorghiu grig at agilistas.org
Wed Apr 19 16:15:48 UTC 2006


Brian -- thanks a lot for the explanation, it suddenly makes a lot of sense
:-)

Neal -- thanks for the suggestion; I ended up implementing your list copy
idea and it works great.

Grig

On 4/18/06, Neal Norwitz <nnorwitz at gmail.com> wrote:
>
> On 4/18/06, Brian Warner <warner-buildbot at lothar.com> wrote:
> >
> >     def getText(self, cmd, results):
> >         text = self.describe(True)
> >         if results == WARNINGS:
> >             text = text + ["warnings"]
> >         if results == FAILURE:
> >             text = text + ["failed"]
> >         if self.version:
> >             text = text + ["version=" + self.version]
> >         return text
> >
> > Each one of those 'text = text + []' statements will create a brand-new
> list,
> > so the original description is left unmodified.
>
> You can just copy the list the first time, then append (it seems if
> the only reqt is that the list not be the original).  This should be
> more efficient (only allocates a list one time, then resizes if
> necessary) in case it matters:
>
> >     def getText(self, cmd, results):
>   # assume self.describe() returns a list and copy it
> >         text = self.describe(True)[:]
> >         if results == WARNINGS:
> >             text.append("warnings")
> >         if results == FAILURE:
> >             text.append("failed")
> >         if self.version:
> >             text.append("version=" + self.version)
> >         return text
>
> n
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20060419/c3a7e0dd/attachment.html>


More information about the devel mailing list