[Buildbot-devel] Getting Properties value

Charles Lepple clepple at gmail.com
Wed Sep 4 02:44:01 UTC 2013


On Sep 1, 2013, at 1:02 PM, sergio borghese wrote:

> My understanding was that the Property object was returning integers, strings or some basic type
> Tried converting the rev_no variable to str() or int() but got other errors instead
> 
> I tried several changes to the above code, but no luck so far.
> Probably it's just that I'm not a skilled Python coder...

Here's how to think about the bits of Python in the configuration file: code outside of an explicit function definition is being executed only once when the Buildbot master starts up.

For a Property, you want a different value each time you reference that Property name, so the code needs to be inside of a callback function (most likely in a subclass of a BuildStep). As Kevin pointed out, in that case, you need a context for the Property, and that context is usually a BuildStep, or an object that contains them. When you are looking at the examples, consider where the Property is coming from.

-- 
Charles Lepple
clepple at gmail







More information about the devel mailing list