1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 21:02:38 +00:00

Fix formatter.paginate logic issues

This commit is contained in:
Dylan Dizon 2018-11-15 15:33:34 -05:00
parent 540549def2
commit 9a673d6233

View file

@ -42,12 +42,11 @@ async def paginate(
paginator.add_line(start) paginator.add_line(start)
if type(i) in (tuple, list, set): if type(i) in (tuple, list, set):
for e in sorted(i): paginator.add_line(eprefix + f'{ejoin}'.join(i) + esuffix)
if e and (e not in i) and (len(i) > 1):
paginator.add_line(eprefix + f'{ejoin}'.join(e) + esuffix)
elif type(i) is dict: elif type(i) is dict:
for k, e in sorted(i.items()): for k, e in sorted(i.items()):
if e and (k not in e) and (len(e) > 1): if e and (k not in e) and (len(e) >= 1):
paginator.add_line(kprefix + k + ksuffix + eprefix + f'{ejoin}'.join(e) + esuffix) paginator.add_line(kprefix + k + ksuffix + eprefix + f'{ejoin}'.join(e) + esuffix)
if end: if end: