mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-25 05:47:59 +01:00
lists.onelist(): Instead of passing multiple, possibly empty lists, build the list of directories to search before calling the method.
This commit is contained in:
parent
5125dd6400
commit
8861e0bb0e
2 changed files with 7 additions and 7 deletions
|
@ -198,16 +198,15 @@ def linklist(ponydirs = None, quoters = [], ucsiser = None):
|
|||
_print_columnised(list(ponies))
|
||||
|
||||
|
||||
def onelist(standarddirs, extradirs, ucsiser):
|
||||
def onelist(pony_dirs, ucsiser):
|
||||
'''
|
||||
Lists the available ponies on one column without anything bold or otherwise formated
|
||||
|
||||
@param standard:itr<str> Include standard ponies
|
||||
@param extra:itr<str> Include extra ponies
|
||||
@param pony_dirs:itr<str> List of directories to search for ponies
|
||||
@param ucsiser:(list<str>)→void Function used to UCS:ise names
|
||||
'''
|
||||
## Get all pony files
|
||||
ponies = [name for dir_list in [standarddirs, extradirs] for dir in dir_list for name in _get_file_list(dir, '.pony')]
|
||||
ponies = [name for dir in pony_dirs for name in _get_file_list(dir, '.pony')]
|
||||
|
||||
## UCS:ise and sort
|
||||
ucsiser(ponies)
|
||||
|
|
|
@ -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 [],
|
||||
self.extraponydirs if extra else [],
|
||||
self.__ucsise)
|
||||
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue