[Buildbot-devel] Getting Properties value

Kevin Funk kevin.funk at kdab.com
Mon Sep 2 08:18:59 UTC 2013


Am Sonntag, 1. September 2013, 19:02:52 schrieb sergio borghese:
> Hi All,
> 
> I cannot get my head out a  (probably silly) problem I'm facing
> I would like to get the version control revision to create a string, that
> is used to archive the build
> So in my build configuration I'm doing something like:
> 
> *rev_no = Property('got_revision')*
> *pck_basename = "kphone_" + osinfo.machine() + "-r" + rev_no*
> 
> but I get the following error:
> *pck_basename = "kphone_" + osinfo.machine() + "-r" + rev_no*
> * exceptions.TypeError: cannot concatenate 'str' and 'instance' objects*
> 
> 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...
> 
> Is there a smarter way to do what I'm doing?
> 
> Many thanks
> Sergio

Hey,

You can't just use Property('got_revision'), you need a context where asking 
for 'got_revision' actually makes sense.

You can call myobj.getProperty('got_revision') on any instance of classes 
which inherit from the IProperties interface. This can be for example a 
BuildStatus or BuildStep instance. See [1] for an extensive overview + 
examples.

Or just google for "getproperty got_revision" to get some example uses.

Greets

[1] http://docs.buildbot.net/current/manual/cfg-properties.html

-- 
Kevin Funk | kevin.funk at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the devel mailing list