aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-22 16:36:47 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-22 16:36:47 +0200
commitd3ddf64433b38558a4dc83eba36469a971dd9640 (patch)
tree8302da1a3b6574e7d47457e4482ff70e73bf3247 /ponysay
parent19f2a5a8a49c590164d1ba02af33347add9b68fb (diff)
downloadponysay-d3ddf64433b38558a4dc83eba36469a971dd9640.tar.gz
ponysay-d3ddf64433b38558a4dc83eba36469a971dd9640.tar.bz2
ponysay-d3ddf64433b38558a4dc83eba36469a971dd9640.zip
final touches on extra ponies
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay13
1 files changed, 9 insertions, 4 deletions
diff --git a/ponysay b/ponysay
index 67a7d2e..faca1d3 100755
--- a/ponysay
+++ b/ponysay
@@ -282,8 +282,6 @@ class Ponysay():
quoters = self.__quoters()
for ponydir in ponydirs: # Loop ponydirs
- print('\033[1mponies located in ' + ponydir + '\033[21m')
-
_ponies = os.listdir(ponydir)
ponies = []
for pony in _ponies:
@@ -292,6 +290,10 @@ class Ponysay():
self.__ucsise(ponies)
ponies.sort()
+ if len(ponies) == 0:
+ continue
+ print('\033[1mponies located in ' + ponydir + '\033[21m')
+
width = UCS.dispLen(max(ponies, key = UCS.dispLen)) + 2 # Get the longest ponyfilename lenght + 2 spaces
x = 0
@@ -314,13 +316,16 @@ class Ponysay():
quoters = self.__quoters()
for ponydir in ponydirs: # Loop ponydirs
- print('\033[1mponies located in ' + ponydir + '\033[21m')
-
_ponies = os.listdir(ponydir)
ponies = []
for pony in _ponies:
if (len(pony) > 5) and (pony[-5:] == '.pony'):
ponies.append(pony[:-5])
+
+ if len(ponies) == 0:
+ continue
+ print('\033[1mponies located in ' + ponydir + '\033[21m')
+
pseudolinkmap = {}
self.__ucsise(ponies, pseudolinkmap) ##TODO
pairs = []