From e2acb18c4bd108cc5385f6425c60fc01c4b3fc32 Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Sat, 13 Dec 2014 21:37:49 +0800 Subject: [PATCH] BUGFIX: Make FortuneIdler work as intended --- VendServer/Idler.py | 5 ++++- VendServer/VendServer.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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 = [ ] -- 2.20.1