Commit 98eec455 by Michael DeHaan

Merge pull request #584 from gottwald/devel-cowsayUbuntu

Enabled cowsay support for Ubuntu
parents 87e911c4 26aa4e24
...@@ -78,8 +78,16 @@ class AggregateStats(object): ...@@ -78,8 +78,16 @@ class AggregateStats(object):
def banner(msg): def banner(msg):
res = "" res = ""
global COWSAY
if os.path.exists("/usr/bin/cowsay"): if os.path.exists("/usr/bin/cowsay"):
cmd = subprocess.Popen("/usr/bin/cowsay -W 60 \"%s\"" % msg, COWSAY = "/usr/bin/cowsay"
elif os.path.exists("/usr/games/cowsay"):
COWSAY = "/usr/games/cowsay"
else:
COWSAY = None
if COWSAY != None:
cmd = subprocess.Popen("%s -W 60 \"%s\"" % (COWSAY, msg),
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
(out, err) = cmd.communicate() (out, err) = cmd.communicate()
res = "%s\n" % out res = "%s\n" % out
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment