[PEAK] Re: Trellis-fork

Sergey Schetinin maluke at gmail.com
Thu Jul 16 03:11:52 EDT 2009


Trellis-fork is now renamed to Reaction (still lives as trellis-fork
on google code hosting).

I hope to bring the ForkChanges page up to date next week (there were
tons of changes since it was last updated).

For now I just want to give a small example of how `has_listeners` can be used:

class Ticker(Component, AbstractCell):
    attrs(step=None, now=None)
    def __init__(self, step=1):
        self.now = Time[0]
        self.step = step

    @maintain
    def autotick(self):
        if has_listeners(self, 'now'):
            while self.now[self.step]:
                self.now = self.now[self.step]

    def get_value(self):
        return self.now




-- 
Best Regards,
Sergey Schetinin

http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter


More information about the PEAK mailing list