adding some feels count checks

master
Vincent Zeng 2018-03-13 17:40:09 -04:00
parent d646175312
commit 7c85c0b689
1 changed files with 31 additions and 17 deletions

View File

@ -540,14 +540,11 @@ def main_menu():
write_entry(os.path.join(config.USER_DATA, today+".txt")) write_entry(os.path.join(config.USER_DATA, today+".txt"))
core.www_neighbors() core.www_neighbors()
elif choice == '1': elif choice == '1':
if len(os.listdir(config.USER_DATA)) > 0:
intro = "here are some options for managing your feels:" intro = "here are some options for managing your feels:"
redraw(intro) redraw(intro)
review_menu(intro) review_menu(intro)
core.load_files() core.load_files()
core.write("index.html") core.write("index.html")
else:
redraw("you don't have any feels to manage, "+chatter.say("friend"))
elif choice == '2': elif choice == '2':
users = core.find_ttbps() users = core.find_ttbps()
prompt = "the following {usercount} {are} recording feels on ttbp:".format( prompt = "the following {usercount} {are} recording feels on ttbp:".format(
@ -616,7 +613,8 @@ def review_menu(intro=""):
"modify feels publishing", "modify feels publishing",
"backup your feels", "backup your feels",
"delete feels by day", "delete feels by day",
"purge all feels" "purge all feels",
"import a feels backup",
] ]
util.print_menu(menuOptions, SETTINGS.get("rainbows", False)) util.print_menu(menuOptions, SETTINGS.get("rainbows", False))
@ -624,22 +622,38 @@ def review_menu(intro=""):
choice = util.list_select(menuOptions, "what would you like to do with your feels? (or 'back' to return home) ") choice = util.list_select(menuOptions, "what would you like to do with your feels? (or 'back' to return home) ")
top = "" top = ""
hasfeels = len(os.listdir(config.USER_DATA)) > 0
nofeels = "you don't have any feels to work with, "+chatter.say("friend")+"\n\n> "
if choice is not False: if choice is not False:
if choice == 0: if choice == 0:
if hasfeels:
redraw("your recorded feels, listed by date:") redraw("your recorded feels, listed by date:")
view_feels(config.USER) view_feels(config.USER)
else:
top = nofeels
elif choice == 1: elif choice == 1:
if hasfeels:
redraw("publishing status of your feels:") redraw("publishing status of your feels:")
list_nopubs(config.USER) list_nopubs(config.USER)
else:
top = nofeels
elif choice == 2: elif choice == 2:
if hasfeels:
redraw("FEELS BACKUP") redraw("FEELS BACKUP")
backup_feels() backup_feels()
else:
top = nofeels
elif choice == 3: elif choice == 3:
top = DUST top = DUST
elif choice == 4: elif choice == 4:
if hasfeels:
redraw("!!!PURGING ALL FEELS!!!") redraw("!!!PURGING ALL FEELS!!!")
purge_feels() purge_feels()
else:
top = nofeels
elif choice == 5:
top = DUST
else: else:
redraw() redraw()
return return