[Buildbot-devel] Error using WithProperties in ShellCommand description

Gregory Manning Gregory.Manning at mitrefinch.co.uk
Mon Oct 6 09:49:29 UTC 2008


> On Wed, 2008-10-01 at 21:11 -0400, Charles Lepple wrote:
> > On Oct 1, 2008, at 8:24 PM, Dustin J. Mitchell wrote:
> >
> > > On Wed, Oct 1, 2008 at 4:41 PM, John Stile <john at stilen.com> wrote:
> > >>          description=[WithProperties("%(branch)s")],
> > >>          descriptionDone=[WithProperties("%(branch)s:-trunk")]
> > >
> > > Unfortunately, you can't use WithProperties in these fields.
> > > WithProperties only applies to strings sent to the buildslave, and
> > > they are "expanded" at that time.
> >
> >
> > That said, you could subclass ShellCommand, and override the
> > createSummary method to set descriptionDone at build time.
>
> I spent some time trying to do this.
> In fact, I haven't got too far.
>
> Is there a better way to get the branch and revision in the waterfall's description and
> descriptionDone?

I just got this working:

class MyShell(ShellCommand):
    def describe(self,done=False):
        descr = [self.getProperty("slavename")]
        if self.getProperty("branch"):
            descr.append(self.getProperty("branch"))
        return descr

That is, subclass the 'describe' function. You might want to call ShellCommand.describe, and then append to it, but the above works for my needs.

Greg Manning
Development Analyst

Mitrefinch Ltd.
Mitrefinch House,
Green Lane, Clifton,
York, YO30 5YY
www.mitrefinch.co.uk
Tel +44 (0)1904 693115
Fax +44 (0)1904 693792




More information about the devel mailing list