+class GreetingIdler(Idler):
+ def __init__(self, v, secs_to_greeting = None):
+ self.v = v
+ self.secs_to_greeting = secs_to_greeting
+ self.message_displayed = False
+
+ def next(self):
+ if not self.secs_to_greeting is None:
+ x = self.secs_to_greeting
+ self.secs_to_greeting = None
+ return x
+
+ self.v.display('UCC SNACKS')
+ self.message_displayed = True
+ return 5
+
+ def reset(self):
+ self.message_displayed = False
+ self.secs_to_greeting = None
+
+ def finished(self):
+ return self.message_displayed
+
+ def affinity(self):
+ return 0
+