From 37523c7a09d248233825e712073c7e3e49ef3596 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 5 Feb 2021 18:38:27 -0600 Subject: [PATCH] make that easier on the eyes --- modules/karma.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/karma.py b/modules/karma.py index 8e635d28..e21d9130 100644 --- a/modules/karma.py +++ b/modules/karma.py @@ -17,7 +17,14 @@ class Module(ModuleManager.BaseModule): def listify(self, items): if type(items) != list: 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): karma_str = str(karma)