aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-20 13:17:17 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-20 13:17:17 +0200
commitff32ad65eca2f46a7de1fd4a711f6b2217c9d74e (patch)
treecc258ec7ffd5e0c45bfb65f21aeafb90becc781b /ponysay
parent8ac197c59a963bad6b16b02beac8e93036a9f0fb (diff)
downloadponysay-ff32ad65eca2f46a7de1fd4a711f6b2217c9d74e.tar.gz
ponysay-ff32ad65eca2f46a7de1fd4a711f6b2217c9d74e.tar.bz2
ponysay-ff32ad65eca2f46a7de1fd4a711f6b2217c9d74e.zip
tty works, but kms ponies are for some reason not converted
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay11
1 files changed, 5 insertions, 6 deletions
diff --git a/ponysay b/ponysay
index 7eb7c54..9578ddc 100755
--- a/ponysay
+++ b/ponysay
@@ -367,10 +367,10 @@ class Ponysay():
else:
if linuxvt or (env_height is ('yes', 'y', '1')):
if env_bottom is ('yes', 'y', '1'):
- for line in output[: -lines]:
+ for line in output.split('\n')[: -lines]:
print(line)
else:
- for line in output[: lines]:
+ for line in output.split('\n')[: lines]:
print(line)
else:
print(output);
@@ -450,7 +450,6 @@ class Ponysay():
palette = env_kms
palettefile = env_kms.replace('\033]P', '')
- print(palettefile)
kmsponies = '/var/cache/ponysay/kmsponies/' + palettefile
kmspony = (kmsponies + pony).replace('//', '/')
@@ -717,7 +716,7 @@ class Backend():
self.link = {'\\' : '\\', '/' : '/'} if not isthink else {'\\' : 'o', '/' : 'o'}
- self.output = None
+ self.output = ''
self.pony = None
@@ -874,7 +873,7 @@ class Backend():
'''
- Gets colour code att the currect offest in a buffer
+ Gets colour code att the currect offset in a buffer
'''
def __getcolour(self, input, offset):
(i, n) = (offset, len(input))
@@ -953,7 +952,7 @@ class Backend():
if i != n:
d = line[i]
i += 1
- if d == '\033':
+ if d == '\033': # TODO this should use self.__getcolour()
b[bi] = d
bi += 1
b[bi] = line[i]