#!/usr/bin/env python
-import string
+import string, time
from random import random
from MessageKeeper import MessageKeeper
def reset(self):
pass
+
+ def finished(self):
+ return False
class TrainIdler(Idler):
def __init__(self, v):
def next(self):
self.mk.update_display()
- def reset(self):
- pass
- #self.mk.update_display(forced=True)
+class ClockIdler(Idler):
+ def __init__(self, v):
+ self.v = v
+ self.last = None
+
+ def next(self):
+ output = time.strftime("%H:%M:%S")
+ if output != self.last:
+ self.v.display(" %8.8s " % (output))
+ self.last = output
from MessageKeeper import MessageKeeper
from HorizScroll import HorizScroll
from random import random, seed
-from Idler import TrainIdler,GrayIdler,StringIdler
+from Idler import TrainIdler,GrayIdler,StringIdler,ClockIdler
import socket
from posix import geteuid
def setup_idlers(v):
global idlers, idler
idlers = [
+ ClockIdler(v),
StringIdler(v),
StringIdler(v, text=CREDITS),
StringIdler(v, text=str(math.pi) + " "),
def idle_step():
global idler
+ if idler.finished():
+ choose_idler()
idler.next()
def run_forever(rfh, wfh, options, cf):