diff options
author | Pablo Lezaeta <prflr88@gmail.com> | 2012-08-22 18:10:28 -0400 |
---|---|---|
committer | Pablo Lezaeta <prflr88@gmail.com> | 2012-08-22 18:10:28 -0400 |
commit | d67b95bfbbd77a2261b7dbb05e7a69ea335d5be2 (patch) | |
tree | 9c3e16b4ebd7b013b78dd72d7603dbb5b03be70f | |
parent | ab9a3292a8b6ff40c3d1eded40bae2a29d9b42db (diff) | |
parent | 4fcd0b284ff296b41e08056c2dbf35de614e0320 (diff) | |
download | ponysay-d67b95bfbbd77a2261b7dbb05e7a69ea335d5be2.tar.gz ponysay-d67b95bfbbd77a2261b7dbb05e7a69ea335d5be2.tar.bz2 ponysay-d67b95bfbbd77a2261b7dbb05e7a69ea335d5be2.zip |
Added mising version info to texinfo
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | balloons/ascii.say | 30 | ||||
-rw-r--r-- | balloons/ascii.think | 30 | ||||
-rw-r--r-- | balloons/cowsay.say | 25 | ||||
-rw-r--r-- | balloons/cowsay.think | 25 | ||||
-rw-r--r-- | balloons/linux-vt.say | 35 | ||||
-rw-r--r-- | balloons/round.say | 35 | ||||
-rw-r--r-- | balloons/unicode.say | 35 | ||||
-rw-r--r-- | balloons/unicode.think | 25 | ||||
-rw-r--r-- | completion/bash-completion.sh | 12 | ||||
-rw-r--r-- | completion/fish-completion.fish | 24 | ||||
-rw-r--r-- | completion/zsh-completion.zsh | 11 | ||||
-rwxr-xr-x | configure | 43 | ||||
-rw-r--r-- | extraponies/info | 3 | ||||
-rw-r--r-- | extrattyponies/info | 3 | ||||
-rw-r--r-- | manuals/manpage.6 | 10 | ||||
-rw-r--r-- | manuals/manpage.es.6 | 11 | ||||
-rw-r--r-- | manuals/ponysay.texinfo | 1060 | ||||
-rw-r--r-- | manuals/ponysay_front.xcf | bin | 1007534 -> 998210 bytes | |||
l--------- | ponies/pinkieoink.pony | 1 | ||||
-rw-r--r-- | ponyquotes/ponies | 2 | ||||
-rwxr-xr-x | ponysay | 711 | ||||
-rw-r--r-- | ponysay.pdf | bin | 333828 -> 361698 bytes | |||
-rw-r--r-- | share/ucsmap | 5 | ||||
l--------- | ttyponies/pinkieoink.pony | 1 |
25 files changed, 1643 insertions, 501 deletions
@@ -98,7 +98,7 @@ FAQ __Q:__ The output looks like a mess in _(TTY/PuTTY/other)_! -__A:__ Unfortunately, there's nothing much we can do about it. See [issue 1](/erkin/ponysay/issues/1). +__A:__ Unfortunately we cannot make it perfect, see [issue 1](/erkin/ponysay/issues/1). But we have done a lot, read more about how to get the best the current state of the art has to offer in the [manual](/erkin/ponysay/blob/master/ponysay.pdf?raw=true). __Q:__ You are missing _(my-favourite-pony)_! @@ -106,5 +106,6 @@ __A:__ [Ask](/erkin/ponysay/issues) and we'll add! __Q:__ Which programs do you use to generate the pony files? -__A:__ The pony files are actually mostly a bunch of selected [browser ponies](http://web.student.tuwien.ac.at/~e0427417/browser-ponies/ponies.html) -that are generated into cow files via [img2xterm](/rossy2401/img2xterm) or [util-say](/maandree/util-say). +__A:__ The pony files are actually mostly a bunch of selected [browser ponies](//web.student.tuwien.ac.at/~e0427417/browser-ponies/ponies.html), converted using [util-say](/maandree/util-say). + +The [PDF manual](/erkin/ponysay/blob/master/ponysay.pdf?raw=true) should answer most of your questions. diff --git a/balloons/ascii.say b/balloons/ascii.say new file mode 100644 index 0000000..1a9d014 --- /dev/null +++ b/balloons/ascii.say @@ -0,0 +1,30 @@ +/:/ +\:\ + +n:_ +: +s:_ +w:| +e: | + +ww:| +ee: | + +nw: +:/ +ne: +:\ +sw:\ +se:/ + +nnw:_ +: +nne:_ +: +ssw:_ +sse:_ + +nww:| +nee: | +sww:| +see: | diff --git a/balloons/ascii.think b/balloons/ascii.think new file mode 100644 index 0000000..56591d2 --- /dev/null +++ b/balloons/ascii.think @@ -0,0 +1,30 @@ +/:o +\:o + +n:_ +: +s:_ +w:( +e: ) + +ww:( +ee: ) + +nw: +:( +ne: +:) +sw:( +se:) + +nnw:_ +: +nne:_ +: +ssw:_ +sse:_ + +nww:( +nee: ) +sww:( +see: ) diff --git a/balloons/cowsay.say b/balloons/cowsay.say new file mode 100644 index 0000000..bb486db --- /dev/null +++ b/balloons/cowsay.say @@ -0,0 +1,25 @@ +/:/ +\:\ + +n:_ +s:- +w:| +e: | + +ww:< +ee: > + +nw: _ +ne:_ +sw: - +se:- + +nnw:_ +nne:_ +ssw:- +sse:- + +nww:/ +nee: \ +sww:\ +see: / diff --git a/balloons/cowsay.think b/balloons/cowsay.think new file mode 100644 index 0000000..1450bc7 --- /dev/null +++ b/balloons/cowsay.think @@ -0,0 +1,25 @@ +/:o +\:o + +n:_ +s:- +w:( +e: ) + +ww:( +ee: ) + +nw: _ +ne:_ +sw: - +se:- + +nnw:_ +nne:_ +ssw:- +sse:- + +nww:( +nee: ) +sww:( +see: ) diff --git a/balloons/linux-vt.say b/balloons/linux-vt.say new file mode 100644 index 0000000..69a14ae --- /dev/null +++ b/balloons/linux-vt.say @@ -0,0 +1,35 @@ +/:/ +\:\ + +n:─ +: +s: +:─ +w:│ +e: │ + +ww:│ +ee: │ + +nw:┌ +:│ +ne:┐ +:│ +sw:│ +:└ +se:│ +:┘ + +nnw:─ +: +nne:─ +: +ssw: +:─ +sse: +:─ + +nww:│ +nee: │ +sww:│ +see: │ diff --git a/balloons/round.say b/balloons/round.say new file mode 100644 index 0000000..01ef456 --- /dev/null +++ b/balloons/round.say @@ -0,0 +1,35 @@ +/:╱ +\:╲ + +n:─ +: +s: +:─ +w:│ +e: │ + +ww:│ +ee: │ + +nw:╭ +:│ +ne:╮ +:│ +sw:│ +:╰ +se:│ +:╯ + +nnw:─ +: +nne:─ +: +ssw: +:─ +sse: +:─ + +nww:│ +nee: │ +sww:│ +see: │ diff --git a/balloons/unicode.say b/balloons/unicode.say new file mode 100644 index 0000000..a67a7f8 --- /dev/null +++ b/balloons/unicode.say @@ -0,0 +1,35 @@ +/:╱ +\:╲ + +n:─ +: +s: +:─ +w:│ +e: │ + +ww:│ +ee: │ + +nw:┌ +:│ +ne:┐ +:│ +sw:│ +:└ +se:│ +:┘ + +nnw:─ +: +nne:─ +: +ssw: +:─ +sse: +:─ + +nww:│ +nee: │ +sww:│ +see: │ diff --git a/balloons/unicode.think b/balloons/unicode.think new file mode 100644 index 0000000..005e545 --- /dev/null +++ b/balloons/unicode.think @@ -0,0 +1,25 @@ +/:o +\:o + +n:⁀ +s:‿ +w:( +e: ) + +ww:( +ee: ) + +nw:( +ne:) +sw:( +se:) + +nnw:⁀ +nne:⁀ +ssw:‿ +sse:‿ + +nww:( +nee: ) +sww:( +see: ) diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index d790786..62e1d40 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -5,17 +5,25 @@ _ponysay() local cur prev words cword _init_completion -n = || return - options='--version --help --list --altlist --pony --wrap --quote' + options='--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon --file ++file ++pony ++list ++altlist' COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - if [ $prev = "-f" ] || [ $prev = "--pony" ]; then + if [ $prev = "-f" ] || [ $prev = "--pony" ] || [ $prev = "--file" ]; then ponies=$('/usr/bin/ponysay' --onelist) COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) ) + elif [ $prev = "-F" ] || [ $prev = "++pony" ] || [ $prev = "++file" ]; then + extraponies=$('/usr/bin/ponysay' ++onelist) + COMPREPLY=( $( compgen -W "$extraponies" -- "$cur" ) ) + elif [ $prev = "-q" ] || [ $prev = "--quote" ]; then quoters=$('/usr/bin/ponysay' --quoters) COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) ) + elif [ $prev = "-b" ] || [ $prev = "--balloon" ]; then + balloons=$('/usr/bin/ponysay' --balloonlist) + COMPREPLY=( $( compgen -W "$balloons" -- "$cur" ) ) + elif [ $prev = "-W" ] || [ $prev = "--wrap" ]; then cols=$(( `stty size | cut -d ' ' -f 2` - 10 )) COMPREPLY=( $cols $(( $cols / 2 )) 100 60 ) diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index 9233c67..c29fff2 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -4,18 +4,26 @@ # Author: Elis Axelsson <etu AT elis DOT nu> set -g ponies ('/usr/bin/ponysay' --onelist) +set -g xponies ('/usr/bin/ponysay' ++onelist) set -g quoters ('/usr/bin/ponysay' --quoters) +set -g balloons ('/usr/bin/ponysay' --balloonlist) -complete --command ponysay --short-option h --long-option help --description 'help of ponysay' -complete --command ponysay --short-option v --long-option version --description 'version of ponysay' -complete --command ponysay --short-option l --long-option list --description 'list pony files' -complete --command ponysay --short-option L --long-option altlist --description 'list pony files with alternatives' -complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' -complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --no-files --description 'pony' -complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' +## TODO: update with options [see info manual]: +l +L ++list ++altlist ++file --file ++pony +complete --command ponysay --short-option h --long-option help --description 'help of ponysay' +complete --command ponysay --short-option v --long-option version --description 'version of ponysay' +complete --command ponysay --short-option l --long-option list --description 'list pony names' +complete --command ponysay --short-option L --long-option altlist --description 'list pony names with alternatives' +complete --command ponysay --short-option B --long-option balloonlist --description 'list balloon style names' +complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' +complete --command ponysay --short-option F --arguments "$xponies" --description 'extra pony' +complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --description 'pony' +complete --command ponysay --short-option b --long-option balloon --arguments "$balloons" --description 'balloon style' +complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' complete --command ponysay --arguments 'MESSAGE' + set -e ponies +set -e xponies set -e quoters - +set -e balloons diff --git a/completion/zsh-completion.zsh b/completion/zsh-completion.zsh index 2124380..9d417ec 100644 --- a/completion/zsh-completion.zsh +++ b/completion/zsh-completion.zsh @@ -2,10 +2,15 @@ _shortopts=( '-v[Show version and exit]' '-h[Show this help and exit]' - '-l[list ponyfiles]' - '-L[list ponyfiles with alternatives]' - '-f[Select a pony (either a filename or a ponyname]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' + '-l[list pony names]' + '-L[list pony names with alternatives]' + '+l[list extra pony names]' + '+L[list extra pony names with alternatives]' + '-B[list balloon style names]' + '-f[Select a pony (either a file name or a pony name)]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' + '-F[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extraponies' -g "*(\:r)"' '-q[Select ponies for MLP:FiM quotes]' + '-b[Selecy a balloon style]' '-W[The screen column where the message should be wrapped]' ) _arguments -s : \ @@ -6,7 +6,7 @@ INFODESC=\''My Little Ponies for your terminal'\' SHELL='bash' completions='completion/bash-completion.sh completion/fish-completion.fish completion/zsh-completion.zsh' -shareDirs='ponies ttyponies quotes' +shareDirs='ponies ttyponies quotes balloons extraponies extrattyponies' manFiles='manuals/manpage.6 manuals/manpage.es.6' licenseFiles='COPYING' @@ -17,7 +17,7 @@ oldInstalledDirs='lib/ponysay share/ponies share/ttyponies bin/ponysaylist.pl' oldCompiledFiles='truncater ponysaytruncater ponysay.py.install' oldCompiledDirs='' -installedFiles='bin/ponysay bin/ponythink doc/ponysay.pdf share/info/ponysay.info.gz share/info/ponythink.info.gz' +installedFiles='bin/ponysay bin/ponythink doc/ponysay.pdf share/info/ponysay.info.gz share/info/ponythink.info.gz share/ponysay/ucsmap' installedDirs='share/ponysay lib/ponysay' compiledFiles='ponysay.info ponysay.info.gz ponysay.install ponysay.install~' compiledDirs='quotes' @@ -224,13 +224,16 @@ function makeMakefile() echo -en '\t' ; echo 'mkdir -p "$(INSTALLDIR)/share/ponysay/"' for dir in $shareDirs; do echo -en '\t' ; echo 'mkdir -p "$(INSTALLDIR)/share/ponysay/'"$dir"'"' - echo -en '\t' ; echo 'cp -P "'"$dir"'/"*.* "$(INSTALLDIR)/share/ponysay/'"$dir"'/"' + echo -en '\t' ; echo 'cp -P "'"$dir"'/"* "$(INSTALLDIR)/share/ponysay/'"$dir"'/"' done echo echo -en '\t' ; echo 'mkdir -p "$(INSTALLDIR)/bin/"' echo -en '\t' ; echo 'install "ponysay.install" "$(INSTALLDIR)/bin/ponysay"' echo -en '\t' ; echo 'ln -sf "ponysay" "$(INSTALLDIR)/bin/ponythink"' echo + echo -en '\t' ; echo 'mkdir -p "$(INSTALLDIR)/share/ponysay/"' + echo -en '\t' ; echo 'install "share/ucsmap" "$(INSTALLDIR)/share/ponysay/ucsmap"' + echo echo -en '\t' ; echo 'mkdir -p "$(INSTALLDIR)/share/licenses/ponysay/"' for file in $licenseFiles; do echo -en '\t' @@ -239,7 +242,6 @@ function makeMakefile() echo echo 'install-cache:' - echo -en '\t' ; echo 'if [ -d "/var/cache/ponysay" ]; then rm -r "/var/cache/ponysay"; fi' echo -en '\t' ; echo 'mkdir -p "$(DESTDIR)/var/cache/ponysay/"' echo -en '\t' ; echo 'chmod 777 "$(DESTDIR)/var/cache/ponysay/"' echo @@ -358,15 +360,30 @@ EOF ttyponies: mkdir -p "ttyponies" - for pony in \$\$(ls --color=no "ponies/"); do \\ - echo "building ttypony: \$\$pony" ;\\ - if [ "\`readlink "ponies/\$\$pony"\`" = '' ]; then \\ - ponysay2ttyponysay < "ponies/\$\$pony" | tty2colourfultty -c 1 > "ttyponies/\$\$pony" ;\\ - git add "ttyponies/\$\$pony" ;\\ - else \\ - ln -sf \`readlink "ponies/\$\$pony"\` "ttyponies/\$\$pony" ;\\ - git add "ttyponies/\$\$pony" ;\\ - fi ;\\ + for pony in \$\$(ls --color=no "ponies/"); do \\ + if [ 1 "\$\$pony" = '.info' ]; then \\ + echo "building ttypony: \$\$pony" ;\\ + if [ "\`readlink "ponies/\$\$pony"\`" = '' ]; then \\ + ponysay2ttyponysay < "ponies/\$\$pony" | tty2colourfultty -c 1 > "ttyponies/\$\$pony" ;\\ + git add "ttyponies/\$\$pony" ;\\ + else \\ + ln -sf \`readlink "ponies/\$\$pony"\` "ttyponies/\$\$pony" ;\\ + git add "ttyponies/\$\$pony" ;\\ + fi ;\\ + fi ;\\ + done + mkdir -p "extrattyponies" + for pony in \$\$(ls --color=no "extraponies/"); do \\ + if [ 1 "\$\$pony" = '.info' ]; then \\ + echo "building extrattypony: \$\$pony" ;\\ + if [ "\`readlink "extraponies/\$\$pony"\`" = '' ]; then \\ + ponysay2ttyponysay < "extraponies/\$\$pony" | tty2colourfultty -c 1 > "extrattyponies/\$\$pony" ;\\ + git add "extrattyponies/\$\$pony" ;\\ + else \\ + ln -sf \`readlink "extraponies/\$\$pony"\` "extrattyponies/\$\$pony" ;\\ + git add "extrattyponies/\$\$pony" ;\\ + fi ;\\ + fi ;\\ done pdfmanual: diff --git a/extraponies/info b/extraponies/info new file mode 100644 index 0000000..12d5bea --- /dev/null +++ b/extraponies/info @@ -0,0 +1,3 @@ +Dummy file for this directory as it is otherwise empty. + +Non-MLP:FiM ponies should be placed here. diff --git a/extrattyponies/info b/extrattyponies/info new file mode 100644 index 0000000..333e827 --- /dev/null +++ b/extrattyponies/info @@ -0,0 +1,3 @@ +Dummy file for this directory as it is otherwise empty. + +Non-MLP:FiM ttyponies should be placed here. diff --git a/manuals/manpage.6 b/manuals/manpage.6 index 4d1f121..f623b97 100644 --- a/manuals/manpage.6 +++ b/manuals/manpage.6 @@ -58,10 +58,20 @@ List pony files. .B \-L List pony files with alternative names inside brackets. .TP +.B \+l +List non-MLP:FiM pony files. +.TP +.B \+L +List non-MLP:FiM pony files with alternative names inside brackets. +.TP .B \-f \fIname\fP Select a pony (either a file name or a pony name), you can use this options multiple times, and one of the will be selected randomly. .TP +.B \-F \fIname\fP +Select a non-MLP:FiM pony (either a file name or a pony name), you can use this options +multiple times, and one of the will be selected randomly. +.TP .B \-q [\fIname\fP...] By using this option, a pony will be printed with quotes from her in My Little Pony: Friendship is Magic. The pony will be selected randomly, unless at least one pony diff --git a/manuals/manpage.es.6 b/manuals/manpage.es.6 index 3a13193..221a59c 100644 --- a/manuals/manpage.es.6 +++ b/manuals/manpage.es.6 @@ -58,8 +58,17 @@ Lista los ponis disponibles. .B \-L Lista los ponis con nombres alternativos dentro de paréntesis. .TP +.B \+l +Lista los ponis no MLP:FiM disponibles. +.TP +.B \+L +Lista los ponis no MLP:FiM con nombres alternativos dentro de paréntesis. +.TP .B \-f \fInombre\fP -selecciona un poni específico (ya sea un archivo o el nombre directamente), puedes usar esta opción con múltiples ponis y de estos será elejído uno al azar. +Selecciona un poni específico (ya sea un archivo o el nombre directamente), puedes usar esta opción con múltiples ponis y de estos será elejído uno al azar. +.TP +.B \-F \fInombre\fP +Selecciona un poni no MLP:FiM específico (ya sea un archivo o el nombre directamente), puedes usar esta opción con múltiples ponis y de estos será elejído uno al azar. .TP .B \-q [\fInombre\fP...] Usando esta opción un poni será mostrado dando una cita de My Little Pony: Frienship is magic diff --git a/manuals/ponysay.texinfo b/manuals/ponysay.texinfo index df81298..a17ccd2 100644 --- a/manuals/ponysay.texinfo +++ b/manuals/ponysay.texinfo @@ -8,7 +8,7 @@ @documentlanguage en @finalout @c %**end of header -@set VERSION 2.1.1 +@set VERSION 2.3 @copying This manual is for ponysay @@ -34,7 +34,7 @@ Texts. A copy of the license is included in the section entitled @titlepage @title Ponysay -@subtitle A cowsay wrapper for ponies. +@subtitle Infesting your terminal with ponies. @subtitle Covers ponysay version @value{VERSION}. @c ** start of front page image ** @c If print make a pdf or hard copy with the front cover @@ -46,6 +46,9 @@ Texts. A copy of the license is included in the section entitled @page @vskip 0pt plus 1filll @insertcopying +@page +@*@* +@center{`For me! For my friends! @b{For EQUESTRIA!}'} @end titlepage @contents @@ -55,14 +58,15 @@ Texts. A copy of the license is included in the section entitled * Overview:: Brief overview of @command{ponysay}. * Invoking ponysay:: How to run @command{ponysay}. * Advanced usage:: Advanced usage of @command{ponysay}. -* Environment variables:: Environment variables. -* Limitations:: Limitations. -* Problems and requests:: Reports and requests. -* Dependencies:: Dependencies. -* Installing:: Installing. +* Environment variables:: Getting more from @command{ponysay} with environment variables. +* Limitations:: Known limitations that may not be that easy to overcome. +* Problems and requests:: Report issues and making requests. +* Dependencies:: Ponysay's Dependencies. +* Installing:: How to install @command{ponysay}. * Extensions:: Extensions. -* Inner workings:: Inner workings. -* Contributing:: Contributing. +* Inner workings:: Useful information for those whom want to help hack @command{ponysay}. +* Contributing:: Useful information for those whom want to help improve the world. +* Distributing:: Useful information for OS package repository package maintainers. * Change log:: Differences between the version of @command{ponysay}. * Ponysay contributors:: Ponysay contributors. * Ponysay license:: Ponysay license. @@ -77,18 +81,19 @@ Texts. A copy of the license is included in the section entitled @chapter Overview @cindex overview -@command{ponysay} displays an image of a My Little Pony pony saying some text provided -by the user in a terminal, or a quote from the series. It is was wrapper for -@command{cowsay}, but since version 2.1 it reimplementation @command{cowsay}. If message -is not provided, e.g. by piping, it accepts standard input. The pony saying the given -message is printed on standard output. +@command{ponysay} displays an image of a My Little Pony pony saying some text +provided by the user in a terminal, or a quote from the series. It is was wrapper for +@command{cowsay}, but since version 2.1 it reimplementation @command{cowsay}. +If message is not provided, e.g. by piping, it accepts standard input. The pony +saying the given message is printed on standard output. -@command{ponythink} is to @command{ponysay} as @command{cowthink} is to @command{cowsay}. +@command{ponythink} is to @command{ponysay} as @command{cowthink} is to +@command{cowsay}. @command{ponysay} is generally used to decorate your terminal with a random pony, when you start the terminal. But if you known anypony how does like ponies [fat chance] you -can always make screen-shots of @command{ponysay -q} runs and communication that way over -e-mail. +can always make screen-shots of @command{ponysay -q} runs and communication that way +over e-mail. @@ -103,96 +108,158 @@ e-mail. The format for running the @command{ponysay} program is: @example -ponysay [@var{option}@dots{}] [--] [@var{message}] -ponythink [@var{option}@dots{}] [--] [@var{message}] +ponysay [@var{option}...] [--] [@var{message}] +ponythink [@var{option}...y] [--] [@var{message}] @end example -Running @command{ponysay} will print a speech balloon, -@command{ponythink} will print a thought balloon. -Otherwise @command{ponysay} and @command{ponythink} is the same thing. +Running @command{ponysay} will print a speech balloon, @command{ponythink} will +print a thought balloon. Otherwise @command{ponysay} and @command{ponythink} is +the same thing. @command{ponysay} supports the following options: @table @option @item -- -@cindex @command{--} +@cindex @option{--} Parse the following arguments as parts of @code{@var{message}}. @item -h @itemx --help -@cindex @command{-h} -@cindex @command{--help} +@cindex @option{-h} +@cindex @option{--help} Show summary of options. @item -v -@item --verion -@cindex @command{-v} -@cindex @command{--version} +@itemx --verion +@cindex @option{-v} +@cindex @option{--version} Show version of program. @item -f PONY +@itemx --file PONY @itemx --pony PONY -@cindex @command{-f} -@cindex @command{--pony} +@cindex @option{-f} +@cindex @option{--file} +@cindex @option{--pony} Specify the pony that should printed, this can either be a file name or a pony name printed by @command{ponysay -l}. This option can be used multiple times to specify a set of ponies from which one will be selected randomly. If no pony is specified one will be selected randomly. @cindex @command{util-say} -If you have @command{util-say} installed, you can use .png-files as the -arguments for this options. - -In versions earlier than version 2.0, the if the pony were a file name it had -to include a `@code{/}'. This is not longer required and any existing file -supersedes pony names. +@cindex .png +@cindex png images +@cindex images, png +@cindex portable network graphics +If you have @command{util-say} installed, you can use .png-files as the arguments +for this options. + +In versions earlier than version 2.0, the if the pony were a file name it had to +include a `@code{/}'. This is not longer required and any existing pony name +supersedes file names. + +@item -F +@itemx ++file PONY +@itemx ++pony PONY +@cindex @option{-F} +@cindex @option{++file} +@cindex @option{++pony} +Just as @option{-F}, but it uses extra (non-MLP:FiM) ponies instead of standard +(MLP:FiM) ponies + +@item -b STYLE +@itemx --bubble STYLE +@itemx --balloon STYLE +@cindex @option{-b} +@cindex @option{--bubble} +@cindex @option{--balloon} +Specify the balloon style that should used, this can either be a file name or a +balloon name printed by @option{ponysay -B}. This option can be used multiple +times to specify a set of styles from which one will be selected randomly. If no +balloon style is specified a fallback style will be used. @item -q [PONY...] @itemx --quote [PONY...] -@cindex @command{-q} -@cindex @command{--quote} +@cindex @option{-q} +@cindex @option{--quote} By using this option, a pony will be printed with quotes from her in My Little Pony: Friendship is Magic. The pony will be selected randomly, unless at least one pony -is added as an argument after @command{-q}. If one or more ponies are added after -@command{-q}, the pony will be selected randomly from that set of ponies. -This option requires the extension @command{ponyquotes4ponysay}, which -is included by default since version 1.2. +is added as an argument after @option{-q}. If one or more ponies are added after +@option{-q}, the pony will be selected randomly from that set of ponies. +This option requires the extension @command{ponyquotes4ponysay}, which is included +by default since version 1.2. + +The argument can be a file name, but pony if it ends with @file{.pony}. @item -W COLUMN @itemx --wrap COLUMN -@cindex @command{-W} -@cindex @command{--wrap} +@cindex @option{-W} +@cindex @option{--wrap} Specify the screen column where the message should be wrapped, this is by default 40, which is inherited from @command{cowsay}. +@item -c +@itemx --compress +@cindex @option{-c} +@cindex @option{--compress} +@cindex figlet +@cindex toilet +Compress the message in the same way @command{cowsay} does, that is basically +without multiple spaces, one only paragraphs seperations. Using this options +will mean that you cannot display @command{filet} and @command{TOIlet} style +messages. + @item -l @itemx --list -@cindex @command{-l} -@cindex @command{--list} -Lists all installed ponies. If the extension @command{ponyquotes4ponysay} -is installed the ponies which have quotes, i.e. can be used with the -@command{-q} option, will be mark by being printed in bold or bright -(depending on the terminal.) +@cindex @option{-l} +@cindex @option{--list} +Lists all installed ponies. If the extension @command{ponyquotes4ponysay} is +installed the ponies which have quotes, i.e. can be used with the @option{-q} +option, will be mark by being printed in bold or bright (depending on the terminal.) @item -L -@itemx --linklist -@cindex @command{-L} -@cindex @command{--altlist} +@itemx --altlist +@cindex @option{-L} +@cindex @option{--altlist} Lists all installed ponies. If the extension @command{ponyquotes4ponysay} -is installed the ponies which have quotes, i.e. can be used with the -@command{-q} option, will be mark by being printed in bold or bright -(depending on the terminal.) This options differs from @command{-l} by -printing alternative names (symbolic links) inside brackets after their -target ponies. +is installed the ponies which have quotes, i.e. can be used with the @option{-q} +option, will be mark by being printed in bold or bright (depending on the terminal.) +This options differs from @option{-l} by printing alternative names (symbolic links) +inside brackets after their target ponies. + +@item +l +@itemx ++list +@cindex @option{+l} +@cindex @option{++list} +Just as @option{-l}, but it lists extra (non-MLP:FiM) ponies instead of standard +(MLP:FiM) ponies + +@item +L +@itemx ++altlist +@cindex @option{+L} +@cindex @option{++altlist} +Just as @option{-L}, but it lists extra (non-MLP:FiM) ponies instead of standard +(MLP:FiM) ponies + +@item -B +@itemx --balloonlist +@cindex @option{-B} +@cindex @option{--balloonlist} +Prints a list of all balloon styles. @end table -If neither @command{-q} is used nor any @var{message} is specified, @command{ponysay} -will read the message from stdin (standard input); however, if no arguments -are used that nothing is piped to stdin, a help message will be printed. -If you want to use @command{ponysay} without arguments and enter the message -by hand, you can run @code{cat | ponysay}. +@cindex @var{message} +If neither @option{-q} is used nor any @var{message} is specified, @command{ponysay} +will read the message from stdin (standard input); however, if no arguments are used +that nothing is piped to stdin, a help message will be printed. If you want to use +@command{ponysay} without arguments and enter the message by hand, you can run +@code{cat | ponysay}. +@cindex file{best.pony} +If no pony is selected, @command{ponysay} will look for a @file{best.pony} file, +this should be a symbolic link to the pony you want as a default. If it is not a +symbolic link, @option{-q} cannot determine which quotes to use. @node Advanced usage @@ -212,17 +279,16 @@ by hand, you can run @code{cat | ponysay}. @cindex fortune @cindex startup @cindex on startup -@cindex .bashrc +@cindex @file{.bashrc} If you have @command{fortune} installed -- this program may be named -@command{fortune-mod} in your GNU/Linux distributions package repository -- -you can run @code{fortune | ponysay} to get a random pony reading a -random fortune cookie. +@command{fortune-mod} in your GNU/Linux distributions package repository -- you can +run @code{fortune | ponysay} to get a random pony reading a random fortune cookie. By adding @code{fortune | ponysay} to the end [easiest way] of your -@code{~/.bashrc} -- or equivalent for your shell if you do not use GNU Bash -(standard shell for most distributions now a days) -- you will get the -effect described in the previous paragraph every time you open a terminal. +@file{~/.bashrc} -- or equivalent for your shell if you do not use GNU Bash +(standard shell for most distributions now a days) -- you will get the effect +described in the previous paragraph every time you open a terminal. @node Ponification @@ -246,10 +312,11 @@ script, but I haven't used the script so I wouldn't know for sure. @section Running on TTY @cindex tty @cindex linux vt -@cindex .bashrc +@cindex @file{.bashrc} If you use TTY and have a custom colour palette, you should also add to your -@code{~/.bashrc}, before @code{fortune | ponysay}: +@file{~/.bashrc}, before @code{fortune | ponysay}: +@cartouche @example [ "$TERM" = "linux" ] && function ponysay @@ -257,6 +324,7 @@ If you use TTY and have a custom colour palette, you should also add to your #RESET PALETTE HERE @} @end example +@end cartouche @node Running on screen @@ -266,13 +334,14 @@ If you use TTY and have a custom colour palette, you should also add to your @command{screen} will adapt ANSI colour escape sequences to your terminal's capabilities. This means that if your terminal reports itself as @code{xterm} -in @code{$TERM} ponies will lose their colours; they will only use the lower 16 +in @env{$TERM} ponies will lose their colours; they will only use the lower 16 colours instead of the top 240 colours. By default, almost all X terminals, including @command{xterm} and @command{mate-terminal} reports themselves as -@code{xterm} in @code{$TERM}, and some reports their actual name in @code{$COLORTERM}. -So before opening @command{screen} you use set @code{$TERM} to @code{xterm-256color}, +@code{xterm} in @env{$TERM}, and some reports their actual name in @env{$COLORTERM}. +So before opening @command{screen} you use set @env{$TERM} to @code{xterm-256color}, if you are using a terminal with support for @code{xterm}'s 256 colours; this -can be done by adding to your @code{~/.bashrc}: +can be done by adding to your @file{~/.bashrc}: +@cartouche @example [ "$TERM" = "xterm" ] && function screen @@ -280,6 +349,7 @@ can be done by adding to your @code{~/.bashrc}: exec screen "$@@" @} @end example +@end cartouche @@ -290,40 +360,57 @@ can be done by adding to your @code{~/.bashrc}: @command{ponysay} supports the follow environment variables: -@table @option +@table @env @item PONYSAY_BOTTOM -@cindex PONYSAY_BOTTOM +@cindex @env{PONYSAY_BOTTOM} @cindex tty Under TTY (Linux VT), if the output is larger the the screen's height, only the beginning is printed, leaving two blank lines. If you want the bottom -to be printed rather the the beginning you can export @code{PONYSAY_BOTTOM} +to be printed rather the the beginning you can export @env{PONYSAY_BOTTOM} with the value @code{yes}, @code{y} or @code{1}. @item PONYSAY_SHELL_LINES -@cindex PONYSAY_SHELL_LINES +@cindex @env{PONYSAY_SHELL_LINES} @cindex tty Under TTY (Linux VT), if the output is larger the the screen's height, two lines are left blank. If you want more, or less, blank lines you can export -@code{PONYSAY_SHELL_LINES} with the value of how many blank lines you want. +@env{PONYSAY_SHELL_LINES} with the value of how many blank lines you want. Naturally this takes effect if the output is not actually larger than the screen. @item PONYSAY_FULL_WIDTH -@cindex PONYSAY_FULL_WIDTH -You can export @code{PONYSAY_FULL_WIDTH} with the value @code{yes}, @code{y} +@cindex @env{PONYSAY_FULL_WIDTH} +You can export @env{PONYSAY_FULL_WIDTH} with the value @code{yes}, @code{y} or @code{1}, if you do not want the output to be truncated on the width to fit the terminal. @item PONYSAY_TRUNCATE_HEIGHT -@cindex PONYSAY_TRUNCATE_HEIGHT -Export @code{PONYSAY_TRUNCATE_HEIGHT} with the value @code{yes}, @code{y} +@cindex @env{PONYSAY_TRUNCATE_HEIGHT} +Export @env{PONYSAY_TRUNCATE_HEIGHT} with the value @code{yes}, @code{y} or @code{1}, if you want to truncate the output on the height even if you are not running @command{ponysay} under TTY. +@item PONYSAY_UCS_ME +@cindex @env{PONYSAY_UCS_ME} +@cindex ucs +@cindex universal character set +@cindex unicode +@cindex ascii +Export @env{PONYSAY_UCS_ME} with the value @code{yes}, @code{y} or @code{1}, +if you want [simulated] symlink to pony files using Universal Character Set +in their names. Otherwise pony files uses only ASCII. If you want to remove +the ASCII:ised names export @env{PONYSAY_UCS_ME} with the value @code{harder}, +@code{h} or @code{2} instead. + +If you have not enabled this, UCS names are not usable, suggested or listed. +If you use @code{yes} UCS names will be usable, suggested or listed. If you +use @code{harder} ASCII:ised names will not be suggested or listed, but they +will still be usable. + @item PONYSAY_COWSAY @itemx PONYSAY_COWTHINK -@cindex PONYSAY_COWSAY -@cindex PONYSAY_COWTHINK +@cindex @env{PONYSAY_COWSAY} +@cindex @env{PONYSAY_COWTHINK} @cindex custom cowsay @cindex replace cowsay Since version 2.1 this is no longer used as @command{cowsay} has been @@ -331,13 +418,13 @@ reimplemented inside @command{ponysay}, but it is possible we will add a way to replace that back-end. If you want to use another program than @command{cowsay} (the first -@command{cowsay} found in @code{$PATH}), you can export @code{PONYSAY_COWSAY} +@command{cowsay} found in @env{$PATH}), you can export @env{PONYSAY_COWSAY} with the value of that program. In earlier versions than version 2.0: If, and -only if, @code{PONYSAY_COWSAY} does not have any value, @command{cowsay} is +only if, @env{PONYSAY_COWSAY} does not have any value, @command{cowsay} is patch with @code{use utf8;} to the beginning. The @code{use utf8;} patch is introduced to make it easier to customise cowsay. -@code{PONYSAY_COWTHINK} will be used instead of @code{PONYSAY_COWSAY} if +@env{PONYSAY_COWTHINK} will be used instead of @env{PONYSAY_COWSAY} if you run @command{ponythink}. @end table @@ -380,10 +467,10 @@ is because if your graphics driver supports KMS, the colours will be messed by w ponies position moves on the screen, this is also reason why the output is truncated on the height in TTY by default. -Most terminals have support for 256 colours, we do however only use the top 240 colours; -this is because the lower 16 colours are usually, in contrast to the top 240, customised. -We assume that the top 240 colours have their standard values. In TTY with KMS support -we dot have any actual (except for @math{2^{24}} + full transparency.) +Most terminals have support for 256 colours, we do however only use the top 240 +colours; this is because the lower 16 colours are usually, in contrast to the top 240, +customised. We assume that the top 240 colours have their standard values. In TTY with +KMS support we dot have any actual (except for @math{2^{24}} + full transparency.) @cindex xterm @cindex urxvt @@ -392,10 +479,10 @@ we dot have any actual (except for @math{2^{24}} + full transparency.) @cindex mrxvt @cindex Eterm @cindex aterm -@command{ponysay} works perfectly on @command{xterm}, @command{urxvt} and @command{putty}, -but @command{rxvt}, @command{mrxvt} and @command{Eterm} do not have UTF-8 support and are -currently not supported. Additionally @command{aterm} have neither UTF-8 support nor 256 -colour support, and is therefore not yet support. +@command{ponysay} works perfectly on @command{xterm}, @command{urxvt} and +@command{putty}, but @command{rxvt}, @command{mrxvt} and @command{Eterm} do not +have UTF-8 support and are currently not supported. Additionally @command{aterm} +have neither UTF-8 support nor 256 colour support, and is therefore not yet support. @cindex 9term Due to extreme limitations in @command{9term} @command{ponysay} will never be able to @@ -418,18 +505,12 @@ colours and text styling in messages will also malformat the balloon with the me @command{cowsay} does not support balloon, including the link between the message and the pony, customisation, other than using @command{cowthink}. However you can modify -@command{cowsay} (written Perl, so you can edit the installed files) to make the balloon -look different, maybe using box drawing characters. - -@command{cowsay} does not support setting the minimum size of the balloon, both directions -on the balloon–pony links. or any other placement of the balloon than at the top to -the left. - -@cindex figlet -@cindex toilet -@command{cowsay}'s word wrapping handles single line breaks as normal blank spaces, -this messes up messages created with programs such as @command{figlet} and @command{TOIlet}. +@command{cowsay} (written Perl, so you can edit the installed files) to make the +balloon look different, maybe using box drawing characters. +@command{cowsay} does not support setting the minimum size of the balloon, both +directions on the balloon–pony links. or any other placement of the balloon than at +the top to the left. @@ -457,10 +538,10 @@ solve it faster. @section Requesting ponies @cindex pony requests -If you want I specific pony added, ask us at @url{https://github.com/erkin/ponysay/issues} -and we will add it. To speed the up the process, if possible, supply good -pictures. Full visibly, transparent background, and pixelated are the -properties that makes a picture good. +If you want I specific pony added, ask us at +@url{https://github.com/erkin/ponysay/issues} and we will add it. +To speed the up the process, if possible, supply good pictures. Full visibly, +transparent background, and pixelated are the properties that makes a picture good. @@ -480,12 +561,10 @@ properties that makes a picture good. @node Required runtime dependencies @section Required runtime dependencies -@table @option -@item cowsay -This is a wrapper for @command{cowsay}. +@table @command @item coreutils @command{stty} is used to determine the size of the terminal. -@item python +@item python>=3 @command{ponysay} is written in pure Python 3. @end table @@ -494,7 +573,7 @@ This is a wrapper for @command{cowsay}. @cindex extensions @cindex optional dependencies -@table @option +@table @command @item util-say>=2 @cindex @command{util-say} @cindex kms @@ -503,31 +582,33 @@ This is a wrapper for @command{cowsay}. For improved TTY support for user with custom colour palette and KMS support. It can be downloaded at @url{https://github.com/maandree/util-say}. +@cindex .png @cindex png images @cindex images, png @cindex portable network graphics -For the purpose of simplifying for pony contributors, @command{ponysay} -supports using .png-images (note that the file must not miss the -@code{.png} in the file) in addition of .pony-files or pony names. +For the purpose of simplifying for pony contributors, @command{ponysay} supports +using .png-images (note that the file must not miss the @file{.png} in the file) +in addition of .pony-files or pony names. @end table @node Package building dependencies @section Package building dependencies -@table @option +@table @command @item gzip Used for compressing manuals. @item texinfo @itemx info -@command{texinfo} and @command{info} are required if you want this @command{info} manual. +@command{texinfo} and @command{info} are required if you want this @command{info} +manual. @item make Required to run the make script. @item coreutils The make script uses @command{install}, @command{unlink}, @command{rm}, @command{ln}, @command{mkdir} and @command{cp} and @command{cut}. @item sed -Used by the make script for @command{PREFIX} customisation. +Used by the make script for @option{PREFIX} customisation. @end table @@ -535,9 +616,9 @@ Used by the make script for @command{PREFIX} customisation. @section Dependencies for pony providers @cindex contributing -@table @option +@table @command @item make -Required to run @command{make -B ttyponies`}. +Required to run @command{make -B ttyponies}. @item coreutils @command{ln} and @command{readlink} are used in the @command{ttyponies} subscript. @item bash @@ -574,22 +655,23 @@ It can be downloaded at @url{https://github.com/maandree/util-say}. @node Installations basics @subsection Installations basics -@cindex make +@cindex @command{make} @cindex basic installation -Before installing @command{ponysay}, make sure your system have the packages listed under -@ref{Required runtime dependencies} and @ref{Package building dependencies} installed. +Before installing @command{ponysay}, make sure your system have the packages listed +under @ref{Required runtime dependencies} and @ref{Package building dependencies} +installed. Tarballs can be downloaded at @url{https://github.com/erkin/ponysay/tarball/master} for bleeding edge, or from @url{https://github.com/erkin/ponysay/tags} for releases. -If you have @command{git} you @command{clone} the project URL +If you have @command{git} you can @command{clone} the project URL @url{https://github.com/erkin/ponysay.git}. In the terminal, @command{cd} into the ponysay directory and execute @command{./configure && make install}. This will install @command{ponysay} into the -@code{/usr}, meaning you may need to run @command{make install} as root, +@file{/usr}, meaning you may need to run @command{make install} as root, e.g. by running @command{sudo make install}. Now you will be to use ponysay, run: @command{ponysay "I am just the cutest pony!"}, @@ -599,7 +681,7 @@ or if have a specific pony in your mind: @command{ponysay -f pinkie "Partay!~"}. @command{ponysay} comes with this @command{info} manual and a manpage in section 6, @command{man 6 ponysay} (or just @command{man ponysay}). The manpage is also available in Spanish: @command{man -L es 6 ponysay}. The install the Spanish manual add the -option @command{--with-man-es} when running @command{./configure}. +option @option{--with-man-es} when running @command{./configure}. @node Custom installations @@ -610,62 +692,62 @@ option @command{--with-man-es} when running @command{./configure}. @cindex @command{./configure} @cindex configure -@cindex @command{--everything} +@cindex @option{--everything} A basic installation will install everything @command{ponysay} has to offer, except the prebuilt PDF manual and translated manpages. If you want to install exactly -everything add the option @command{--everything} when running @command{./configure}. +everything add the option @option{--everything} when running @command{./configure}. -@cindex @command{--with-pdf} +@cindex @option{--with-pdf} @cindex PDF manual, with -@cindex @command{--without-man} +@cindex @option{--without-man} @cindex manpage, without -@cindex @command{--without-info} -@cindex @command{--without-info-install} -@cindex @command{info} manual, without -@cindex @command{--with-man-LANG} +@cindex @option{--without-info} +@cindex @option{--without-info-install} +@cindex @option{info} manual, without +@cindex @option{--with-man-LANG} @cindex manpage translations -After @command{--everything} it is possible to remove unwanted parts, this can -of cause be done without @command{--everything}. If you want to install the -PDF manual to @code{/usr/doc/ponysay.pdf} add the option @command{--with-pdf} when -running @command{./configure}. To install a manpage translation add -@command{--with-man-LANG} and substitute the the language code for @code{LANG}. -Currently the only translation is Spanish with the language code @code{es}. -If you do not want the English manpage add the option @command{--without-man}. -If you do not want the @command{info} manual add the option @command{--without-info}. -If you are installing the @command{info} manual but are not privileged to execute -@command{install-info} add the option @command{--without-info-install}. +After @option{--everything} it is possible to remove unwanted parts, this can of +cause be done without @option{--everything}. If you want to install the PDF manual +to @file{/usr/doc/ponysay.pdf} add the option @option{--with-pdf} when running +@command{./configure}. To install a manpage translation add @option{--with-man-LANG} +and substitute the the language code for @code{LANG}. Currently the only translation +is Spanish with the language code @code{es}. If you do not want the English manpage +add the option @option{--without-man}. If you do not want the @command{info} manual +add the option @option{--without-info}. If you are installing the @command{info} +manual but are not privileged to execute @command{install-info} add the option +@option{--without-info-install}. The following argumentless options are also recognised: @itemize @bullet -@item @command{--without-bash} -@cindex @command{--without-bash} +@item @option{--without-bash} +@cindex @option{--without-bash} @cindex @command{bash}, without will skip installation of auto-completion for @command{ponysay} and the GNU Bourne-again shell, @command{bash}. -@item @command{--without-fish} -@cindex @command{--without-fish} +@item @option{--without-fish} +@cindex @option{--without-fish} @cindex @command{fish}, without will skip installation of auto-completion for @command{ponysay} and the Friendly interactive shell, @command{fish}. -@item @command{--without-zsh} -@cindex @command{--without-zsh} +@item @option{--without-zsh} +@cindex @option{--without-zsh} @cindex @command{zsh}, without will skip installation of auto-completion for @command{ponysay} and the shell @command{zsh}. -@item @command{--without-shared-cache} -@cindex @command{--without-shared-cache} +@item @option{--without-shared-cache} +@cindex @option{--without-shared-cache} @cindex cache @cindex kms will skip installing a shared cache for KMS support, when there is no -shared cache, private one will be used at @code{~/.cache/ponysay}. +shared cache, private one will be used at @file{~/.cache/ponysay}. @end itemize -@cindex @command{--prefix=TARGET} -@cindex @code{/usr/games} -The program is by default installed in @code{/usr}, if you want another target -directory, you can add @command{--prefix=TARGET} when running @command{./configure}. -For example to install @command{ponysay} in @code{/usr/games} you build the +@cindex @option{--prefix=TARGET} +@cindex @file{/usr/games} +The program is by default installed in @file{/usr}, if you want another target +directory, you can add @option{--prefix=TARGET} when running @command{./configure}. +For example to install @command{ponysay} in @file{/usr/games} you build the program by running @command{./configure --prefix=/usr/games}, and alike for installation and uninstallation. Notice the @command{=} cannot be substituted with white space. @@ -686,7 +768,7 @@ add the option @command{--shell=SHELL}. @cindex arch linux The official Arch Linux package repositories contains @command{ponysay} as -@code{community/ponysay}. The Arch Linux User Repository (AUR) contains a bleeding +@w{@code{community/ponysay}}. The Arch Linux User Repository (AUR) contains a bleeding edge git version of @command{ponysay} as @code{ponysay-git}. @@ -716,7 +798,7 @@ manually from the upstream, you can uninstall it by running @command{make uninst Well written package manages will uninstall files that the package is no longer using, i.e. if deleted, moved or renamed. To uninstall files that are not longer -used, by the currently installed version you will need that versions @code{Makefile}. +used, by the currently installed version you will need that versions @file{Makefile}. To perform the uninstallation of old filed run @command{make uninstall-old}. @@ -730,8 +812,8 @@ Ponysay does not support extensions, per se, but rather have optional features t are enabled when other packages are installed. @menu -* ponyquotes4ponysay:: ponyquotes4ponysay: Quotes from My Little Ponies. -* kmsponies4ponysay:: kmsponies4ponysay: Improved TTY support under KMS support. +* ponyquotes4ponysay:: ponyquotes4ponysay: Quotes from My Little Ponies. +* kmsponies4ponysay:: kmsponies4ponysay: Improved TTY support under KMS support. @end menu @@ -755,37 +837,41 @@ but is still available at @url{https://github.com/maandree/ponyquotes4ponysay}. @cindex kms @cindex kernel mode settings @cindex environment variables -@cindex PONYSAY_KMS_PALETTE -@cindex PONYSAY_KMS_PALETTE_CMD -@cindex .bashrc - -@command{kmsponies4ponysay} is an extension for TTY users that have a custom TTY colour -palette and KMS support. KMS is supported on most computers, but due to lack of published -specifications Nvidea drivers does not support KMS. @command{kmsponies4ponysay} can be -downloaded at @url{https://github.com/maandree/kmsponies4ponysay}. - -To use this extension your @code{~/.bashrc} (or equivalent for your shell) must keep track -of your colour palette, it is not possible for a program to ask to terminal. Either the -shell should export a palette string to @code{$PONYSAY_KMS_PALETTE} or you should export -a command to can get the palette string to @code{$PONYSAY_KMS_PALETTE_CMD}. The palette -string should be the stream which sets the colour palette to the terminal when -@command{echo}:ed; preferably, to increase speed and reduce cache usage, it should be -consistent every time it is exported for every colours palette. So you may want to keep it -sorted, always be in either upper case or lower case, and not contain an character that -is not used to set the colour palette. - -Assuming you have a function in your @code{~/.bashrc}, to reset the colour palette to what -you set it to last time in the terminal, named @command{reset-palette}, your @code{~/.bashrc} -should, for example, contain: +@cindex @env{PONYSAY_KMS_PALETTE} +@cindex @env{PONYSAY_KMS_PALETTE_CMD} +@cindex @file{.bashrc} + +@command{kmsponies4ponysay} is an extension for TTY users that have a custom TTY +colour palette and KMS support. KMS is supported on most computers, but due to lack +of published specifications Nvidea drivers does not support KMS. +@command{kmsponies4ponysay} can be downloaded at +@url{https://github.com/maandree/kmsponies4ponysay}. + +To use this extension your @file{~/.bashrc} (or equivalent for your shell) must keep +track of your colour palette, it is not possible for a program to ask to terminal. +Either the shell should export a palette string to @env{$PONYSAY_KMS_PALETTE} or you +should export a command to can get the palette string to +@env{$PONYSAY_KMS_PALETTE_CMD}. The palette string should be the stream which sets +the colour palette to the terminal when @command{echo}:ed; preferably, to increase +speed and reduce cache usage, it should be consistent every time it is exported for +every colours palette. So you may want to keep it sorted, always be in either upper +case or lower case, and not contain an character that is not used to set the colour +palette. + +Assuming you have a function in your @file{~/.bashrc}, to reset the colour palette +to what you set it to last time in the terminal, named @command{reset-palette}, +your @file{~/.bashrc} should, for example, contain: +@cartouche @example [ "$TERM" = "linux" ] && function ponysay - @{ export PONYSAY_KMS_PALETTE="`reset-palette`" + @{ export PONYSAY_KMS_PALETTE="$(reset-palette)" exec ponysay "$@@" @} @end example +@end cartouche -@command{kmsponies4ponysay} uses @code{/var/cache/kmsponies4ponysay/} for cache space. +@command{kmsponies4ponysay} uses @file{/var/cache/kmsponies4ponysay/} for cache space. As of version 2.0 @command{kmsponies4ponysay} is included in @command{ponysay}, but is still available at @url{https://github.com/maandree/kmsponies4ponysay}. @@ -800,10 +886,12 @@ but is still available at @url{https://github.com/maandree/kmsponies4ponysay}. @menu * Pony anatomy:: Anatomy of pony files. * Pony quote infrastructure:: Pony quote infrastructure. -* Printing in TTY with KMS:: Printing in TTY with KMS. +* Balloon style files:: Balloon style files. +* Printing in TTY with KMS:: Printing in TTY with KMS support. * Truncation:: Output truncation. -* Languages:: Selection of languages. -* Shell auto-completion:: Things make auto-completion simpler. +* Languages:: Selection of programming languages. +* Shell auto-completion:: Things that make auto-completion simpler. +* Universal Character Set:: Something about Univeral Character Set support. @end menu @@ -834,10 +922,11 @@ whether @code{X} is the minimum width of the balloon and @code{Y} is the minimum height of the balloon. Prior to version 2.1 the pony files were cow files used by @command{cowsay}, they -are partial Perl-scripts that assign a value to a scalar variable named @code{$the_cow}. -Cow files use a predefined scalar variable named @code{$thoughts}, these are used -to create a link between the message and the pony. The message (and the balloon) -itself was printed by @command{cowsay} and is not defined in the cow files. +are partial Perl-scripts that assign a value to a scalar variable named +@var{$the_cow}. Cow files use a predefined scalar variable named @code{$thoughts}, +these are used to create a link between the message and the pony. The message (and +the balloon) itself was printed by @command{cowsay} and is not defined in the cow +files. @node Pony quote infrastructure @@ -845,22 +934,93 @@ itself was printed by @command{cowsay} and is not defined in the cow files. @cindex pony quote infrastructure @cindex quote infrastructure -When compiles pony quotes are built to @code{quotes}, the file names are lists of -ponies joined with plus signs (@code{+}) -- the pony names are the same as the pony files, -except they do not end with @code{.pony} -- with a index at the end, and a full stop -(@code{.}) before the index. +When compiles pony quotes are built to @file{quotes/}, the file names are lists of +ponies joined with plus signs (@code{+}) -- the pony names are the same as the pony +files, except they do not end with @file{.pony} -- with a index at the end, and a +full stop (@code{.}) before the index. -The source files are located in @code{ponyquotes}, where their is a file named @code{ponies}. -This file is called the pony map, is the basis for how the compiled files are named. -In the ponymap ponies with the same quotes are on the same line join togather with plus -signs (@code{+}), if the lines because too long for file names the line is split into -multiple lines with the first pony in common. +The source files are located in @file{ponyquotes/}, where their is a file named +@file{ponies}. This file is called the pony map, is the basis for how the compiled +files are named. In the ponymap ponies with the same quotes are on the same line +join togather with plus signs (@code{+}), if the lines because too long for file +names the line is split into multiple lines with the first pony in common. -In @code{ponyquotes} there are also quote files, each contain just one quote, just as -when compiled to @code{quotes}. The source quote files are indentical to the compiled +In @file{ponyquotes/} there are also quote files, each contain just one quote, just as +when compiled to @file{quotes/}. The source quote files are indentical to the compiled quote files, except that there name contains just the first pony. +@node Balloon style files +@section Balloon style files +@cindex balloon style files +@cindex bubble style files +@cindex ponythink + +Balloon style files are located in the directory @file{balloons/}, the ones ending +with @file{.say} applies to @command{ponysay} and the ones ending with @file{.think} +applies to @command{ponythink}. + +Balloon style consists of 20 strings. Each string is definied on separate lines, by +their name and their value seperated with a colon (@code{name:value}), if the name is +empty it continues the last one new line in the value. Only 10 of the strings may be +multi-lined: @var{nw}, @var{nnw}, @var{n}, @var{nne}, @var{ne}, @var{sw}, @var{ssw}, +@var{s}, @var{sse} and @var{se}. + +The following strings are used, and must be definied in the files: +@table @var +@item \ +The character for the link to the balloon directed as @code{\}. +@item / +The character for the link to the balloon directed as @code{/}. +@item ww +The beginning of the balloon's line where the message is located if and only if the +message contains only one line. +@item ee +The end of the balloon's line where the message is located if and only if the message +contains only one line. +@item nw +The top left corner of the balloon. +@item nnw +If both this string and the @var{nne} string fits between the top corners, this is +printed directly to the right of the top left corner. +@item n +The top edge of the balloon. +@item nne +If both this string and the @var{nnw} string fits between the top corners, this is +printed directly to the right of the top top corner. +@item ne +The top right corner of the balloon. +@item nee +The end of the balloon's line where the message's first line is located if and only +if the message contains more than one line. +@item e +The right edge of the balloon. +@item see +The end of the balloon's line where the message's last line is located if and only +if the message contains more than one line. +@item se +The bottom right corner of the balloon. +@item sse +If both this string and the @var{ssw} string fits between the bottom corners, this +is printed directly to the left of the bottom right corner. +@item s +The bottom edge of the balloon. +@item ssw +If both this string and the @var{sse} string fits between the bottom corners, this +is printed directly to the right of the bottom left corner. +@item sw +The bottom left corner of the balloon. +@item sww +The beginning of the balloon's line where the message's last line is located if and +only if the message contains more than one line. +@item w +The left edge of the balloon. +@item nww +The beginning of the balloon's line where the message's first line is located if and +only if the message contains more than one line. +@end table + + @node Printing in TTY with KMS @section Printing in TTY with KMS @cindex tty @@ -869,14 +1029,15 @@ quote files, except that there name contains just the first pony. @cindex kms @cindex kernel mode settings -Since Linux VT (TTY) does not have capabilities for returning the position of the cursor, -the screen must always be cleared before printing the ponies to make sure the pony's -colours is not lost, i.e. reduced to mare 16 colours, during print. The colours are reduced -if the pony's position on the screen is changed. This is only relevant with KMS support. -The clear the screen we print ``@code{\e[H\e[2J}'' (@code{\e} is ESC) in at beginning. -``@code{\e[H}'' places the cursor at the beginning of the screen, and ``@code{\e[2J}'' clears -everything on the screen after, and including at, the cursor. If we would use ``@code{\ec}'' -(that is a reset), we would also turn off num. lock and caps. lock. +Since Linux VT (TTY) does not have capabilities for returning the position of the +cursor, the screen must always be cleared before printing the ponies to make sure +the pony's colours is not lost, i.e. reduced to mare 16 colours, during print. The +colours are reduced if the pony's position on the screen is changed. This is only +relevant with KMS support. The clear the screen we print ``@code{\e[H\e[2J}'' +(@code{\e} is ESC) in at beginning. ``@code{\e[H}'' places the cursor at the +beginning of the screen, and ``@code{\e[2J}'' clears everything on the screen after, +and including at, the cursor. If we would use ``@code{\ec}'' (that is a reset), +we would also turn off num. lock and caps. lock. @node Truncation @@ -893,25 +1054,28 @@ by default. Truncating the height in TTY is required under Kernel Mode Settings (KMS) support to keep the colours from being messed up ad the ponies is moved in the screen during -print; this done either by piping to @command{head} (keeps the top) or by piping to -@command{tail} (keeps the bottom.) @command{head} and @command{tail} takes as argument -the number of lines to keep at most. +print. Prior to version 2.0 this was done either by piping to @command{head} (keeps +the top) or by piping to @command{tail} (keeps the bottom.) @command{head} and +@command{tail} takes as argument the number of lines to keep at most. The size of the terminal, measured in characters, is fetched from @command{stty size}, which returns @code{HEIGHT WIDTH}, and @command{cut} it the used to get either the -height or the width. This required on GNU Coreutils; earlier @command{tput rows} and +height or the width. This requires only GNU Coreutils; earlier @command{tput rows} and @command{tput cols} were used, this however required, the only de facto standard, package @command{ncurses}, some shells have environment variables for this. -For truncation the width, we have a custom program, named @command{ponysaytruncater}, -that is installed to @code{/usr/lib/ponysay/truncater}. It recognised UTF-8 ANSI escape -sequences, including OSI P and CSI m, which is essential for the truncation to be correct. -It also expands tabs to every eighth column and resets the background colour when needed, -and writes ANSI escape sequences that are on the left side of the truncation. The truncater -stops CSI sequences on the first ASCII letter (@code{[a-zA-Z]}), but also stops escape -sequences after the first character after the initial escape if it is not either @code{[} -(CSI) or @code{]} (OSI). For support UTF-8, to handles all bytes that do not match -@code{10xxxxxx} as beginning of a character. +Since version 2.1 trunction is done internally in the Python script, before that it +was done in a custom C porgram @command{truncater}, that was installed to +@file{/usr/lib/ponysay/truncater}. It recognised UTF-8 ANSI escape sequences, +including OSI P and CSI m, which is essential for the truncation to be correct. It +also expands tabs to every eighth column and resets the background colour when needed, +and writes ANSI escape sequences that are on the left side of the truncation. The +truncater stops CSI sequences on the first ASCII letter (@code{[a-zA-Z]}), but also +stops escape sequences after the first character after the initial escape if it is +not either @code{[} (CSI) or @code{]} (OSI). In the previus, C, program it supported +UTF-8 by assumming that bytes do not match @code{10xxxxxx} and only those bytes were +visible. This now fixed internally in Python, but has also been improved to exclude +combining characters from the set of visible characters. @node Languages @@ -920,15 +1084,15 @@ sequences after the first character after the initial escape if it is not either @cindex script languages @cindex programming languages -Before version 2.0 @command{ponysay} was written primarily in GNU Bash script -(POSIX compliant); the truncater was however written in C, because it is simple, -fast, does not pose addition dependencies, and is easy to do byte hacking in. +Before version 2.0 @command{ponysay} was written primarily in GNU Bash script (POSIX +compliant); the truncater was however written in C, because it is simple, fast, does +not pose addition dependencies, and is easy to do byte hacking in. -Sometimes shell is too slow, in these cases Perl was used; Perl was already -required by cowsay, is similar to shell, but also supports hash tables. +Sometimes shell is too slow, in these cases Perl was used; Perl was already required +by @command{cowsay}, is similar to shell, but also supports hash tables. -However since version 2.0 we were trying to move from all there languages -and only use Python 3, which as been accomplished in version 2.1. +However since version 2.0 we were trying to move from all there languages and only +use Python 3, which as been accomplished in version 2.1. @node Shell auto-completion @@ -936,14 +1100,19 @@ and only use Python 3, which as been accomplished in version 2.1. @cindex auto-completion, inner workings @cindex shell, auto-completion @cindex @command{--onelist} +@cindex @command{++onelist} @cindex @command{--quoters} To make it easier to write auto-completion for shells, @command{ponysay} supports -the two options @command{--onelist} and @command{--quoters}, which has not short -versions. +the two options @option{--onelist}, @option{++onelist} and @option{--quoters}, +which has no short versions. -Executing @command{ponysay --onelist} will list every available pony, -independent of where it is located, the output is a sorted and consists only +Executing @command{ponysay --onelist} will list every available standard (MLP:FiM) +pony, independent of where it is located, the output is a sorted and consists only +of one pony per line. + +Executing @command{ponysay ++onelist} will list every available extra (non-MLP:FiM) +pony, independent of where it is located, the output is a sorted and consists only of one pony per line. @command{ponysay --quoters} work just as @command{ponysay --onelist}, excepts @@ -953,6 +1122,31 @@ but does not exist, i.e. does not have a .pony-file, are not listed. Auto-completion scripts should not suggest these options. +@node Universal Character Set +@section Universal Character Set +@cindex universal character set +@cindex ucs +@cindex unicode +@cindex pony names + +In earlier versions of @command{ponysay} only the output truncationed supported +Universal Character Set, though handcoded UTF-8 character counting. Now +@command{ponysay} lets Python decode the data, Python store all 31 bits of a +character in as one character, not in UTF-16 as some other languages does, this +means that the code is agnostic to the chararacter encoding. However in Unicode +6.1 their are four ranges of combining characters, these do not take up any +width in proper terminal, we their for have a class in the code named @code{UCS} +that help us take them into consideration when determine the length of strings. + +Some ponies have names contains non-ASCII characters, read about it in +@ref{Environment variables}. The UCS names are stored in the file @file{share/ucsmap}, +in it lines that are not empty and does not start with a hash (@code{#}) are +parse, and contains a UCS name and a ASCII:ised name. The UCS name comes first, +followed by the ASCII:ised name that it should replace or link to. The two names +are separated by and simple left to right arrow character [U+2192], optionally +with surrounding white space. + + @node Contributing @chapter Contributing @@ -971,10 +1165,11 @@ desktop ponies, implementing it in JavaScript. Browser ponies are available at @url{https://github.com/panzi/Browser-Ponies}. Desktop ponies are available at @url{http://desktop-pony-team.deviantart.com/}. -There is also a collection of ponies that are not yet pixelated in a Java reimplementation: +There is also a collection of ponies that are not yet pixelated in a Java +reimplementation of the early Ponysay: @url{https://github.com/maandree/unisay/tree/develop/dev/newponies} -There is a checklist named @code{"pony-checklist"} at the @code{"dev/"} directory. +There is a checklist named @file{pony-checklist} at the @file{dev/} directory. You can use the check which ponies are added and which are not. @* @@ -990,43 +1185,103 @@ aspect,) and same width on all rows. Using util-say: @cindex util-say -@cindex img2ponysay +@cindex @command{img2ponysay} +@cartouche @example -img2ponysay -2 -- SOURCE_IMAGE > PONY_FILE +@code{img2ponysay -2 -- SOURCE_IMAGE > PONY_FILE} -PONY_FILE should end with .pony and be localed in ponies/ +@code{PONY}_FILE should end with @file{.pony} and be localed in @file{ponies/}, +or @file{extraponies/} if the pony is not a MLP:FiM pony. -Omit -2 if the source image does not use double pixel size. +Omit @option{-2} if the source image does not use double pixel size. For more information see: @url{https://github.com/maandree/util-say/wiki/img2ponysay} @end example +@end cartouche + +@* +@cindex util-say +@cindex .png +@cindex png images +@cindex images, png +@cindex portable network graphics +If you have util-say installed, which is required to build ponies, you can run +PNG files as argument for @command{ponysay -f}, this required that the file is +named @file{.png} at the end. + +@cindex palette +@cindex xterm palette +@cindex pony palette +@cindex colour palette +The following @command{bash} code will print the palette the ponies (the terminals) +use: +@cartouche +@example +c=16 +while ((c < 256)); do + echo -en "\e[48;5;$@{c@}m \e[49m" + c=$(( $c + 1 )) + if (( $(( c % 36 )) == 16 )); then + echo + fi +done; echo +@end example +@end cartouche @* +For the palette to be correct, which is especially important when you draw ponies, you +must not redefine the colours in the range 16 to 255 (inclusive). + @cindex ttypony -When a pony is added please also add a ttypony version, i.e. the pony files used in TTY, -but if you don't please state so in the pull request so we do not miss the create it; -the simplest way to do this is to run @command{make -B ttyponies} after adding the ponies -to @code{ponies/}, running @command{make -B ttyponies} will build (or rebuild) all -ttyponies with a pony present in @code{ponies/}, and creates all needed symlinks. +When a pony is added please also add a ttypony version, i.e. the pony files used in +TTY, but if you don't please state so in the pull request so we do not miss the +create it; the simplest way to do this is to run @command{make -B ttyponies} after +adding the ponies to @file{ponies/}, running @command{make -B ttyponies} will build +(or rebuild) all ttyponies with a pony present in @file{ponies/}, and creates all +needed symlinks. To be able to run @command{make -B ttyponies} you must have the packages listed under @ref{Dependencies for pony providers}. @cindex ponyquotes @cindex quotes -Also when adding new ponies, please map them up in the file @code{"ponyquotes/ponies"}. +Also when adding new ponies, please map them up in the file @file{ponyquotes/ponies}. If the pony is a new pony without any other alternative image just add it to a new -line, without @code{.pony}, preferably in its alphabetical position. +line, without @file{.pony}, preferably in its alphabetical position. If the file is a symlink add it to the same line as the target pony, and if the pony has and alternative image add it the the same line as that pony. Ponies on the same line are separated with a plus sign (@code{+}) without any white space. When a line is too long for a file name (this has happened to Pinkie Pie -[@code{pinkie}],) it must be split into multiple lines, this line should have their +[@file{pinkie}],) it must be split into multiple lines, this line should have their first pony file in common. +@node Distributing +@chapter Distributing +@cindex distributing ponysay +@cindex package maintaining +@cindex OS package maintaining +@cindex maintaining OS package +@cindex fhs +@cindex filesystem hierarchy standard + +If you are planning on maintaining @command{ponysay} in your favourite Operating +System you should first read @ref{Required runtime dependencies} and +@ref{Optional runtime dependencies}. If your OS does not follow Filesystem Hierarchy +Standard (FHS), e.g. installing amusement binaries in @file{/usr/games} instread of +@file{/usr/bin} or only supporting @file{/opt} equivalent directories you should +read about configurations in @ref{Custom installations}. + +Apart from this, you should configure @command{ponysay} before building it with the +option @option{--everything}. Otherwise only the @command{info} manual and the +English manpage will be installed for documentation. + +Please inform us about your distribution so we can list it, everypony can see it. + + + @node Change log @appendix Change log @cindex change log @@ -1043,14 +1298,21 @@ New ponies: @code{blaze} @itemize @bullet @item +<<<<<<< HEAD Support for 'best.pony' file. @item `-q` accepts file names. +======= +Support for @file{best.pony} file. +@item +@option{-q} accepts file names. +>>>>>>> 4fcd0b284ff296b41e08056c2dbf35de614e0320 @item Improved Unicode support: treats combining characters as invisible. @item Optional support for UCS pony names. @item +<<<<<<< HEAD Pony files and balloon style files can be pipes (as well as sockets, doors and as always regular files.) @item @@ -1063,12 +1325,34 @@ Support for non-MLP:FiM ponies (known as extraponies), although the directory is currently empty. @end itemize +======= +Pony files and balloon style files can be pipes (as well as sockets, doors +and as always regular files.) +@item +Support cowsay style message compression. +@item +Pony symlink added: +@itemize @bullet +@item @file{pinkieoink} → @file{oinkoinkoink} +@end itemize +@item +Support for non-MLP:FiM ponies (known as extraponies), although the directory +is currently empty. +@c BEGIN the following is too descriptive for the plain/text change log +This is implemented with the options @option{-F}, @option{+l}, and @option{+L} +corresponding to @option{-f}, @option{-l}, and @option{-L}. +@c END +@end itemize + + +>>>>>>> 4fcd0b284ff296b41e08056c2dbf35de614e0320 @heading Version 2.2 @itemize @bullet @item Full support for arbitrary positioning of balloon in pony files. @item +<<<<<<< HEAD ANSI colour sequences in pony files are applied only to the pony image, not the balloon link or the balloon itself. @item @@ -1078,22 +1362,35 @@ Support custom balloon styles using the option '-b', '-B' will list all available. This list depends on whether you are invoking `ponysay` or `ponythink`. @end itemize +======= +ANSI colour sequences in pony files are applied only to the pony image, +not the balloon link or the balloon itself. +@item +Support for colours in the message. +@item +Support custom balloon styles using the option @option{-b}, @option{-B} will list +all available. This list depends on whether you are invoking @command{ponysay} +@end itemize + + +>>>>>>> 4fcd0b284ff296b41e08056c2dbf35de614e0320 @heading Version 2.1.1 Nothing worth mention. + @heading Version 2.1 @itemize @bullet @item -@code{applebumkin} is renamed to @code{applebumpkin}. +@file{applebumkin} is renamed to @file{applebumpkin}. @item -New ponies: @code{purplehaze}, @code{owlowiscious} +New ponies: @file{owlowiscious}, @file{purplehaze} @item Cowsay has be reimplemented, and have full Unicode support and support -for @code{figlet} style messages. +for @command{figlet} style messages. @item -Deleted environment variables: @code{PONYSAY_COWSAY}, @code{PONYSAY_COWTHINK} +Deleted environment variables: @env{PONYSAY_COWSAY}, @env{PONYSAY_COWTHINK} @item You will need Python 3, but not GNU Bash, Perl or Cowsay. @item @@ -1105,6 +1402,7 @@ minimum size of balloon. @c END @end itemize + @heading Version 2.0 @itemize @bullet @@ -1116,12 +1414,14 @@ All Perl scripts and almost all Bash are reimplemented in one Python 3 script. kmsponies4ponysay is included. @end itemize + @heading Version 1.4.1 @itemize @bullet @item Code is repaired and more portable. @end itemize + @heading Version 1.4 @itemize @bullet @@ -1131,22 +1431,24 @@ Make file is improved. @b{Note}: Identifies itself as version 1.3 + @heading Version 1.3 @itemize @bullet @item -New ponies: @code{forestspirit}, @code{hollydash}, @code{raggedy}, @code{rhyme} +New ponies: @file{forestspirit}, @file{hollydash}, @file{raggedy}, @file{rhyme} @item -@code{sindy} is renamed to @code{powderrouge}. -Pony symlinks added: +@file{sindy} is renamed to @file{powderrouge}. +Pony symlink added: @itemize @bullet -@item @code{sindy} → @code{powderrouge} +@item @file{sindy} → @file{powderrouge} @end itemize @item -@code{PREFIX=/some-dir} can be used when invoking @command{make}, -the default value is @code{/usr} +@option{PREFIX=/some-dir} can be used when invoking @command{make}, +the default value is @file{/usr} @end itemize + @heading Version 1.2 @itemize @bullet @@ -1157,23 +1459,24 @@ Support for extension: kmsponies4ponysay. @item Pony symlinks added: @itemize @bullet -@item @code{mrsparkle} → @code{nightlight} -@item @code{elsie} → @code{prettyvision} +@item @file{mrsparkle} → @file{nightlight} +@item @file{elsie} → @file{prettyvision} @end itemize @item -New ponies: @code{ace}, @code{blueblood}, @code{filthyrich}, @code{gingergold}, -@code{hayfever}, @code{highscore}, @code{junebug}, @code{mrsparkle}, -@code{persnickety}, @code{ponet}, @code{screwloose}, @code{tornadobolt}. +New ponies: @file{ace}, @file{blueblood}, @file{filthyrich}, @file{gingergold}, +@file{hayfever}, @file{highscore}, @file{junebug}, @file{mrsparkle}, +@file{persnickety}, @file{ponet}, @file{screwloose}, @file{tornadobolt}. @item -@code{elsie} is renamed to @code{prettyvision}. +@file{elsie} is renamed to @file{prettyvision}. @item -@cindex @command{-f} -Arbitrary spaces in @command{-f} argument is not longer accepted (it causes problems with -file names including spaces.) +@cindex @option{-f} +Arbitrary spaces in @option{-f} argument is not longer accepted (it causes +problems with file names including spaces.) @end itemize @b{Note}: Identifies itself as version 1.1 + @heading Version 1.1 @itemize @bullet @@ -1186,103 +1489,109 @@ Shell completion for @command{ponythink} added, in addition to @command{ponysay} @item @command{fish} completion added. @item -@code{/usr/lib/ponysay} is used instead of @code{/usr/bin} for code used by the main script. +@file{/usr/lib/ponysay} is used instead of @file{/usr/bin} for code used by the +main script. @item -@code{~/.local/share/ponysay} is used for private pony directories. +@file{~/.local/share/ponysay} is used for private pony directories. @item @command{ncurses} is no longer needed for determining the screen's size, @command{coreutils} is used instead. @item Pony symlinks added: @itemize @bullet -@item @code{amethyststar} → @code{sparkler} -@item @code{berrypinch} → @code{ruby} -@item @code{craftycrate} → @code{boxxy} -@item @code{magnum} → @code{raritysdad} -@item @code{pearl} → @code{raritysmom} -@item @code{powderrouge} → @code{sindy} -@item @code{royalribbo} → @code{violet} +@item @file{amethyststar} → @file{sparkler} +@item @file{berrypinch} → @file{ruby} +@item @file{craftycrate} → @file{boxxy} +@item @file{magnum} → @file{raritysdad} +@item @file{pearl} → @file{raritysmom} +@item @file{powderrouge} → @file{sindy} +@item @file{royalribbo} → @file{violet} @end itemize @item -@w{New ponies:} @code{blossomforth}, @code{bonvoyage}, @code{cadance}, @code{celestiasmall}, -@code{changelingqueen}, @code{cherryberry}, @code{discordamused}, @code{discordpuppetmaster}, -@code{fleurdelishair}, @code{fleurdelislay}, @code{owl}, @code{perrypierce}, @code{petunia}, -@code{pinacolada}, @code{skyra}, @code{truffleshuffle}. +@w{New ponies:} @file{blossomforth}, @file{bonvoyage}, @file{cadance}, +@file{celestiasmall}, @file{changelingqueen}, @file{cherryberry}, +@file{discordamused}, @file{discordpuppetmaster}, @file{fleurdelishair}, +@file{fleurdelislay}, @file{owl}, @file{perrypierce}, @file{petunia}, +@file{pinacolada}, @file{skyra}, @file{truffleshuffle}. @item -Pony spelling removed: @code{fillycadence}. +Pony spelling removed: @file{fillycadence}. @item -Pony symlink change: @code{perry} → @{@code{pokey} → @code{perrypierce}@}. +Pony symlink change: @file{perry} → @{@file{pokey} → @file{perrypierce}@}. @item -@cindex @command{-L} -Option @command{-L} added, lists ponies with symlink mapping. +@cindex @option{-L} +Option @option{-L} added, lists ponies with symlink mapping. @item Support for extension: ponyquotes4ponysay. @item -@cindex @command{-f} -Accepts arbitrary spaces in @command{-f} argument. +@cindex @option{-f} +Accepts arbitrary spaces in @option{-f} argument. @end itemize + @heading Version 1.0 @itemize @bullet @item Spanish translation of the manpage is added. @item -@w{New ponies:} @code{applecore}, @code{applejackscarecrow}, @code{bonbonstand}, -@code{changeling}, @code{chrysalis}, @code{cottoncloudy}, @code{diamondmint}, -@code{discord}, @code{fillycadence}, @code{flam}, @code{fleurdelis}, @code{flim}, -@code{fluttershyshy}, @code{fluttershystare}, @code{lyrasit}, @w{@code{oinkoinkoink} -(is pinkie)}, @code{philomenaphoenix}, @code{pinkiecannon}, @code{pinkiecannonfront}, -@code{pinkiecannonhappy}, @code{pinkiegummy}, @code{pinkiehugfluttershy}, -@code{pinkiehugsfluttershy}, @code{pinkiepartycannon}, @code{pinkieprincess}, -@code{pinkiesilly}, @code{pinkietongue}, @code{pinkiewhoops}, @code{pinkiewhoopseat}, -@code{pinkiewhoopsout}, @code{rainbowdrag}, @code{rainbowsalute}, @code{rainbowshine}, -@code{raritydrama}, @code{shiningarmor}, @code{shiningarmorguard}, @code{snowflake}, -@code{spikemustache}, @code{stevenmagnet}, @code{stevenmagnettrue}, -@code{twilightcrazyfromball}, @code{twilightrage}, @code{twilightzero}, @code{wildfire}. +@w{New ponies:} @file{applecore}, @file{applejackscarecrow}, @file{bonbonstand}, +@file{changeling}, @file{chrysalis}, @file{cottoncloudy}, @file{diamondmint}, +@file{discord}, @file{fillycadence}, @file{flam}, @file{fleurdelis}, @file{flim}, +@file{fluttershyshy}, @file{fluttershystare}, @file{lyrasit}, @file{oinkoinkoink} +(is pinkie), @file{philomenaphoenix}, @file{pinkiecannon}, @file{pinkiecannonfront}, +@file{pinkiecannonhappy}, @file{pinkiegummy}, @file{pinkiehugfluttershy}, +@file{pinkiehugsfluttershy}, @file{pinkiepartycannon}, @file{pinkieprincess}, +@file{pinkiesilly}, @file{pinkietongue}, @file{pinkiewhoops}, @file{pinkiewhoopseat}, +@file{pinkiewhoopsout}, @file{rainbowdrag}, @file{rainbowsalute}, @file{rainbowshine}, +@file{raritydrama}, @file{shiningarmor}, @file{shiningarmorguard}, @file{snowflake}, +@file{spikemustache}, @file{stevenmagnet}, @file{stevenmagnettrue}, +@file{twilightcrazyfromball}, @file{twilightrage}, @file{twilightzero}, +@file{wildfire}. @item Pony symlinks added: @itemize @bullet -@item @code{djpon-3} → @code{vinyl} -@item @code{fillycadance} → @code{fillycadence} -@item @code{horsepower} → @code{snowflake} +@item @file{djpon-3} → @file{vinyl} +@item @file{fillycadance} → @file{fillycadence} +@item @file{horsepower} → @file{snowflake} @end itemize @item Improved TTY support: ponies have low colours resolution, instead of monochrome, when the high colour resolution is not available. @end itemize + @heading Version 0.10 @itemize @bullet @item Manpage manual added. @item -The directories for pony directories are changed from @code{/usr/share} to -@code{/usr/share/ponysay} and @code{~} to @code{~/.ponysay}. +The directories for pony directories are changed from @file{/usr/share} to +@file{/usr/share/ponysay} and @file{~} to @file{~/.ponysay}. @item Pony symlinks added: @itemize @bullet -@item @code{carrottop} → @code{carrot} -@item @code{goldenharvest} → @code{carrot} -@item @code{harpass} → @code{lyra} -@item @code{heartstrings} → @code{lyra} -@item @code{lulamoon} → @code{trixie} -@item @code{minuette} → @code{colgate} -@item @code{noteworthy} → @code{blues} -@item @code{perry} → @code{pokey} -@item @code{pokeypierce} → @code{pokey} -@item @code{timeturner} → @code{doctornohat} -@item @code{trixielulamoon} → @code{trixie} -@item @code{twilightvelvet} → @code{mrssparkle} +@item @file{carrottop} → @file{carrot} +@item @file{goldenharvest} → @file{carrot} +@item @file{harpass} → @file{lyra} +@item @file{heartstrings} → @file{lyra} +@item @file{lulamoon} → @file{trixie} +@item @file{minuette} → @file{colgate} +@item @file{noteworthy} → @file{blues} +@item @file{perry} → @file{pokey} +@item @file{pokeypierce} → @file{pokey} +@item @file{timeturner} → @file{doctornohat} +@item @file{trixielulamoon} → @file{trixie} +@item @file{twilightvelvet} → @file{mrssparkle} @end itemize @item Support for truncating output on height, enabled by default under TTY. @item -Environment variables added: @code{PONYSAY_FULL_WIDTH}, @code{PONYSAY_SHELL_LINES}, -@code{PONYSAY_TRUNCATE_HEIGHT}, @code{PONYSAY_BOTTOM}. +Environment variables added: @env{PONYSAY_FULL_WIDTH}, @env{PONYSAY_SHELL_LINES}, +@env{PONYSAY_TRUNCATE_HEIGHT}, @env{PONYSAY_BOTTOM}. @end itemize + @heading Version 0.9 @itemize @bullet @@ -1295,64 +1604,71 @@ Support for TTY (Linux VT). @item @command{zsh} completion added. @item -@w{New ponies}: @code{allie}, @code{archer}, @code{boxxy}, @code{carecake}, @code{cupcake}, -@code{daringdo}, @code{davenport}, @code{fancypants}, @code{ironwillwalk}, @code{lily}, -@code{lunafly}, @code{maredowellfly}, @code{maredowellgallop}, @code{master}, @code{mjolna}, -@code{orange}, @code{raritysdad}, @code{raritysmom}, @code{royalnightguard}, @code{ruby}, -@code{sparkler}, @code{violet}. +@w{New ponies}: @file{allie}, @file{archer}, @file{boxxy}, @file{carecake}, +@file{cupcake}, @file{daringdo}, @file{davenport}, @file{fancypants}, +@file{ironwillwalk}, @file{lily}, @file{lunafly}, @file{maredowellfly}, +@file{maredowellgallop}, @file{master}, @file{mjolna}, @file{orange}, +@file{raritysdad}, @file{raritysmom}, @file{royalnightguard}, @file{ruby}, +@file{sparkler}, @file{violet}. @end itemize + @heading Version 0.8 @itemize @bullet @item -@w{New ponies}: @code{aloe}, @code{angle}, @code{applebloom}, @code{applebumkin}, -@code{applefritter}, @code{berrypunch}, @code{bigmac}, @code{blinkie}, @code{blues}, -@code{braeburn}, @code{caesar}, @code{candymane}, @code{caramel}, @code{cheerilee}, -@code{cheerilee80}, @code{clyde}, @code{colgate}, @code{colton}, @code{daisy}, -@code{derpystand}, @code{derpystandwing}, @code{diamondtiara}, @code{dinky}, -@code{doctornohat}, @code{elsie}, @code{fido}, @code{fillycelestia}, @code{fillydash}, -@code{fillydashfly}, @code{fillyjack}, @code{fillyjacktravel}, @code{fillypinkie}, -@code{fillypinkiecurly}, @code{fillyrarity}, @code{fillyshy}, @code{fluttershygala}, -@code{gilda}, @code{gildastand}, @code{granny}, @code{grannychair}, @code{grannysleep}, -@code{gummy}, @code{hoity}, @code{horte}, @code{inky}, @code{laflour}, @code{lightning}, -@code{lintsalot}, @code{lotus}, @code{mayor}, @code{mrssparkle}, @code{nightmare}, -@code{opal}, @code{parasprite}, @code{philomena}, @code{photofinish}, @code{pinkamina}, -@code{pinkiebounce}, @code{pinkiechicken}, @code{pinkiegala}, @code{pipsqueak}, -@code{pokey}, @code{rainbowfly}, @code{rainbowgala}, @code{rainbowsleep}, @code{raindrops}, -@code{rarityfly}, @code{raritygala}, @code{rarityponder}, @code{redheart}, @code{rocky}, -@code{rose}, @code{rover}, @code{royalguard}, @code{sapphire}, @code{scootaloo}, -@code{screwball}, @code{shadowbolts}, @code{silverspoon}, @code{silverstar}, @code{sindy}, -@code{snails}, @code{snips}, @code{soarin}, @code{soigne}, @code{spike}, @code{spikefloat}, -@code{spikelove}, @code{spot}, @code{stella}, @code{strongheart}, @code{sue}, -@code{suedance}, @code{tank}, @code{trixiestage}, @code{trixiestand}, @code{turnip}, -@code{twist}, @code{winona}. +@w{New ponies}: @file{aloe}, @file{angle}, @file{applebloom}, @file{applebumkin}, +@file{applefritter}, @file{berrypunch}, @file{bigmac}, @file{blinkie}, @file{blues}, +@file{braeburn}, @file{caesar}, @file{candymane}, @file{caramel}, @file{cheerilee}, +@file{cheerilee80}, @file{clyde}, @file{colgate}, @file{colton}, @file{daisy}, +@file{derpystand}, @file{derpystandwing}, @file{diamondtiara}, @file{dinky}, +@file{doctornohat}, @file{elsie}, @file{fido}, @file{fillycelestia}, +@file{fillydash}, @file{fillydashfly}, @file{fillyjack}, @file{fillyjacktravel}, +@file{fillypinkie}, @file{fillypinkiecurly}, @file{fillyrarity}, @file{fillyshy}, +@file{fluttershygala}, @file{gilda}, @file{gildastand}, @file{granny}, +@file{grannychair}, @file{grannysleep}, @file{gummy}, @file{hoity}, @file{horte}, +@file{inky}, @file{laflour}, @file{lightning}, @file{lintsalot}, @file{lotus}, +@file{mayor}, @file{mrssparkle}, @file{nightmare}, @file{opal}, @file{parasprite}, +@file{philomena}, @file{photofinish}, @file{pinkamina}, @file{pinkiebounce}, +@file{pinkiechicken}, @file{pinkiegala}, @file{pipsqueak}, @file{pokey}, +@file{rainbowfly}, @file{rainbowgala}, @file{rainbowsleep}, @file{raindrops}, +@file{rarityfly}, @file{raritygala}, @file{rarityponder}, @file{redheart}, +@file{rocky}, @file{rose}, @file{rover}, @file{royalguard}, @file{sapphire}, +@file{scootaloo}, @file{screwball}, @file{shadowbolts}, @file{silverspoon}, +@file{silverstar}, @file{sindy}, @file{snails}, @file{snips}, @file{soarin}, +@file{soigne}, @file{spike}, @file{spikefloat}, @file{spikelove}, @file{spot}, +@file{stella}, @file{strongheart}, @file{sue}, @file{suedance}, @file{tank}, +@file{trixiestage}, @file{trixiestand}, @file{turnip}, @file{twist}, @file{winona}. @end itemize @b{Note}: Identifies itself as version 0.7 + @heading Version 0.7 @itemize @bullet @item -@w{New ponies}: @code{carrot}, @code{octavia}, @code{trixie}, @code{vinyl}, @code{zecora}. +@w{New ponies:} @file{carrot}, @file{octavia}, @file{trixie}, @file{vinyl}, +@file{zecora}. @item -@cindex @command{-l} -Support for listing ponies with @command{-l} option. +@cindex @option{-l} +Support for listing ponies with @option{-l} option. @end itemize + @heading Version 0.6 @itemize @bullet @item -@w{New ponies}: @code{bonbon}, @code{celestia}, @code{doctor}, @code{fillistia}, -@code{spitfire}, @w{@code{woona} (not moonstuck)}. +@w{New ponies:} @file{bonbon}, @file{celestia}, @file{doctor}, @file{fillistia}, +@file{spitfire}, @file{woona} (not moonstuck). @item Dropping usage of utility @command{which}, using @command{hash} instead. @end itemize @b{Note}: Identifies itself as version 0.5 + @heading Version 0.5 @itemize @bullet @@ -1360,51 +1676,55 @@ Dropping usage of utility @command{which}, using @command{hash} instead. Using utility @command{which} to determine existence of @command{cowsay}. @end itemize + @heading Version 0.4 @itemize @bullet @item -@code{.cow} files are removed. +@file{.cow} files are removed. @item -@cindex @command{-W} -Support for @command{-W} option. +@cindex @option{-W} +Support for @option{-W} option. @item Select random pony if not specified. @item -@cindex @command{-f} -@command{-f} supports file names, and not only pony names. +@cindex @option{-f} +@option{-f} supports file names, and not only pony names. @end itemize + @heading Version 0.3 @itemize @bullet @item -Fixed use of @code{.pony} files. +Fixed use of @file{.pony} files. @end itemize + @heading Version 0.2 @itemize @bullet @item -Pony files end with @code{.pony} instead of @code{.cow}. +Pony files end with @file{.pony} instead of @file{.cow}. @item -@code{lyrasleep} is renamed to @code{lyra}. +@file{lyrasleep} is renamed to @file{lyra}. @item -@code{.cow} files are kept but not used. +@file{.cow} files are kept but not used. @item -@cindex @command{-h} -@command{-h} prints proper help. +@cindex @option{-h} +@option{-h} prints proper help. @end itemize + @heading Version 0.1 First release. @itemize @bullet @item -@w{Includes the ponies}: @code{applejack}, @code{derpy}, @code{derpysit}, -@code{fluttershy}, @code{luna}, @code{lyrasleep}, @code{pinkie}, @code{rainbow}, -@code{rarity}, @code{sweetie}, @code{twilight}. +@w{Includes the ponies}: @file{applejack}, @file{derpy}, @file{derpysit}, +@file{fluttershy}, @file{luna}, @file{lyrasleep}, @file{pinkie}, @file{rainbow}, +@file{rarity}, @file{sweetie}, @file{twilight}. @end itemize diff --git a/manuals/ponysay_front.xcf b/manuals/ponysay_front.xcf Binary files differindex 9ba8d0d..c785502 100644 --- a/manuals/ponysay_front.xcf +++ b/manuals/ponysay_front.xcf diff --git a/ponies/pinkieoink.pony b/ponies/pinkieoink.pony new file mode 120000 index 0000000..7f9fd2b --- /dev/null +++ b/ponies/pinkieoink.pony @@ -0,0 +1 @@ +./oinkoinkoink.pony
\ No newline at end of file diff --git a/ponyquotes/ponies b/ponyquotes/ponies index 99b79a2..0834dcd 100644 --- a/ponyquotes/ponies +++ b/ponyquotes/ponies @@ -91,7 +91,7 @@ photofinish pinacolada pinkamina pinkie+pinkiecannonfront+pinkiecannon+pinkiebounce+pinkiecannonhappy+pinkiegala+pinkiechicken+pinkiehugfluttershy+pinkiegummy+pinkietongue+pinkiesilly -pinkie+pinkiepartycannon+pinkieprincess+pinkiehugsfluttershy+pinkiewhoops+oinkoinkoink+pinkiewhoopsout+pinkiewhoopseat+fillypinkie+fillypinkiecurly +pinkie+pinkiepartycannon+pinkieprincess+pinkiehugsfluttershy+pinkiewhoops+oinkoinkoink+pinkiewhoopsout+pinkiewhoopseat+fillypinkie+fillypinkiecurly+pinkieoink pipsqueak pokey+pokeypierce ponet @@ -16,6 +16,7 @@ License: WTFPL ''' import os +import shutil import sys import random from subprocess import Popen, PIPE @@ -24,7 +25,7 @@ from subprocess import Popen, PIPE ''' The version of ponysay ''' -VERSION = '2.2' +VERSION = '2.3' ''' @@ -46,9 +47,6 @@ class Ponysay(): args.help() return - if (args.opts['-l'] is not None) and pipelineout: - args.opts['--onelist'] = args.opts['-l'] - args.opts['-l'] = None if args.opts['-h'] is not None: args.help() elif args.opts['--quoters'] is not None: self.quoters() @@ -56,8 +54,83 @@ class Ponysay(): elif args.opts['-v'] is not None: self.version() elif args.opts['-l'] is not None: self.list() elif args.opts['-L'] is not None: self.linklist() - elif args.opts['-q'] is not None: self.quote(args) - else: self.print_pony(args) + elif args.opts['-B'] is not None: self.balloonlist() + elif args.opts['++onelist'] is not None: self.__extraponies(); self.onelist() + elif args.opts['+l'] is not None: self.__extraponies(); self.list() + elif args.opts['+L'] is not None: self.__extraponies(); self.linklist() + else: + self.__extraponies(args) + self.__bestpony(args) + self.__ucsremap(args) + if args.opts['-q'] is not None: self.quote(args) + else: self.print_pony(args) + + + ## + ## Methods that run before the mane methods + ## + + ''' + Use extra ponies + ''' + def __extraponies(self, args = None): + if args is None: + ponydirs[:] = extraponydirs + elif args.opts['-F'] is not None: + args.opts['-f'] = args.opts['-F'] + ponydirs[:] = extraponydirs + + + ''' + Use best.pony if nothing else is set + ''' + def __bestpony(self, args): + if (args.opts['-f'] is None) or (args.opts['-q'] is None) or (len(args.opts['-q']) == 0): + for ponydir in ponydirs: + if os.path.isfile(ponydir + 'best.pony') or os.path.islink(ponydir + 'best.pony'): + pony = os.path.realpath(ponydir + 'best.pony') # Canonical path + if args.opts['-q'] is not None: args.opts['-q'] = [pony] + else: args.opts['-f'] = [pony] + break + + + ''' + Apply pony name remapping to args according to UCS settings + ''' + def __ucsremap(self, args): + env_ucs = os.environ['PONYSAY_UCS_ME'] if 'PONYSAY_UCS_ME' in os.environ else '' + ucs_conf = 0 + if env_ucs in ('yes', 'y', '1'): ucs_conf = 1 + elif env_ucs in ('harder', 'h', '2'): ucs_conf = 2 + + if ucs_conf == 0: + return + + maplines = [] + for sharedir in sharedirs: + if os.path.isfile(sharedir + 'ucsmap'): + mapfile = None + try: + mapfile = open(sharedir + 'ucsmap', 'r') + maplines += [line.replace('\n', '') for line in mapfile.readlines()] + finally: + if mapfile is not None: + mapfile.close() + + map = {} + stripset = ' \t' # must be string, wtf! and way doesn't python's doc say so + for line in maplines: + if (len(line) > 0) and not (line[0] == '#'): + s = line.index('→') + ucs = line[:s] .strip(stripset) + ascii = line[s + 1:].strip(stripset) + map[ucs] = ascii + + for flag in ('-f', '-q'): + if args.opts[flag] is not None: + for i in range(0, len(args.opts[flag])): + if args.opts[flag][i] in map: + args.opts[flag][i] = map[args.opts[flag][i]] ## @@ -65,22 +138,66 @@ class Ponysay(): ## ''' - Returns one file with full path, names is filter for names, also accepts filepaths. + Apply USC:ise pony names according to UCS settings + ''' + def __ucsise(self, ponies, links = None): + env_ucs = os.environ['PONYSAY_UCS_ME'] if 'PONYSAY_UCS_ME' in os.environ else '' + ucs_conf = 0 + if env_ucs in ('yes', 'y', '1'): ucs_conf = 1 + elif env_ucs in ('harder', 'h', '2'): ucs_conf = 2 + + if ucs_conf == 0: + return + + maplines = [] + for sharedir in sharedirs: + if os.path.isfile(sharedir + 'ucsmap'): + mapfile = None + try: + mapfile = open(sharedir + 'ucsmap', 'r') + maplines += [line.replace('\n', '') for line in mapfile.readlines()] + finally: + if mapfile is not None: + mapfile.close() + + map = {} + stripset = ' \t' # must be string, wtf! and way doesn't python's doc say so + for line in maplines: + if (len(line) > 0) and not (line[0] == '#'): + s = line.index('→') + ucs = line[:s] .strip(stripset) + ascii = line[s + 1:].strip(stripset) + map[ascii] = ucs + + if ucs_conf == 1: + for pony in ponies: + if pony in map: + ponies.append(map[pony]) + if links is not None: + links[map[pony]] = pony + else: + for j in range(0, len(ponies)): + if ponies[j] in map: + ponies[j] = map[ponies[j]] + + + ''' + Returns one file with full path, names is filter for names, also accepts filepaths ''' def __getponypath(self, names = None): ponies = {} - if not names == None: - for name in names: - if os.path.isfile(name): - ponies[name] = name - for ponydir in ponydirs: for ponyfile in os.listdir(ponydir): pony = ponyfile[:-5] if pony not in ponies: ponies[pony] = ponydir + ponyfile + if not names == None: + for name in names: + if os.path.exists(name): + ponies[name] = name + if names == None: names = list(ponies.keys()) @@ -152,6 +269,7 @@ class Ponysay(): return termsize + ## ## Listing methods ## @@ -164,24 +282,30 @@ class Ponysay(): quoters = self.__quoters() for ponydir in ponydirs: # Loop ponydirs - print('\033[1mponyfiles located in ' + ponydir + '\033[21m') - - ponies = os.listdir(ponydir) - ponies = [item[:-5] for item in ponies] # remove .pony from file name + _ponies = os.listdir(ponydir) + ponies = [] + for pony in _ponies: + if (len(pony) > 5) and (pony[-5:] == '.pony'): + ponies.append(pony[:-5]) + self.__ucsise(ponies) ponies.sort() - width = len(max(ponies, key = len)) + 2 # Get the longest ponyfilename lenght + 2 spaces + if len(ponies) == 0: + continue + print('\033[1mponies located in ' + ponydir + '\033[21m') + + width = UCS.dispLen(max(ponies, key = UCS.dispLen)) + 2 # Get the longest ponyfilename lenght + 2 spaces x = 0 for pony in ponies: - spacing = ' ' * (width - len(pony)) + spacing = ' ' * (width - UCS.dispLen(pony)) print(('\033[1m' + pony + '\033[21m' if (pony in quoters) else pony) + spacing, end='') # Print ponyfilename x += width if x > (termsize[1] - width): # If too wide, make new line print() x = 0 - - print('\n'); + + print('' if x == 0 else '\n'); ''' @@ -192,16 +316,28 @@ class Ponysay(): quoters = self.__quoters() for ponydir in ponydirs: # Loop ponydirs - print('\033[1mponyfiles located in ' + ponydir + '\033[21m') + _ponies = os.listdir(ponydir) + ponies = [] + for pony in _ponies: + if (len(pony) > 5) and (pony[-5:] == '.pony'): + ponies.append(pony[:-5]) - files = os.listdir(ponydir) - files = [item[:-5] for item in files] # remove .pony from file name - files.sort() - pairs = [(item, os.readlink(ponydir + item + '.pony') if os.path.islink(ponydir + item + '.pony') else '') for item in files] + if len(ponies) == 0: + continue + print('\033[1mponies located in ' + ponydir + '\033[21m') + + pseudolinkmap = {} + self.__ucsise(ponies, pseudolinkmap) ##TODO + pairs = [] + for pony in ponies: + if pony in pseudolinkmap: + pairs.append((pony, pseudolinkmap[pony] + '.pony')); + else: + pairs.append((pony, os.path.realpath(ponydir + pony + '.pony') if os.path.islink(ponydir + pony + '.pony') else None)) ponymap = {} for pair in pairs: - if pair[1] == '': + if (pair[1] is None) or (pair[1] == ''): if pair[0] not in ponymap: ponymap[pair[0]] = [] else: @@ -214,42 +350,43 @@ class Ponysay(): ponymap[target] = [pair[0]] width = 0 - ponies = [] - widths = [] + ponies = {} for pony in ponymap: - w = len(pony) + w = UCS.dispLen(pony) item = '\033[1m' + pony + '\033[21m' if (pony in quoters) else pony syms = ponymap[pony] + syms.sort() if len(syms) > 0: w += 2 + len(syms) item += ' (' first = True for sym in syms: - w += len(sym) + w += UCS.dispLen(sym) if not first: item += ' ' else: first = False item += '\033[1m' + sym + '\033[21m' if (sym in quoters) else sym item += ')' - ponies.append(item) - widths.append(w) + ponies[item] = w if width < w: width = w width += 2; x = 0 index = 0 - for pony in ponies: - spacing = ' ' * (width - widths[index]) + ponylist = list(ponies) + ponylist.sort(key = lambda pony : pony.split(' ')[0].replace('\033[1m', '').replace('\033[21m', '')) + for pony in ponylist: + spacing = ' ' * (width - ponies[pony]) index += 1 - print(pony + spacing, end='') # Print ponyfilename + print(pony + spacing, end='') # Print pony file name x += width - if x > (termsize[1] - width): # If too wide, make new line + if x > termsize[1] - width: # If too wide, make new line print() x = 0 - print('\n'); + print('' if x == 0 else '\n'); ''' @@ -260,6 +397,7 @@ class Ponysay(): ponies = [] for pony in self.__quoters(): ponies.append(pony) + self.__ucsise(ponies) ponies.sort() for pony in ponies: if not pony == last: @@ -272,10 +410,14 @@ class Ponysay(): ''' def onelist(self): last = '' - ponies = [] + _ponies = [] for ponydir in ponydirs: # Loop ponydirs - ponies += os.listdir(ponydir) - ponies = [item[:-5] for item in ponies] # remove .pony from file name + _ponies += os.listdir(ponydir) + ponies = [] + for pony in _ponies: + if (len(pony) > 5) and (pony[-5:] == '.pony'): + ponies.append(pony[:-5]) + self.__ucsise(ponies) ponies.sort() for pony in ponies: if not pony == last: @@ -283,6 +425,118 @@ class Ponysay(): print(pony) + + ## + ## Balloon methods + ## + + ''' + Prints a list of all balloons + ''' + def balloonlist(self): + termsize = self.__gettermsize() + balloonset = set() + + for balloondir in balloondirs: + for balloon in os.listdir(balloondir): + if isthink and (len(balloon) > 6) and (balloon[-6:] == '.think'): + balloon = balloon[:-6] + elif (not isthink) and (len(balloon) > 4) and (balloon[-4:] == '.say'): + balloon = balloon[:-4] + else: + continue + if balloon not in balloonset: + balloonset.add(balloon) + + balloons = list(balloonset) + balloons.sort() + + width = UCS.dispLen(max(balloons, key = UCS.dispLen)) + 2 + + x = 0 + for balloon in balloons: + spacing = ' ' * (width - UCS.dispLen(balloon)) + print(balloon + spacing, end='') + x += width + if x > (termsize[1] - width): + print() + x = 0 + + print(); + + + ''' + Returns one file with full path, names is filter for style names, also accepts filepaths + ''' + def __getballoonpath(self, names): + if names is None: + return None + balloons = {} + + for balloondir in balloondirs: + for balloon in os.listdir(balloondir): + balloonfile = balloon + if isthink and (len(balloon) > 6) and (balloon[-6:] == '.think'): + balloon = balloon[:-6] + elif (not isthink) and (len(balloon) > 4) and (balloon[-4:] == '.say'): + balloon = balloon[:-4] + else: + continue + if balloon not in balloons: + balloons[balloon] = balloondir + balloonfile + + for name in names: + if os.path.exists(name): + balloons[name] = name + + if names == None: + names = list(balloons.keys()) + + balloon = names[random.randrange(0, len(names))] + if balloon not in balloons: + sys.stderr.write('That balloon style %s does not exist\n' % (balloon)); + exit(1) + else: + return balloons[balloon] + + + ''' + Creates the balloon style object + ''' + def __getballoon(self, balloonfile): + if balloonfile is None: + if isthink: + return Balloon('o', 'o', '( ', ' )', [' _'], ['_'], ['_'], ['_'], ['_ '], ' )', ' )', ' )', ['- '], ['-'], ['-'], ['-'], [' -'], '( ', '( ', '( ') + return Balloon('\\', '/', '< ', ' >', [' _'], ['_'], ['_'], ['_'], ['_ '], ' \\', ' |', ' /', ['- '], ['-'], ['-'], ['-'], [' -'], '\\ ', '| ', '/ ') + + map = {} + for elem in ('\\', '/', 'ww', 'ee', 'nw', 'nnw', 'n', 'nne', 'ne', 'nee', 'e', 'see', 'se', 'sse', 's', 'ssw', 'sw', 'sww', 'w', 'nww'): + map[elem] = [] + + balloonstream = None + try: + balloonstream = open(balloonfile, 'r') + data = [line.replace('\n', '') for line in balloonstream.readlines()] + finally: + if balloonstream is not None: + balloonstream.close() + + last = None + for line in data: + if len(line) > 0: + if line[0] == ':': + map[last].append(line[1:]) + else: + last = line[:line.index(':')] + value = line[len(last) + 1:] + map[last].append(value) + + return Balloon(map['\\'][0], map['/'][0], map['ww'][0], map['ee'][0], map['nw'], map['nnw'], map['n'], + map['nne'], map['ne'], map['nee'][0], map['e'][0], map['see'][0], map['se'], map['sse'], + map['s'], map['ssw'], map['sw'], map['sww'][0], map['w'][0], map['nww'][0]) + + + ## ## Displaying methods ## @@ -303,6 +557,25 @@ class Ponysay(): else: msg = args.message + if args.opts['-c'] is not None: ## This algorithm should give some result as cowsay's (according to tests) + buf = '' + last = ' ' + CHARS = '\t \n' + for c in msg: + if (c in CHARS) and (last in CHARS): + if last == '\n': + buf += last + last = c + else: + buf += c + last = c + msg = buf.strip(CHARS) + buf = '' + for c in msg: + if (c != '\n') or (last != '\n'): + buf += c + last = c + msg = buf.replace('\n', '\n\n') pony = self.__getponypath(args.opts['-f']) @@ -323,7 +596,9 @@ class Ponysay(): widthtruncation = self.__gettermsize()[1] if env_width not in ('yes', 'y', '1') else None messagewrap = int(args.opts['-W'][0]) if args.opts['-W'] is not None else None - backend = Backend(message = msg, ponyfile = pony, wrapcolumn = messagewrap if messagewrap is not None else 40, width = widthtruncation) + balloon = self.__getballoon(self.__getballoonpath(args.opts['-b'])) + + backend = Backend(message = msg, ponyfile = pony, wrapcolumn = messagewrap if messagewrap is not None else 40, width = widthtruncation, balloon = balloon) backend.parse() output = backend.output if (len(output) > 0) and (output[-1] == '\n'): @@ -359,11 +634,19 @@ class Ponysay(): def quote(self, args): pairs = self.__quotes() if len(args.opts['-q']) > 0: - ponyset = set(args.opts['-q']) + ponyset = {} + for pony in args.opts['-q']: + if (len(pony) > 5) and (pony[-5:] == '.pony'): + ponyname = pony[:-5] + if '/' in ponyname: + ponyname = ponyname[ponyname.rindex('/') + 1:] + ponyset[ponyname] = pony + else: + ponyset[pony] = pony alts = [] for pair in pairs: if pair[0] in ponyset: - alts.append(pair) + alts.append((ponyset[pair[0]], pair[1])) pairs = alts if not len(pairs) == 0: @@ -377,11 +660,11 @@ class Ponysay(): qfile.close() args.opts['-f'] = [pair[0]] elif len(args.opts['-q']) == 0: - sys.stderr.write('All the ponies are mute! Call the Princess!\n') + sys.stderr.write('Princess Celestia! All the ponies are mute!\n') exit(1) else: args.opts['-f'] = [args.opts['-q'][random.randrange(0, len(args.opts['-q']))]] - args.message = 'I got nuthin\' good to say :(' + args.message = 'Zecora! Help me, I am mute!' self.print_pony(args) @@ -413,6 +696,8 @@ class Ponysay(): if not linuxvt: return pony + KMS_VERSION = '1' + env_kms = os.environ['PONYSAY_KMS_PALETTE'] if 'PONYSAY_KMS_PALETTE' in os.environ else None if env_kms is None: env_kms = '' @@ -434,6 +719,33 @@ class Ponysay(): if not os.path.isdir(cachedir): os.makedirs(cachedir) + newversion = False + if not os.path.isfile(cachedir + '/.version'): + newversion = True + else: + cachev = None + try: + cachev = open(cachedir + '/.version', 'r') + if ''.join(cachev.readlines()) == KMS_VERSION: + newversion = True + finally: + if cachev is not None: + cachev.close() + if newversion: + for cached in os.listdir(cachedir): + cached = cachedir + '/' + cached + if os.path.isdir(cached) and not os.path.islink(cached): + shutil.rmtree(cached, False) + else: + os.remove(cached) + cachev = None + try: + cachev = open(cachedir + '/.version', 'w+') + cachev.write(KMS_VERSION) + finally: + if cachev is not None: + cachev.close() + kmsponies = cachedir + '/kmsponies/' + palettefile kmspony = (kmsponies + pony).replace('//', '/') @@ -649,7 +961,7 @@ class ArgParser(): if first: first = False else: - print(' or', end="") + print(' or', end='') print('\t%s' % (line)) print() @@ -684,20 +996,93 @@ class ArgParser(): ''' +Balloon format class +''' +class Balloon(): + ''' + Constructor + ''' + def __init__(self, link, linkmirror, ww, ee, nw, nnw, n, nne, ne, nee, e, see, se, sse, s, ssw, sw, sww, w, nww): + (self.link, self.linkmirror) = (link, linkmirror) + (self.ww, self.ee) = (ww, ee) + (self.nw, self.ne, self.se, self.sw) = (nw, ne, se, sw) + (self.nnw, self.n, self.nne) = (nnw, n, nne) + (self.nee, self.e, self.see) = (nee, e, see) + (self.sse, self.s, self.ssw) = (sse, s, ssw) + (self.sww, self.w, self.nww) = (sww, w, nww) + + _ne = max(ne, key = UCS.dispLen) + _nw = max(nw, key = UCS.dispLen) + _se = max(se, key = UCS.dispLen) + _sw = max(sw, key = UCS.dispLen) + + minE = UCS.dispLen(max([_ne, nee, e, see, _se, ee], key = UCS.dispLen)) + minW = UCS.dispLen(max([_nw, nww, e, sww, _sw, ww], key = UCS.dispLen)) + minN = len(max([ne, nne, n, nnw, nw], key = len)) + minS = len(max([se, sse, s, ssw, sw], key = len)) + + self.minwidth = minE + minE + self.minheight = minN + minS + + + ''' + Generates a balloon with a message + ''' + def get(self, minw, minh, lines, lencalc): + h = self.minheight + len(lines) + w = self.minwidth + lencalc(max(lines, key = lencalc)) + if w < minw: w = minw + if h < minh: h = minh + + if len(lines) > 1: + (ws, es) = ({0 : self.nww, len(lines) - 1 : self.sww}, {0 : self.nee, len(lines) - 1 : self.see}) + for j in range(1, len(lines) - 1): + ws[j] = self.w + es[j] = self.e + else: + (ws, es) = ({0 : self.ww}, {0 : self.ee}) + + rc = [] + + for j in range(0, len(self.n)): + outer = UCS.dispLen(self.nw[j]) + UCS.dispLen(self.ne[j]) + inner = UCS.dispLen(self.nnw[j]) + UCS.dispLen(self.nne[j]) + if outer + inner >= w: + rc.append(self.nw[j] + self.nnw[j] + self.n[j] * (w - outer - inner) + self.nne[j] + self.ne[j]) + else: + rc.append(self.nw[j] + self.n[j] * (w - outer) + self.ne[j]) + + for j in range(0, len(lines)): + rc.append(ws[j] + lines[j] + ' ' * (w - lencalc(lines[j]) - UCS.dispLen(self.w) - UCS.dispLen(self.e)) + es[j]) + + for j in range(0, len(self.s)): + outer = UCS.dispLen(self.sw[j]) + UCS.dispLen(self.se[j]) + inner = UCS.dispLen(self.ssw[j]) + UCS.dispLen(self.sse[j]) + if outer + inner >= w: + rc.append(self.sw[j] + self.ssw[j] + self.s[j] * (w - outer - inner) + self.sse[j] + self.se[j]) + else: + rc.append(self.sw[j] + self.s[j] * (w - outer) + self.se[j]) + + return '\n'.join(rc) + + + +''' Replacement for cowsay ''' class Backend(): ''' Constructor - Takes message [string], ponyfile [filename string], wrapcolumn [None or an int] and width [None or an int] + Takes message [string], ponyfile [filename string], wrapcolumn [None or an int], width [None or an int] and balloon [Balloon object] ''' - def __init__(self, message, ponyfile, wrapcolumn, width): + def __init__(self, message, ponyfile, wrapcolumn, width, balloon): self.message = message self.ponyfile = ponyfile self.wrapcolumn = wrapcolumn self.width = width + self.balloon = balloon - self.link = {'\\' : '\\', '/' : '/'} if not isthink else {'\\' : 'o', '/' : 'o'} + self.link = {'\\' : self.balloon.link, '/' : self.balloon.linkmirror} self.output = '' self.pony = None @@ -734,7 +1119,8 @@ class Backend(): x += nx else: buf += c - x += 1 + if not UCS.isCombining(c): + x += 1 buf += '\n' self.message = buf[:-1] @@ -772,7 +1158,8 @@ class Backend(): else: if x < self.width: self.output += c - x += 1 + if not UCS.isCombining(c): + x += 1 self.output += '\n' self.output = self.output[:-1] @@ -878,7 +1265,7 @@ class Backend(): datalen = self.__len(data) skip += datalen nonskip += datalen - data = data.replace("$", '$$') + data = data.replace('$', '$$') n += len(data) self.pony = self.pony[:i] + data + self.pony[i:] balloonLines[balloonLine] = None @@ -887,7 +1274,8 @@ class Backend(): if nonskip > 0: nonskip -= 1 self.output += c + colourstack.feed(c); - indent += 1 + if not UCS.isCombining(c): + indent += 1 else: skip -= 1 @@ -947,7 +1335,8 @@ class Backend(): i += len(self.__getcolour(input, i)) else: i += 1 - rc += 1 + if not UCS.isCombining(c): + rc += 1 return rc @@ -958,24 +1347,15 @@ class Backend(): wrap = None if self.wrapcolumn is not None: wrap = self.wrapcolumn - left + if wrap < 8: + wrap = 8 msg = self.message if wrap is not None: msg = self.__wrapMessage(msg, wrap) lines = msg.split('\n') - h = 4 + len(lines) - w = 6 + len(max(lines, key = len)) - if w < width: w = width - if h < height: h = height - - rc = '/' + '-' * (w - 2) + '\\\n' - rc += '|' + ' ' * (w - 2) + '|\n' - for line in lines: - rc += '| ' + line + ' ' * (w - len(line) - 6) + ' |\n' - rc += '|' + ' ' * (w - 2) + '|\n' - rc += '\\' + '-' * (w - 2) + '/' - return rc + return self.balloon.get(width, height, lines, self.__len) ''' @@ -1029,7 +1409,8 @@ class Backend(): indentc += 1 b[bi] = d bi += 1 - cols += 1 + if not UCS.isCombining(d): + cols += 1 map[cols] = bi else: mm = 0 @@ -1074,7 +1455,7 @@ class Backend(): w -= indentc buf += '\n' - return buf[:-1] + return '\n'.join(line.rstrip() for line in buf[:-1].split('\n')) ''' @@ -1092,48 +1473,135 @@ class ColourStack(): self.bufproto = ' ' * (self.lenpush if self.lenpush > self.lenpop else self.lenpop) self.stack = [] self.push() + self.seq = None def push(self): - self.stack = [[self.bufproto]] + self.stack + self.stack = [[self.bufproto, None, None, [False] * 9]] + self.stack if len(self.stack) == 1: - return '' - return '' + return None + old = self.stack[1] + rc = '\033[' + if old[1] is not None: rc += '39;' + if old[2] is not None: rc += '49;' + for i in range(0, 9): + if old[3][i]: + rc += '2%i;' % (i + 1) + return '' if len(rc) == 2 else (rc[:-1] + 'm') def pop(self): - return '' + old = self.stack[0] + self.stack = self.stack[1:] + rc = '\033[' + if old[1] is not None: rc += '39;' + if old[2] is not None: rc += '49;' + for i in range(0, 9): + if old[3][i]: + rc += str(i + 21) + ';' + new = self.stack[0] + if new[1] is not None: rc += new[1] + ';' + if new[2] is not None: rc += new[2] + ';' + for i in range(0, 9): + if new[3][i]: + rc += str(i + 1) + ';' + return '' if len(rc) == 2 else (rc[:-1] + 'm') def feed(self, char): + if self.seq is not None: + self.seq += char + if (char == '~') or (('a' <= char) and (char <= 'z')) or (('A' <= char) and (char <= 'Z')): + if (self.seq[0] == '[') and (self.seq[-1] == 'm'): + self.seq = self.seq[1:-1].split(';') + (i, n) = (0, len(self.seq)) + while i < n: + part = self.seq[i] + p = 0 if part == '' else int(part) + i += 1 + if p == 0: self.stack[0][1:] = [None, None, [False] * 9] + elif (1 <= p) and (p <= 9): self.stack[0][3][p - 1] = True + elif (21 <= p) and (p <= 29): self.stack[0][3][p - 21] = False + elif p == 39: self.stack[0][1] = None + elif p == 49: self.stack[0][2] = None + elif (30 <= p) and (p <= 37): self.stack[0][1] = part + elif (90 <= p) and (p <= 97): self.stack[0][1] = part + elif (40 <= p) and (p <= 47): self.stack[0][2] = part + elif (100 <= p) and (p <= 107): self.stack[0][2] = part + elif p == 38: + self.stack[0][1] = '%s;%s;%s' % (part, self.seq[i], self.seq[i + 1]) + i += 2 + elif p == 48: + self.stack[0][2] = '%s;%s;%s' % (part, self.seq[i], self.seq[i + 1]) + i += 2 + self.seq = None + elif char == '\033': + self.seq = '' buf = self.stack[0][0] + buf = buf[1:] + char rc = '' - if buf[:-self.lenpush] == self.autopush: - rc = self.push() - elif buf[:-self.lenpop] == self.autopop: - rc = self.pop() - self.stack[0][0] = buf[1:] + char + if buf[-self.lenpush:] == self.autopush: rc = self.push() + elif buf[-self.lenpop:] == self.autopop: rc = self.pop() + self.stack[0][0] = buf return rc +''' +UCS utility class +''' +class UCS(): + ''' + Checks whether a character is a combining character + ''' + @staticmethod + def isCombining(char): + o = ord(char) + if (0x0300 <= o) and (o <= 0x036F): return True + if (0x20D0 <= o) and (o <= 0x20FF): return True + if (0x1DC0 <= o) and (o <= 0x1DFF): return True + if (0xFE20 <= o) and (o <= 0xFE2F): return True + return False + + + ''' + Gets the number of combining characters in a string + ''' + @staticmethod + def countCombining(string): + rc = 0 + for char in string: + if UCS.isCombining(char): + rc += 1 + return rc + + + ''' + Gets length of a string not counting combining characters + ''' + @staticmethod + def dispLen(string): + return len(string) - UCS.countCombining(string) + + ''' The user's home directory ''' -HOME = os.environ['HOME'] +HOME = os.environ['HOME'] if 'HOME' in os.environ else os.path.expanduser('~') ''' Whether the program is execute in Linux VT (TTY) ''' -linuxvt = os.environ['TERM'] == 'linux' +linuxvt = ('TERM' in os.environ) and (os.environ['TERM'] == 'linux') ''' Whether the script is executed as ponythink ''' -isthink = (len(__file__) >= 8) and (__file__[-8:] == 'think.py') +isthink = (len(__file__) >= 5) and (__file__[-5:] == 'think') +isthink = ((len(__file__) >= 8) and (__file__[-8:] == 'think.py')) or isthink ''' @@ -1144,7 +1612,7 @@ pipelinein = not sys.stdin.isatty() ''' Whether stdout is piped ''' -pipelineout = False #not sys.stdout.isatty() # currently impossible, we need to get rid of the little shell script first +pipelineout = not sys.stdout.isatty() ''' Whether stderr is piped @@ -1153,36 +1621,72 @@ pipelineerr = not sys.stderr.isatty() ''' -The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) +Whether KMS is used +''' +usekms = Ponysay.isUsingKMS() + + +''' +Root share/ directories +''' +sharedirs = [] +_sharedirs = [HOME + '/.local/share/ponysay/', INSTALLDIR + '/share/ponysay/'] +for sharedir in _sharedirs: + if os.path.isdir(sharedir): + sharedirs.append(sharedir) + + +''' +The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) and not with KMS ''' ponydirs = [] -_kms = Ponysay.isUsingKMS() -if linuxvt and not _kms: _ponydirs = [HOME + '/.local/share/ponysay/ttyponies/', INSTALLDIR + '/share/ponysay/ttyponies/'] -else: _ponydirs = [HOME + '/.local/share/ponysay/ponies/', INSTALLDIR + '/share/ponysay/ponies/' ] +if linuxvt and not usekms: _ponydirs = [d + 'ttyponies/' for d in sharedirs] +else: _ponydirs = [d + 'ponies/' for d in sharedirs] for ponydir in _ponydirs: if os.path.isdir(ponydir): ponydirs.append(ponydir) ''' +The directories where pony files are stored, extrattyponies/ are used if the terminal is Linux VT (also known as TTY) and not with KMS +''' +extraponydirs = [] +if linuxvt and not usekms: _extraponydirs = [d + 'extrattyponies/' for d in sharedirs] +else: _extraponydirs = [d + 'extraponies/' for d in sharedirs] +for extraponydir in _extraponydirs: + if os.path.isdir(extraponydir): + extraponydirs.append(extraponydir) + + +''' The directories where quotes files are stored ''' quotedirs = [] -_quotedirs = [HOME + '/.local/share/ponysay/quotes/', INSTALLDIR + '/share/ponysay/quotes/'] +_quotedirs = [d + 'quotes/' for d in sharedirs] for quotedir in _quotedirs: if os.path.isdir(quotedir): quotedirs.append(quotedir) +''' +The directories where balloon style files are stored +''' +balloondirs = [] +_balloondirs = [d + 'balloons/' for d in sharedirs] +for balloondir in _balloondirs: + if os.path.isdir(balloondir): + balloondirs.append(balloondir) + + usage_saythink = '\033[34;1m(ponysay | ponythink)\033[21;39m' -usage_wrap = '--wrap \033[4mCOLUMN\033[24m' -usage_listhelp = '(--list | ---altlist | --version | --help)' -usage_file = '[--pony \033[4mPONY\033[24m]... ([--] \033[4mmessage\033[24m | <<<\033[4mmessage\033[24m)' -usage_quote = '--quote [\033[4mPONY\033[24m...]' +usage_common = '[-c] [-W \033[4mCOLUMN\033[24m] [-b \033[4mSTYLE\033[24m]' +usage_listhelp = '(-l | -L | -B | +l | +L | -v | -h)' +usage_file = '[(-f | -F) \033[4mPONY\033[24m]... ([--] \033[4mmessage\033[24m | <<<\033[4mmessage\033[24m)' +usage_quote = '-q [\033[4mPONY\033[24m...]' -usage = '%s %s\n%s [%s] %s\n%s [%s] %s' % (usage_saythink, usage_listhelp, - usage_saythink, usage_wrap, usage_file, - usage_saythink, usage_wrap, usage_quote) +usage = '%s %s\n%s %s %s\n%s %s %s' % (usage_saythink, usage_listhelp, + usage_saythink, usage_common, usage_file, + usage_saythink, usage_common, usage_quote) usage = usage.replace('\033[', '\0') for sym in ('[', ']', '(', ')', '|', '...'): @@ -1203,14 +1707,21 @@ run `man ponysay`. Ponysay has so much more to offer than described here.''') opts.add_argumentless(['--quoters']) opts.add_argumentless(['--onelist']) +opts.add_argumentless(['++onelist']) -opts.add_argumentless(['-h', '--help'], help = 'Print this help message.') -opts.add_argumentless(['-v', '--version'], help = 'Print the version of the program.') -opts.add_argumentless(['-l', '--list'], help = 'List pony files.') -opts.add_argumentless(['-L', '--altlist'], help = 'List pony files with alternatives.') -opts.add_argumented( ['-W', '--wrap'], arg = "COLUMN", help = 'Specify the column when the message should be wrapped.') -opts.add_argumented( ['-f', '--pony'], arg = "PONY", help = 'Select a pony.\nEither a file name or a pony name.') -opts.add_variadic( ['-q', '--quote'], arg = "PONY", help = 'Select a ponies which will quote themself.') +opts.add_argumentless(['-h', '--help'], help = 'Print this help message.') +opts.add_argumentless(['-v', '--version'], help = 'Print the version of the program.') +opts.add_argumentless(['-l', '--list'], help = 'List pony names.') +opts.add_argumentless(['-L', '--altlist'], help = 'List pony names with alternatives.') +opts.add_argumentless(['+l', '++list'], help = 'List non-MLP:FiM pony names.') +opts.add_argumentless(['+L', '++altlist'], help = 'List non-MLP:FiM pony names with alternatives.') +opts.add_argumentless(['-B', '--balloonlist'], help = 'List balloon styles.') +opts.add_argumentless(['-c', '--compact'], help = 'Compress messages.') +opts.add_argumented( ['-W', '--wrap'], arg = 'COLUMN', help = 'Specify the column when the message should be wrapped.') +opts.add_argumented( ['-b', '--bubble', '--balloon'], arg = 'STYLE', help = 'Select a balloon style.') +opts.add_argumented( ['-f', '--file', '--pony'], arg = 'PONY', help = 'Select a pony.\nEither a file name or a pony name.') +opts.add_argumented( ['-F', '++file', '++pony'], arg = 'PONY', help = 'Select a non-MLP:FiM pony.') +opts.add_variadic( ['-q', '--quote'], arg = 'PONY', help = 'Select a ponies which will quote themself.') opts.parse() diff --git a/ponysay.pdf b/ponysay.pdf Binary files differindex d96a57f..f90f885 100644 --- a/ponysay.pdf +++ b/ponysay.pdf diff --git a/share/ucsmap b/share/ucsmap new file mode 100644 index 0000000..14f8252 --- /dev/null +++ b/share/ucsmap @@ -0,0 +1,5 @@ +mjölna → mjolna +piñacolada → pinacolada +vın̈yl → vinyl + +#jesús pezuña diff --git a/ttyponies/pinkieoink.pony b/ttyponies/pinkieoink.pony new file mode 120000 index 0000000..7f9fd2b --- /dev/null +++ b/ttyponies/pinkieoink.pony @@ -0,0 +1 @@ +./oinkoinkoink.pony
\ No newline at end of file |