+
+idlers = []
+idler = None
+
+def setup_idlers(v):
+ global idlers, idler
+ idlers = [
+ GrayIdler(v),
+ StringIdler(v, text="Kill 'em all", repeat=False),
+ GrayIdler(v,one="*",zero="-"),
+ StringIdler(v, text=CREDITS),
+ GrayIdler(v,one="/",zero="\\"),
+ ClockIdler(v),
+ FileIdler(v, '/etc/passwd'),
+ GrayIdler(v,one="X",zero="O"),
+ FileIdler(v, '/usr/share/common-licenses/GPL-2'),
+ GrayIdler(v,one="*",zero="-",reorder=1),
+ StringIdler(v, text=str(math.pi) + " "),
+ ClockIdler(v),
+ GrayIdler(v,one="/",zero="\\",reorder=1),
+ StringIdler(v, text=str(math.e) + " "),
+ GrayIdler(v,one="X",zero="O",reorder=1),
+ StringIdler(v, text=" I want some pizza - please call Pizza Hut Shenton Park on +61 8 9381 9979 - and order as Quinn - I am getting really hungry", repeat=False),
+ PipeIdler(v, "/usr/bin/ypcat", "passwd"),
+ FortuneIdler(v),
+ ClockIdler(v),
+ StringIdler(v),
+ TrainIdler(v),
+ ]
+ disabled = [
+ ]
+ idler = choose_idler()
+
+def choose_idler():
+ global idler
+ iiindex = 0
+
+ if idler:
+ iiindex = idlers.index(idler)
+
+ iilen = len(idlers)
+
+ move = int(random()*len(idlers)) + 1
+
+ while move >= 0:
+ idler = idlers[( (iiindex + 1) % iilen)]
+ move = move - idler.affinity()
+
+ idler.reset()
+
+def idle_step():
+ global idler
+ if idler.finished():
+ choose_idler()
+ idler.next()