From a56d0e10f298bf3d451b3f327e51a530331286fa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 2 Jul 2014 11:42:56 +0200 Subject: moved Clocked into util.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/mixed | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'examples') diff --git a/examples/mixed b/examples/mixed index 5770dc8..3211ad5 100644 --- a/examples/mixed +++ b/examples/mixed @@ -15,15 +15,6 @@ OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 0, True text = '' clock_ = Clock(format = '%Y-(%m)%b-%d %T, %a w%V, %Z', sync_to = 0.5) -class Clocked: - def __init__(self, *args): - self.sometimes = Sometimes(*args) - self.text = self.sometimes() - def __call__(self, update = False): - if update: - self.text = self.sometimes() - return self.text - functions = [ lambda : text , Clocked(clock_.read, 1) ] @@ -43,9 +34,7 @@ def start(): bar.invalidate() def update_per_clock(): - for f in functions: - if isinstance(f, Clocked): - f(True) + Clocked.update_all(functions) bar.invalidate() async(lambda : forever(read_stdin)) -- cgit v1.2.3-70-g09d2