From f14e7b6c0600149e887ab13a84a8de6f9c9c5aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Sat, 18 Aug 2012 14:29:57 +0200 Subject: [PATCH] m --- ponysay.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ponysay.py b/ponysay.py index 29c969e1..49ae08c7 100755 --- a/ponysay.py +++ b/ponysay.py @@ -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