From 75b224e2d13e39ac96a85c31263db4ec28a7be52 Mon Sep 17 00:00:00 2001 From: Vincent Zeng Date: Tue, 2 Jan 2018 19:13:38 -0500 Subject: [PATCH] stubbing nopub toggler --- ttbp/core.py | 6 ++++++ ttbp/ttbp.py | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ttbp/core.py b/ttbp/core.py index 59151d8..b60fa3b 100644 --- a/ttbp/core.py +++ b/ttbp/core.py @@ -425,6 +425,12 @@ def nopub(filename): return os.path.basename(filename) in exclude +def toggle_nopub(filename): + """toggles pub/nopub status for the given filename + """ + + pass + ############# ############# ############# diff --git a/ttbp/ttbp.py b/ttbp/ttbp.py index dd505df..adbff30 100644 --- a/ttbp/ttbp.py +++ b/ttbp/ttbp.py @@ -614,7 +614,7 @@ def review_menu(intro=""): view_feels(config.USER) elif choice == 1: redraw("here's your current nopub status:") - set_nopubs(config.USER) + list_nopubs(config.USER) else: redraw() return @@ -805,7 +805,7 @@ editor. return -def set_nopubs(user): +def list_nopubs(user): ''' handler for toggling nopub on individual entries ''' @@ -820,21 +820,23 @@ def set_nopubs(user): pub = "(nopub)" entries.append(""+entry[4]+" ("+p.no("word", entry[2])+") "+"\t"+pub) - return toggle_nopubs(metas, entries, "publishing status of your feels:") + return set_nopubs(metas, entries, "publishing status of your feels:") else: redraw("no feels recorded by ~"+user) -def toggle_nopubs(metas, entries, prompt): +def set_nopubs(metas, entries, 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) if choice is not False: + target = os.path.basename(metas[choice][0]) + core.toggle_nopub(target) redraw(prompt) - print("setting {entry}".format(entry=choice)) + print("setting {entry}".format(entry=target)) - return list_entries(metas, entries, prompt) + return set_nopubs(metas, entries, prompt) else: redraw()