From: Mark Tearle Date: Sat, 13 Dec 2014 13:37:49 +0000 (+0800) Subject: BUGFIX: Make FortuneIdler work as intended X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=e2acb18c4bd108cc5385f6425c60fc01c4b3fc32;p=uccvend-vendserver.git BUGFIX: Make FortuneIdler work as intended --- diff --git a/VendServer/Idler.py b/VendServer/Idler.py index 4a32a2e..c2eedee 100755 --- a/VendServer/Idler.py +++ b/VendServer/Idler.py @@ -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): diff --git a/VendServer/VendServer.py b/VendServer/VendServer.py index 2759c6f..58622cf 100755 --- a/VendServer/VendServer.py +++ b/VendServer/VendServer.py @@ -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 = [ ]