[PEAK] Trellis on_commit and Performers

Sergey Schetinin maluke at gmail.com
Mon Oct 6 04:10:18 EDT 2008


> Something is odd with them though. Following test prints "maintain" three times.
>
> class Test(trellis.Component):
>    @trellis.maintain
>    def value(self):
>        print 'maintain'
>
>    @value.connector
>    def _watch(self, sensor):
>       pass
>
>    @value.disconnector
>    def _unwatch(self, sensor, key):
>        pass
>
>
> t = Test()

Found a reason for this. In CellAttribute._hook_method it says:

        if func is not None:
            setattr(self, methodname, func)
            return self

Certainly it has to return func instead. Otherwise Test ends up with
three identical items in CellFactories for each of value, _watch and
_unwatch.



More information about the PEAK mailing list