diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-18 14:29:57 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-18 14:29:57 +0200 |
commit | f14e7b6c0600149e887ab13a84a8de6f9c9c5aac (patch) | |
tree | 655407a2ef99158c4b8e8b4b50a28cb609b41a58 | |
parent | ab986563ec338e4031047e9da0b9fe020e24a5dc (diff) | |
download | ponysay-f14e7b6c0600149e887ab13a84a8de6f9c9c5aac.tar.gz ponysay-f14e7b6c0600149e887ab13a84a8de6f9c9c5aac.tar.bz2 ponysay-f14e7b6c0600149e887ab13a84a8de6f9c9c5aac.zip |
m
-rwxr-xr-x | ponysay.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -18,28 +18,28 @@ from subprocess import Popen, PIPE ''' The version of ponysay ''' -version = "2.0-alpha" +VERSION = "2.0-alpha" ''' The directory where ponysay is installed, this is modified when building with make ''' -installdir = '/usr' +INSTALLDIR = '/usr' ''' The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) ''' ponydirs = [] -if os.environ['TERM'] == 'linux': _ponydirs = [installdir + '/share/ponysay/ttyponies/', os.environ['HOME'] + '/.local/share/ponysay/ttyponies/'] -else: _ponydirs = [installdir + '/share/ponysay/ponies/', os.environ['HOME'] + '/.local/share/ponysay/ponies/' ] +if os.environ['TERM'] == 'linux': _ponydirs = [INSTALLDIR + '/share/ponysay/ttyponies/', os.environ['HOME'] + '/.local/share/ponysay/ttyponies/'] +else: _ponydirs = [INSTALLDIR + '/share/ponysay/ponies/', os.environ['HOME'] + '/.local/share/ponysay/ponies/' ] for ponydir in _ponydirs: if os.path.isdir(ponydir): ponydirs.append(ponydir) parser = argparse.ArgumentParser(description = 'Ponysay, like cowsay with ponies') -parser.add_argument('-v', '--version', action = 'version', version='%s %s' % (__file__, version)) +parser.add_argument('-v', '--version', action = 'version', version = '%s %s' % ("ponysay", VERSION)) parser.add_argument('-l', '--list', action = 'store_true', dest = 'list', help = 'list pony files') parser.add_argument('-f', '--pony', action = 'append', dest = 'pony', help = 'select a pony (either a file name or a pony name)') parser.add_argument('message', nargs = '?', help = 'message to ponysay') @@ -72,7 +72,7 @@ class ponysay(): x = 0 for pony in ponies: print(pony + (" " * (width - len(pony))), end="") # Print ponyfilename - x = x + width + x += width if x > (termsize[1] - width): # If too wide, make new line print(); x = 0 |