Merge pull request #584 from gottwald/devel-cowsayUbuntu
Enabled cowsay support for Ubuntu
This commit is contained in:
commit
98eec45525
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue