[Buildbot-devel] WithProperties question

Matthew Morse matt at apple.com
Wed May 25 19:46:03 UTC 2011


Hi,

I clearly don't understand something fundamental about WithProperties, but I haven't been able to find an answer in the doc. Here's the issue:

When I used WithProperties within the context of a build step or shell command, it does what I'd expect, for example:


-----------------------------------------------------------------------------------------------------------------

output_library_dir_buildstamp = WithProperties("%s-%d", "buildername", "buildnumber")


set_library_name = shell.ShellCommand(
         description = "Renaming library",
         descriptionDone=["Finished","renaming library"],
         command = ["mv", "library", output_library_dir_buildstamp],
         workdir = output_library_dir,
         haltOnFailure=True,
    )


---> I get an output name of the form "someBuilderName-num".
-----------------------------------------------------------------------------------------------------------------

But, if I want to take the value of 'output_library_dir_buildstamp' and concat some string (in this case, for the tar file name), I get an error:

output_library_dir_buildstamp = WithProperties("%s-%d", "buildername", "buildnumber")
tar_file_name = output_library_dir_buildstamp + ".tar"

--> TypeError: unsupported operand type(s) for +: 'instance' and 'str'


Why does the return value of WithProperties act like a string in the ShellCommand, but can't be used as such elsewhere? 

And, how do I convert it to a string for concatenation, etc. when it isn't used within a build step?

Thanks,
-- Matt





More information about the devel mailing list