more explicit options when using ponytool

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2013-04-05 10:47:56 +02:00
parent f5e83d9eab
commit 8d3e4a03fd
3 changed files with 8 additions and 5 deletions

View file

@ -9,13 +9,14 @@
ttyponies() ttyponies()
{ {
defaultinparams="--left - --right - --top - --bottom -"
defaultoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y" defaultoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y"
for x in '' 'extra'; do for x in '' 'extra'; do
mkdir -p "${x}ttyponies" mkdir -p "${x}ttyponies"
for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do
echo "building ${x}ttypony: $pony" echo "building ${x}ttypony: $pony"
if [ ! -L "${x}ponies/$pony" ]; then 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 --export ponysay --platform linux --file "${x}ttyponies/$pony" $defaultoutparams
git add "${x}ttyponies/$pony" git add "${x}ttyponies/$pony"
else else
@ -29,6 +30,7 @@ ttyponies()
remaster() remaster()
{ {
inparams="--left - --right - --top - --bottom -"
xtermoutparams="--left - --right - --top - --bottom - --balloon n" xtermoutparams="--left - --right - --top - --bottom - --balloon n"
linuxoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y" linuxoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y"
for x in '' 'extra'; do 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 for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do
echo "remastering ${x}pony: $pony" echo "remastering ${x}pony: $pony"
if [ ! -L "${x}ponies/$pony" ]; then 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 --file "${x}ponies/$pony" $xtermoutparams \
--export ponysay --platform linux --file "${x}ttyponies/$pony" $linuxoutparams --export ponysay --platform linux --file "${x}ttyponies/$pony" $linuxoutparams
git add "${x}ponies/$pony" "${x}ttyponies/$pony" git add "${x}ponies/$pony" "${x}ttyponies/$pony"

View file

@ -151,8 +151,9 @@ class KMS():
os.makedirs(kmsponydir) os.makedirs(kmsponydir)
if shared: if shared:
Popen('chmod -R 7777 -- %s/kmsponies' % _cachedir, shell=True).wait() Popen('chmod -R 7777 -- %s/kmsponies' % _cachedir, shell=True).wait()
ponytoolcmd = 'ponytool --import ponysay --file %s --export ponysay --file %s --platform linux ' opts = '--balloon n --left - --right - --top - --bottom -'
ponytoolcmd += '--balloon n --colourful y --fullcolour y --left - --right - --top - --bottom - --palette %s' 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: if not os.system(ponytoolcmd % (_pony, _kmspony, palette)) == 0:
printerr('Unable to run ponytool successfully, you need util-say>=3 for KMS support') printerr('Unable to run ponytool successfully, you need util-say>=3 for KMS support')
exit(1) exit(1)

View file

@ -888,7 +888,7 @@ class Ponysay():
## Use PNG file as pony file ## Use PNG file as pony file
if endswith(pony.lower(), '.png'): if endswith(pony.lower(), '.png'):
pony = '\'' + pony.replace('\'', '\'\\\'\'') + '\'' 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 pngcmd %= (pony, ('linux' if self.linuxvt else 'xterm')) # XXX xterm should be haiku in Haiku
pngpipe = os.pipe() pngpipe = os.pipe()
Popen(pngcmd, stdout=os.fdopen(pngpipe[1], 'w'), shell=True).wait() Popen(pngcmd, stdout=os.fdopen(pngpipe[1], 'w'), shell=True).wait()