[Buildbot-devel] WithProperties: outdated docs?

Tom Prince tom.prince at ualberta.net
Thu Jun 16 06:10:11 UTC 2011


On Thu, 16 Jun 2011 00:40:22 +0300, Dmitry Nezhevenko <dion at dion.org.ua> wrote:
> Hi,
> 
> I've finally merged 0.8.4 with my local changes and observed issue with
> WithProperties.
> 
> I've some very dummy step that just adds URL to published artifacts:
> 
> class AddURLStep(BuildStep):
>     
>     def __init__(self, linkName="", linkURL="", **kwargs):
>         BuildStep.__init__(self)
>         
>         self.linkName = linkName
>         self.linkURL = linkURL
>         
>         self.addFactoryArguments(linkName = linkName)
>         self.addFactoryArguments(linkURL = linkURL)
>     
>     def start(self):
>         linkName = self.build.getProperties().render(self.linkName)
>         linkURL = self.build.getProperties().render(self.linkURL)
>         self.addURL(linkName, linkURL)
>         self.finished(SUCCESS)
> 
> It looks like now there is no .render() method in properties. Code was
> refactored and now it's unclear for me which one to call? 
> 
> From my expectation, right one should be:
> 
>         linkName = self.build.render(self.linkName)

The way to do this is to add a class attribute renderables, containing a
list of attributes to render:

class AddURLStep(BuildStep):
    renderables=['linkName', 'linkURL']

    ...

They will then get rendered automatically.

  Tom





More information about the devel mailing list