[Buildbot-devel] best way to override the createSummary() function in different custom steps

shiny knight theshinyknight at me.com
Tue Feb 19 07:28:27 UTC 2013


Hi all

I wrote a sub class of ShellCommand, called "MyShell" and I wrote my own createSummary.

Now I realized that I have some steps that require more specific data, and that perform some other tasks, so I have 2 subclasses of this custom ShellCommand class, called "MySubShell1" and "MySubShell2". Each one has it's own createSummary, to handle the specific needs of that step.

Now from my understanding, when I call the createSummary in either MySubShell, it will override the one on the parent class. This means that createSummary in either MySubShell will override the function in MyShell.

Much of the code is very similar, so I was wondering which would be the correct way to handle this situation. 

I use all 3 classes in the same builder, but each one gotta return me a different set of information, so I cannot just use 1 createSummary on the parent class (unless I use a bunch of IF cases, to specify which case I am handing), and as is now, I have 3 classes with 3 createSummary, which share 70% of the same code, and seems to me a big waste of code.

Any suggestion about how to tackle the problem? Should I just leave it with the 3 createSummary() or there is a more efficient way?

Thanks in advance



More information about the devel mailing list