From e98c4f3df5b2b7dd54a90902605c72bd41a53272 Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Wed, 29 Sep 2004 10:24:37 +0000 Subject: [PATCH] one shot stuff done --- sql-edition/servers/Idler.py | 9 ++++++--- sql-edition/servers/MessageKeeper.py | 4 ++-- sql-edition/servers/VendServer.py | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sql-edition/servers/Idler.py b/sql-edition/servers/Idler.py index a231d96..392da6b 100755 --- a/sql-edition/servers/Idler.py +++ b/sql-edition/servers/Idler.py @@ -186,12 +186,12 @@ class GrayIdler(Idler): class StringIdler(Idler): - def __init__(self, v, text="Hello Cruel World! "): + def __init__(self, v, text="Hello Cruel World! ",repeat=True): self.v = v self.mk = MessageKeeper(v) - self.text = self.clean_text(text) + self.text = self.clean_text(text) + " " - msg = [("",False, None),(self.text, True, 0.8)] + msg = [("",False, None),(self.text, repeat, 0.8)] self.mk.set_messages(msg) def clean_text(self, text): @@ -213,6 +213,9 @@ class StringIdler(Idler): def next(self): self.mk.update_display() + def finished(self): + return self.mk.done() + class ClockIdler(Idler): def __init__(self, v): self.v = v diff --git a/sql-edition/servers/MessageKeeper.py b/sql-edition/servers/MessageKeeper.py index c61ce35..60d2b9e 100755 --- a/sql-edition/servers/MessageKeeper.py +++ b/sql-edition/servers/MessageKeeper.py @@ -22,14 +22,14 @@ class MessageKeeper: self.scrolling_message = strings self.update_display(True) - def update_display(self, forced = False): + def update_display(self, forced = False, padding = 0): if not forced and self.next_update != None and time() < self.next_update: return if len(self.scrolling_message) > 0: if len(self.scrolling_message[0][0]) > 10: (m, r, t) = self.scrolling_message[0] a = [] - exp = HorizScroll(m).expand(padding = 0, wraparound = True) + exp = HorizScroll(m).expand(padding, wraparound = r) if t == None: t = 0.1 else: diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index eda4dc9..d15165d 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -190,10 +190,11 @@ def setup_idlers(v): global idlers, idler idlers = [ ClockIdler(v), - StringIdler(v), + StringIdler(v, text="Kill 'em all", repeat=False), StringIdler(v, text=CREDITS), StringIdler(v, text=str(math.pi) + " "), StringIdler(v, text=str(math.e) + " "), + StringIdler(v), GrayIdler(v), TrainIdler(v), GrayIdler(v,one="*",zero="-"), -- 2.20.1