def bookmarker(number): """Give user the option to bookmark the last read RFC, defaults to No.""" bookmark = input("Do you wish to bookmark this? [y/N] >> ") if bookmark == "y" or bookmark == "Y": print("YES", number) update = Data(number=number, bookmark=1) update.save() home_page()
def update_bookmarks(): """Updates the Bookmark row in database for selected RFC.""" print("[!] Select bookmark to delete [!]") print() query = Data.select().where(Data.bookmark == 1) for result in query: print(f"\t{Color.OKBLUE}RFC {result.number} - {Color.NOTICE}" f"{result.title[5:]}{Color.END}") print() print("[*] Enter Bookmark to delete by number [eg. 8305] [*]") print("[*] OR Press [Enter] for Home Page [*]") choice = input(prompt) if choice.isdigit(): update = Data(number=choice, bookmark=0) update.save() update_bookmarks() print() elif choice == "" or choice == "q": home_page() else: print("\n[!] Please enter a valid number! [!]") print() update_bookmarks()