orderings = None
+IDLER_TEXT_SPEED=1.8
+
class Idler:
def __init__(self, v):
self.v = v
def next(self):
+ """Displays next stage of the idler"""
pass
def reset(self):
+ """Resets the idler to a known intial state"""
pass
def finished(self):
+ """Returns True if the idler is considered finished"""
return False
def affinity(self):
+ """How much we want this idler to be the next one chosen"""
return 1
class TrainIdler(Idler):
self.mk = MessageKeeper(v)
self.text = self.clean_text(text) + " "
- msg = [("",False, None),(self.text, repeat, 0.8)]
+ msg = [("",False, None),(self.text, repeat, IDLER_TEXT_SPEED)]
self.mk.set_messages(msg)
def clean_text(self, text):
STATE_GRANDFATHER_CLOCK = 7
TEXT_SPEED = 0.8
+IDLE_SPEED = 0.02
class DispenseDatabaseException(Exception): pass
def scroll_options(username, mk, welcome = False):
if welcome:
msg = [(center('WELCOME'), False, TEXT_SPEED),
- (center(username), False, TEXT_SPEEd)]
+ (center(username), False, TEXT_SPEED)]
else:
msg = []
choices = ' '*10+'CHOICES: '
global idler
if idler.finished():
choose_idler()
+ sleep(IDLE_SPEED)
idler.next()
class VendState: