From 8d3e4a03fd761bd95893908e3dfc0ff98a8dbebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Fri, 5 Apr 2013 10:47:56 +0200 Subject: [PATCH] more explicit options when using ponytool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- dev/dist.sh | 6 ++++-- src/kms.py | 5 +++-- src/ponysay.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dev/dist.sh b/dev/dist.sh index 97341b41..6f245750 100755 --- a/dev/dist.sh +++ b/dev/dist.sh @@ -9,13 +9,14 @@ ttyponies() { + defaultinparams="--left - --right - --top - --bottom -" defaultoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y" for x in '' 'extra'; do mkdir -p "${x}ttyponies" for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do echo "building ${x}ttypony: $pony" if [ ! -L "${x}ponies/$pony" ]; then - ponytool --import ponysay --file "${x}ponies/$pony" \ + ponytool --import ponysay --file "${x}ponies/$pony" $defaultinparams \ --export ponysay --platform linux --file "${x}ttyponies/$pony" $defaultoutparams git add "${x}ttyponies/$pony" else @@ -29,6 +30,7 @@ ttyponies() remaster() { + inparams="--left - --right - --top - --bottom -" xtermoutparams="--left - --right - --top - --bottom - --balloon n" linuxoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y" for x in '' 'extra'; do @@ -36,7 +38,7 @@ remaster() for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do echo "remastering ${x}pony: $pony" if [ ! -L "${x}ponies/$pony" ]; then - ponytool --import ponysay --file "${x}ponies/$pony" \ + ponytool --import ponysay --file "${x}ponies/$pony" $inparams \ --export ponysay --file "${x}ponies/$pony" $xtermoutparams \ --export ponysay --platform linux --file "${x}ttyponies/$pony" $linuxoutparams git add "${x}ponies/$pony" "${x}ttyponies/$pony" diff --git a/src/kms.py b/src/kms.py index 75809580..3f1debac 100755 --- a/src/kms.py +++ b/src/kms.py @@ -151,8 +151,9 @@ class KMS(): os.makedirs(kmsponydir) if shared: Popen('chmod -R 7777 -- %s/kmsponies' % _cachedir, shell=True).wait() - ponytoolcmd = 'ponytool --import ponysay --file %s --export ponysay --file %s --platform linux ' - ponytoolcmd += '--balloon n --colourful y --fullcolour y --left - --right - --top - --bottom - --palette %s' + opts = '--balloon n --left - --right - --top - --bottom -' + ponytoolcmd = 'ponytool --import ponysay --file %%s %s --export ponysay --file %%s --platform linux %s' % (opts, opts) + ponytoolcmd += ' --colourful y --fullcolour y --palette %s' if not os.system(ponytoolcmd % (_pony, _kmspony, palette)) == 0: printerr('Unable to run ponytool successfully, you need util-say>=3 for KMS support') exit(1) diff --git a/src/ponysay.py b/src/ponysay.py index ea3f0ee1..94eaefaf 100755 --- a/src/ponysay.py +++ b/src/ponysay.py @@ -888,7 +888,7 @@ class Ponysay(): ## Use PNG file as pony file if endswith(pony.lower(), '.png'): pony = '\'' + pony.replace('\'', '\'\\\'\'') + '\'' - pngcmd = 'ponytool --import image --file %s --export ponysay --platform %s --balloon y' + pngcmd = 'ponytool --import image --file %s --balloon n --export ponysay --platform %s --balloon y' pngcmd %= (pony, ('linux' if self.linuxvt else 'xterm')) # XXX xterm should be haiku in Haiku pngpipe = os.pipe() Popen(pngcmd, stdout=os.fdopen(pngpipe[1], 'w'), shell=True).wait()