diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-18 20:36:18 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-18 20:36:18 +0200 |
commit | f367346ad83b447ff9dfdc348f98eff1e4b28e26 (patch) | |
tree | 335fc2c69c7569326bb61b5978ca7353c7a442ef | |
parent | 496b980a388e92f47a774d868140c6c5dbb6d678 (diff) | |
parent | a4385d7754fefd06be8bbc78a398f02d32e8c191 (diff) | |
download | ponysay-f367346ad83b447ff9dfdc348f98eff1e4b28e26.tar.gz ponysay-f367346ad83b447ff9dfdc348f98eff1e4b28e26.tar.bz2 ponysay-f367346ad83b447ff9dfdc348f98eff1e4b28e26.zip |
Merge branch 'python' of github.com:erkin/ponysay into python
-rw-r--r-- | README.md | 20 | ||||
-rwxr-xr-x | ponysay.py | 12 |
2 files changed, 18 insertions, 14 deletions
@@ -12,7 +12,7 @@ First of all, you need `cowsay` from your local repositories. Obtain it from [here](http://www.nog.net/~tony/warez) if you wish to compile it yourself. This is often sufficient, but if is not you may be missing one of the standard packages: [bash](ftp://ftp.gnu.org/gnu/bash/), [coreutils](ftp://ftp.gnu.org/gnu/coreutils/) or [sed](ftp://ftp.gnu.org/gnu/sed/). -[Download](https://github.com/erkin/ponysay/downloads) or clone the project. +[Download](/erkin/ponysay/downloads) or clone the project. In the terminal, `cd` into the ponysay directory and `make && make install`. This will install ponysay into the $PREFIX (`/usr` by default, meaning you may need to `make install` as root, e.g. `sudo make install`.) @@ -46,7 +46,7 @@ This requires that you have the `fortune` utility installed. You can install it or just fetch the source code from [here](ftp://ftp.ibiblio.org/pub/linux/games/amusements/fortune/). You can try [this](http://www.reddit.com/r/mylittlelinux/comments/srixi/using_ponysay_with_a_ponified_fortune_warning/) script or -[ponypipe](https://github.com/maandree/ponypipe) to ponify fortunes. +[ponypipe](/maandree/ponypipe) to ponify fortunes. Edit your `~/.bashrc` and add this to the end of the file @@ -84,19 +84,13 @@ Dependencies ### Required runtime dependencies -`bash`: required for the main script [file: ponysay] - `cowsay`: this is a wrapper for cowsay -`coreutils`: the main script uses stty, cut, ls, cat, sort, readlink, pwd, head and tail - -`sed`: used to remove .pony from pony names when running `ponysay -l` and `ponysay -l` - -`perl`: required to run `ponysay -l` and `ponysay -L` +`python3`: Written in python3 ### Package building dependencies -`gcc`: used for compiling ponysaytruncater.c +`gcc`: used for compiling ponysaytruncater.c (???) `gzip`: used for compressing manpages @@ -110,13 +104,13 @@ 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](https://github.com/erkin/ponysay/issues/1). +__A:__ Unfortunately, there's nothing much we can do about it. See [issue 1](/erkin/ponysay/issues/1). __Q:__ You are missing _(my-favourite-pony)_! -__A:__ [Ask](https://github.com/erkin/ponysay/issues) and we'll add! +__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](https://github.com/rossy2401/img2xterm) or [util-say](https://github.com/maandree/util-say). +that are generated into cow files via [img2xterm](/rossy2401/img2xterm) or [util-say](/maandree/util-say). @@ -47,6 +47,12 @@ linuxvt = os.environ['TERM'] == 'linux' ''' +Whether the program is launched in subshell/beeing redirected +''' +redirected = not sys.stdout.isatty() + + +''' The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) ''' ponydirs = [] @@ -81,7 +87,7 @@ parser.add_argument( '--onelist', action = 'store_true', dest = 'onelist', parser.add_argument('-W', '--wrap', action = 'store', dest = 'wrap', help = 'specify the column when the message should be wrapped') parser.add_argument('-f', '--pony', action = 'append', dest = 'pony', help = 'select a pony (either a file name or a pony name)') parser.add_argument('-q', '--quote', nargs = '*', dest = 'quote', help = 'select a pony which will quote herself') -parser.add_argument('message', nargs = '?', help = 'message to ponysay') +parser.add_argument('message', nargs = '?', help = 'message to ponysay') args = parser.parse_args() # TODO implement if [ -t 0 ] && [ $# == 0 ]; then @@ -99,6 +105,10 @@ class ponysay(): Starts the part of the program the arguments indicate ''' def __init__(self, args): + if args.list and redirected: + args.list = False + args.onelist = True + if args.list: self.list() elif args.linklist: self.linklist() elif args.quoters: self.quoters() |