X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=sql-edition%2Fservers%2FIdler.py;h=89783e355b63e314dda2f6aeed9dfb8400c335ed;hb=7ec2b344515a34fdc38591e4c3f139cdd7103dc5;hp=5fe61cf02ea860809089429c5ec926fb8ae4dd99;hpb=60c8749199aed1381c4146a548250383ff9e7d4a;p=zanchey%2Fdispense2.git diff --git a/sql-edition/servers/Idler.py b/sql-edition/servers/Idler.py index 5fe61cf..89783e3 100755 --- a/sql-edition/servers/Idler.py +++ b/sql-edition/servers/Idler.py @@ -247,6 +247,19 @@ class FortuneIdler(StringIdler): def affinity(self): return 20 +class PipeIdler(StringIdler): + def __init__(self, v, command, args): + text = "I ate my cookie...." + if os.access(command,os.F_OK|os.X_OK): + (stdout, stdin) = popen2.popen2(command+' '+args) + text = string.join(stdout.readlines()) + stdout.close() + stdin.close() + StringIdler.__init__(self, v, text,repeat=False) + + def affinity(self): + return 20 + class FileIdler(StringIdler): def __init__(self, v, thefile=None, repeat=False): text = "I broke my wookie...."