From bd9744bc7089805c3233044cd4500cfcd97913af Mon Sep 17 00:00:00 2001 From: Vincent Zeng Date: Sun, 11 Mar 2018 22:30:10 -0400 Subject: [PATCH] expanding feels viewing menu --- ttbp/ttbp.py | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/ttbp/ttbp.py b/ttbp/ttbp.py index 79eef4b..430e638 100644 --- a/ttbp/ttbp.py +++ b/ttbp/ttbp.py @@ -540,15 +540,11 @@ def main_menu(): write_entry(os.path.join(config.USER_DATA, today+".txt")) core.www_neighbors() elif choice == '1': - if core.publishing(): - intro = "here are some options for reviewing your feels:" - redraw(intro) - review_menu(intro) - core.load_files() - core.write("index.html") - else: - redraw("your recorded feels, listed by date:") - view_feels(config.USER) + intro = "here are some options for reviewing your feels:" + redraw(intro) + review_menu(intro) + core.load_files() + core.write("index.html") elif choice == '2': users = core.find_ttbps() prompt = "the following {usercount} {are} recording feels on ttbp:".format( @@ -614,13 +610,18 @@ def review_menu(intro=""): menuOptions = [ "read over feels", - "modify feels publishing" + "modify feels publishing", + "backup your feels", + "delete feels by day", + "delete all feels" ] util.print_menu(menuOptions, SETTINGS.get("rainbows", False)) choice = util.list_select(menuOptions, "what would you like to do with your feels? (or 'back' to return home) ") + top = "" + if choice is not False: if choice == 0: redraw("your recorded feels, listed by date:") @@ -628,12 +629,18 @@ def review_menu(intro=""): elif choice == 1: redraw("publishing status of your feels:") list_nopubs(config.USER) + elif choice == 2: + top = DUST + elif choice == 3: + top = DUST + elif choice == 4: + top = DUST else: redraw() return - redraw(intro) - return review_menu() + redraw(top+intro) + return review_menu(intro) def view_neighbors(users, prompt): ''' @@ -708,7 +715,6 @@ def view_feels(townie): ''' generates a list of all feels by given townie and displays in date order; allows selection of one feel to read. - ''' metas, owner = generate_feels_list(townie) @@ -814,6 +820,14 @@ def set_nopubs(metas, user, prompt): """displays a list of entries for pub/nopub toggling. """ + if core.publishing(): + nopub_note = "" + else: + nopub_note = """\ +(since you're not publishing your entries, these settings don't really matter; +none of your feels will be viewable outside of this server)""" + print(nopub_note + "\n") + entries = [] for entry in metas: pub = "" @@ -821,7 +835,7 @@ def set_nopubs(metas, user, prompt): pub = "(nopub)" entries.append(""+entry[4]+" ("+p.no("word", entry[2])+") "+"\t"+pub) - 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+"\n\n"+nopub_note) if choice is not False: target = os.path.basename(metas[choice][0])