BUGFIX: Make FortuneIdler work as intended
authorMark Tearle <mtearle@ucc.asn.au>
Sat, 13 Dec 2014 13:37:49 +0000 (21:37 +0800)
committerMark Tearle <mtearle@ucc.asn.au>
Sat, 13 Dec 2014 13:37:49 +0000 (21:37 +0800)
VendServer/Idler.py
VendServer/VendServer.py

index 4a32a2e..c2eedee 100755 (executable)
@@ -236,7 +236,7 @@ class StringIdler(Idler):
        def __init__(self, v, text="Hello Cruel World!  ",repeat=True, affinity=None):
                Idler.__init__(self, v, affinity=affinity)
                self.mk = MessageKeeper(v)
-               self.text = self.clean_text(text) + "          "
+               self.text = "         " + self.clean_text(text) + "          "
                
                msg = [("",False, None),(self.text, repeat, IDLER_TEXT_SPEED)]
                self.mk.set_messages(msg)
@@ -286,6 +286,9 @@ class FortuneIdler(StringIdler):
                        text = lines.replace('\n', '  ').replace('\r', '')
                StringIdler.__init__(self, v, text,repeat=False, affinity=affinity)
 
+       def reset(self):
+               self.__init__(self.v, affinity=self._affinity)
+
 
 class PipeIdler(StringIdler):
        def __init__(self, v, command, args, affinity = 5):
index 2759c6f..58622cf 100755 (executable)
@@ -279,7 +279,7 @@ def setup_idlers(v):
                FileIdler(v, '/usr/share/common-licenses/GPL-2',affinity=2),
                #
                PipeIdler(v, "/usr/bin/getent", "passwd"),
-               FortuneIdler(v),
+               FortuneIdler(v,affinity=20),
                ]
        disabled = [
                ]

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