Fix the code to connect to the virtual vend thing again
[uccvend-vendserver.git] / sql-edition / servers / Idler.py
index fc7573a..5fe61cf 100755 (executable)
@@ -230,6 +230,9 @@ class ClockIdler(Idler):
                        self.v.display(" %8.8s " % (output))
                        self.last = output
 
+       def affinity(self):
+               return 3 
+
 class FortuneIdler(StringIdler):
        def __init__(self, v):
                fortune = "/usr/games/fortune"
@@ -242,4 +245,17 @@ class FortuneIdler(StringIdler):
                StringIdler.__init__(self, v, text,repeat=False)
 
        def affinity(self):
-               return 15
+               return 20
+
+class FileIdler(StringIdler):
+       def __init__(self, v, thefile=None, repeat=False):
+               text = "I broke my wookie...."
+
+               if file and os.access(thefile,os.F_OK|os.R_OK):
+                       f = file(thefile,'r')
+                       text = string.join(f.readlines())
+                       f.close()
+               StringIdler.__init__(self, v, text,repeat=repeat)
+
+       def affinity(self):
+               return 8 

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