[Buildbot-devel] compare_attrs in 0.8.12
Dustin J. Mitchell
dustin at v.igoro.us
Fri Jul 24 01:05:35 UTC 2015
Edmund, is that something you could work on? If I recall you did some of
the work on the renderable support for the same thing.
Dustin
On Wed, Jul 15, 2015 at 5:47 AM, Pierre Tardy <tardyp at gmail.com> wrote:
>
>
> Le mer. 15 juil. 2015 à 06:08, Edmund Wong <ewongbb at pw-wspx.org> a écrit :
>
>> Hi,
>>
>> Is compare_attrs supposed to be a list or a tuple? Right now,
>> there are instances where it's a tuple, and there are instances
>> where it's a list.
>>
>
> Hi,
> I think it should be iterable.
>
>>
>> Now things would be ok if there's no way to mix them; but,
>> I've encountered an issue with a project that I'm involved in
>> that has a generic function that creates schedulers based
>> on properties of the base_class.
>>
>> This generic function is run on different scheduler classes,
>> whose base class use different types of compare_attrs. Of
>> course, I can avoid that by checking what type the
>> base_class's compare_attrs is and then concatenate accordingly.
>>
>
> Indeed, this is a problem for class that does things like:
> compare_attrs = ClusteredService.compare_attrs + \
> ('builderNames', 'properties', 'codebases')
>
> So you want to create a class that can either derive from a list based
> compare_attrs class or a tuple based compare_attrs class?
>
> I think we should rather use the same technic as for renderable.
> Each class should declare the attributes they care about, and the
> ComparableMixin should gather and concatenate everything.
>
> from twisted.python.reflect import accumulateClassList
>
> accumulateClassList(self.__class__, 'renderables', renderables)
>
>
>> But wouldn't it be more consistent to use one single type?
>> Or did I miss the point of compare_attrs? (and that's possibly
>> the case here)
>>
>> Edmund
>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150723/244c3b42/attachment.html>
More information about the devel
mailing list