[Buildbot-devel] ShellCommand Description Errors

Dustin J. Mitchell dustin at v.igoro.us
Fri Dec 3 19:36:14 UTC 2010


On Fri, Dec 3, 2010 at 1:58 PM, Rishi Verma <rishi_verma at apple.com> wrote:
> I noticed that when I added description and descriptionDone as such:
>
> class InstallBuildFromArchivePath(ShellCommand):
>        description = "installing results"
>        descriptionDone = "results installed"
>        def start(self):
>  ...
>
> This worked fine, however if I moved the description and descriptionDone into the start(self) I saw the errors.  I still have a few classes where this is the case.

This makes sense.  With apologies for not seeing this afterward, your
implicit assumption that setting self.description=xx is equivalent to
passing description=xx to the constructor and to setting the class
variable description=xx is actually false.  You'll see that the
ShellCommand constructor actually ensures that these are lists:

 75         if description:
 76             self.description = description
 77         if isinstance(self.description, str):
 78             self.description = [self.description]

so the following will work:
 constructor parameter: list or string
 class variable (description= at class level): list or string
 instance variable (self.description=): list only

There is a bug here, however.  The default value for the description,
which *may* be used before start() is called, and is always used if no
description is passed to the constructor.
http://buildbot.net/trac/ticket/1704 is filed for that.

Dustin




More information about the devel mailing list