diff --git a/src/lists.py b/src/lists.py index 298a45ad..d06579b0 100755 --- a/src/lists.py +++ b/src/lists.py @@ -140,7 +140,7 @@ def linklist(ponydirs = None, quoters = [], ucsiser = None): for ponydir in ponydirs: # Loop ponydirs ## Get all pony files in the directory - ponies = _get_file_list(ponydirs, '.pony') + ponies = _get_file_list(ponydir, '.pony') ## If there are no ponies in the directory skip to next directory, otherwise, print the directories name if len(ponies) == 0: @@ -198,20 +198,18 @@ def linklist(ponydirs = None, quoters = [], ucsiser = None): _print_columnised(list(ponies)) -def onelist(standarddirs, extradirs = None, ucsiser = None): +def onelist(pony_dirs, ucsiser): ''' Lists the available ponies on one column without anything bold or otherwise formated - @param standard:itr? Include standard ponies - @param extra:itr? Include extra ponies - @param ucsiser:(list)?→void Function used to UCS:ise names + @param pony_dirs:itr List of directories to search for ponies + @param ucsiser:(list)→void Function used to UCS:ise names ''' ## Get all pony files - ponies = [j for i in [standarddirs, extradirs] for j in _get_file_list(i, '.pony')] + ponies = [name for dir in pony_dirs for name in _get_file_list(dir, '.pony')] ## UCS:ise and sort - if ucsiser is not None: - ucsiser(ponies) + ucsiser(ponies) ponies.sort() ## Print each one on a seperate line, but skip duplicates diff --git a/src/ponysay.py b/src/ponysay.py index f9560f5b..dd0768dc 100755 --- a/src/ponysay.py +++ b/src/ponysay.py @@ -760,9 +760,10 @@ class Ponysay(): @param standard:bool Include standard ponies @param extra:bool Include extra ponies ''' - lists.onelist(self.ponydirs if standard else None, - self.extraponydirs if extra else None, - lambda x : self.__ucsise(x)) + + pony_dirs = (self.ponydirs if standard else []) + (self.extraponydirs if extra else []) + + lists.onelist(pony_dirs, self.__ucsise) def quoters(self, standard = True, extra = False):