diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-07-02 11:42:56 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-07-02 11:42:56 +0200 |
commit | a56d0e10f298bf3d451b3f327e51a530331286fa (patch) | |
tree | 575defd469089dd8f615792167fcadec6190e7c7 /examples | |
parent | cleanup (diff) | |
download | xpybar-a56d0e10f298bf3d451b3f327e51a530331286fa.tar.gz xpybar-a56d0e10f298bf3d451b3f327e51a530331286fa.tar.bz2 xpybar-a56d0e10f298bf3d451b3f327e51a530331286fa.tar.xz |
moved Clocked into util.py
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/mixed | 13 |
1 files changed, 1 insertions, 12 deletions
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)) |