make that easier on the eyes

This commit is contained in:
David Schultz 2021-02-05 18:38:27 -06:00 committed by GitHub
parent a0d6e51589
commit 37523c7a09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,14 @@ class Module(ModuleManager.BaseModule):
def listify(self, items): def listify(self, items):
if type(items) != list: if type(items) != list:
items = list(items) items = list(items)
return len(items) > 2 and ', '.join(items[:-1]) + ', and ' + items[-1] or len(items) > 1 and items[0] + ' and ' + items[1] or items and items[0] or '' listified = ""
if len(items) > 2:
listified = ', '.join(items[:-1]) + ', and ' + items[-1]
elif len(items) > 1:
listified = items[0] + ' and ' + items[1]
elif items:
listified = items[0]
return listified
def _karma_str(self, karma): def _karma_str(self, karma):
karma_str = str(karma) karma_str = str(karma)