one shot stuff done
authorMark Tearle <mtearle@ucc.gu.uwa.edu.au>
Wed, 29 Sep 2004 10:24:37 +0000 (10:24 +0000)
committerMark Tearle <mtearle@ucc.gu.uwa.edu.au>
Wed, 29 Sep 2004 10:24:37 +0000 (10:24 +0000)
sql-edition/servers/Idler.py
sql-edition/servers/MessageKeeper.py
sql-edition/servers/VendServer.py

index a231d96..392da6b 100755 (executable)
@@ -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
index c61ce35..60d2b9e 100755 (executable)
@@ -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:
index eda4dc9..d15165d 100755 (executable)
@@ -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="-"),

UCC git Repository :: git.ucc.asn.au