adjusting pagination of nopub selector

master
Vincent Zeng 2018-01-02 20:12:43 -05:00
parent a4663d3d0e
commit 3a29daef28
1 changed files with 10 additions and 9 deletions

View File

@ -813,6 +813,15 @@ def list_nopubs(user):
metas, owner = generate_feels_list(user) metas, owner = generate_feels_list(user)
if len(metas) > 0: if len(metas) > 0:
return set_nopubs(metas, user, "publishing status of your feels:")
else:
redraw("no feels recorded by ~"+user)
def set_nopubs(metas, user, prompt):
"""displays a list of entries for pub/nopub toggling.
"""
entries = [] entries = []
for entry in metas: for entry in metas:
pub = "" pub = ""
@ -820,15 +829,6 @@ def list_nopubs(user):
pub = "(nopub)" pub = "(nopub)"
entries.append(""+entry[4]+" ("+p.no("word", entry[2])+") "+"\t"+pub) entries.append(""+entry[4]+" ("+p.no("word", entry[2])+") "+"\t"+pub)
return set_nopubs(metas, entries, user, "publishing status of your feels:")
else:
redraw("no feels recorded by ~"+user)
def set_nopubs(metas, entries, user, prompt):
"""displays a list of entries for pub/nopub toggling.
"""
choice = menu_handler(entries, "pick an entry from the list, or type 'q' to go back: ", 10, SETTINGS.get("rainbows", False), prompt) choice = menu_handler(entries, "pick an entry from the list, or type 'q' to go back: ", 10, SETTINGS.get("rainbows", False), prompt)
if choice is not False: if choice is not False:
@ -837,7 +837,8 @@ def set_nopubs(metas, entries, user, prompt):
redraw(prompt) redraw(prompt)
#print("{action} {entry}".format(action=action, entry=target)) #print("{action} {entry}".format(action=action, entry=target))
return list_nopubs(user) return set_nopubs(metas, user, prompt)
#return list_nopubs(user)
else: else:
redraw() redraw()