BUGFIX: FIx up strings in idler
authorMark Tearle <mtearle@ucc.asn.au>
Mon, 8 Dec 2014 15:55:24 +0000 (23:55 +0800)
committerMark Tearle <mtearle@ucc.asn.au>
Mon, 8 Dec 2014 15:55:24 +0000 (23:55 +0800)
VendServer/Idler.py

index 5b66455..3a8aced 100755 (executable)
@@ -283,7 +283,7 @@ class FortuneIdler(StringIdler):
                text = "I broke my wookie...."
                if os.access(fortune,os.F_OK|os.X_OK):
                        (lines, unused) = Popen((fortune,), close_fds=True, stdout=PIPE).communicate()
-                       text = string.join(lines)
+                       text = lines.replace('\n', '  ').replace('\r', '')
                StringIdler.__init__(self, v, text,repeat=False)
 
        def affinity(self):
@@ -294,7 +294,7 @@ class PipeIdler(StringIdler):
                text = "I ate my cookie...."
                if os.access(command,os.F_OK|os.X_OK):
                        (lines, unused) = Popen([command,] + args.split(), close_fds=True, stdout=PIPE).communicate()
-                       text = string.join(lines)
+                       text = lines.replace('\n', '  ').replace('\r', '')
                StringIdler.__init__(self, v, text,repeat=False)
 
        def affinity(self):

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