[Buildbot-devel] getRenderingFor

Dustin J. Mitchell dustin at v.igoro.us
Tue Feb 7 16:14:49 UTC 2012


On Tue, Feb 7, 2012 at 8:02 AM, Harry <harry at aeteurope.nl> wrote:
> I was confused when analyzing the buildbot.process.properties.WithProperties
>  method getRenderingFor.
>
>
>
> The method WithProperties.getRenderingFor  accepts a 2nd parameter name with
> name 'build'. If I set a break then the build parameter resulted to be a
> Properties object. Is it possible to that sometimes a Build object and
> sometimes a Propeties object is passed. Both, Build and Properties inherit
> from PropertiesMixin so both have getProperties.
>
> In the function the “build” object is passed to the lambda subs, now I think
> a Properties object will be passed.

It's anything implementing the IProperties interface.  That variable
name is a holdover from when it was a build, and should be changed.

> Writing a class analog to WithProperties I run in the problem of not having
> a build object but a properties object. Happily the properties object has a
> getBuild method so I was able to fix this in the new class.

This is the right approach.  Note the caveat for getBuild in
master/buildbot/interfaces.py.

> Up to now I do not understand the Properties pattern/design/construction
> completely but in my opinion the parameter name ‘build’ is wrong.

It sounds like you understand it better than you think :)

Dustin




More information about the devel mailing list