[Buildbot-devel] More Property confusion
Alexander Sack
pisymbol at gmail.com
Sun Aug 5 15:43:33 UTC 2012
Hi Folks:
So I want to write a custom BuildStep that as an argument to its ctor
has a filename. This filename can be either a simple string or
hopefully a WithProperties instance to be interpolated by the time
start() runs.
e.g.
class FooFile(BuildStep):
def __init__(self, filename = filename, **kwargs):
BuildStep.__init__(self, **kwargs)
self.filename = filename
self.addFactoryArguments(filename = filename)
def start(self):
""" Do something with self.filename """
But self.filename is a WithProperties() instance. When start() funs,
self.filename is still a WithProperties instance, not the string (so
my open() fails).
How do use WithProperties() within a custom buildstep? I was groking
for a concrete example but so far haven't found any.
Do I really have to check the type, a la:
if isinstance(value, WithProperties):
self.build.getProperties().render(value)
Cheers,
-aps
More information about the devel
mailing list