aboutsummaryrefslogtreecommitdiff
path: root/ponysay.py
diff options
context:
space:
mode:
Diffstat (limited to 'ponysay.py')
-rwxr-xr-xponysay.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/ponysay.py b/ponysay.py
index f968619..90520ec 100755
--- a/ponysay.py
+++ b/ponysay.py
@@ -78,9 +78,29 @@ class Ponysay():
elif args.opts['-A'] is not None: self.list(); self.__extraponies(); self.list()
elif args.opts['+A'] is not None: self.linklist(); self.__extraponies(); self.linklist()
else:
+ global linuxvt
+ global usekms
+ global mode
+
+ ## Emulate termial capabilities
+ if args.opts['-X'] is not None:
+ linuxvt = False
+ usekms = False
+ elif args.opts['-V'] is not None:
+ linuxvt = True
+ usekms = False
+ elif args.opts['-K'] is not None:
+ linuxvt = True
+ usekms = True
+
+ ## Other extra features
self.__extraponies(args)
self.__bestpony(args)
self.__ucsremap(args)
+ if args.opts['-o'] is not None:
+ mode += '$/= $$\\= $'
+
+ ## The stuff
if args.opts['-q'] is not None: self.quote(args)
else: self.print_pony(args)
@@ -1209,6 +1229,7 @@ class Backend():
def parse(self):
self.__expandMessage()
self.__loadFile()
+ self.pony = mode + self.pony
self.__processPony()
self.__truncate()
@@ -1927,6 +1948,12 @@ usekms = Ponysay.isUsingKMS()
'''
+Mode string that modifies or adds $ variables in the pony image
+'''
+mode = ''
+
+
+'''
The directories where pony files are stored, ttyponies/ are used if the terminal is Linux VT (also known as TTY) and not with KMS
'''
appendset = set()
@@ -2022,6 +2049,10 @@ opts.add_argumentless(['--quoters'])
opts.add_argumentless(['--onelist'])
opts.add_argumentless(['++onelist'])
+opts.add_argumentless(['-X', '--256-colours', '--256colours', '--x-colours'])
+opts.add_argumentless(['-V', '--tty-colours', '--ttycolours', '--vt-colours'])
+opts.add_argumentless(['-K', '--kms-colours', '--kmscolours'])
+
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.')
@@ -2029,9 +2060,10 @@ opts.add_argumentless(['-L', '--symlist', '--altlist'], help =
opts.add_argumentless(['+l', '++list'], help = 'List non-MLP:FiM pony names.')
opts.add_argumentless(['+L', '++symlist', '++altlist'], help = 'List non-MLP:FiM pony names with alternatives.')
opts.add_argumentless(['-A', '--all'], help = 'List all pony names.')
-opts.add_argumentless(['+A', '++all'], help = 'List all pony names with alternatives.')
+opts.add_argumentless(['+A', '++all', '--symall', '--altall'], help = 'List all pony names with alternatives.')
opts.add_argumentless(['-B', '--bubblelist', '--balloonlist'], help = 'List balloon styles.')
opts.add_argumentless(['-c', '--compact'], help = 'Compress messages.')
+opts.add_argumentless(['-o', '--pony-only', '--ponyonly'], help = 'Print only the pony.')
opts.add_argumented( ['-W', '--wrap'], arg = 'COLUMN', help = 'Specify column where 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.')