def save(): global body if not storyfile.current(): choice = None while not choice in ["y", "n"]: choice = menu.menu_save() if choice == "y": database.commit_queue(storyfile.abs_to_sql()) body = "Saved." elif choice == "n": pass else: body = "Nothing to save."
def close(): global context if not storyfile.current(): choice = None while not choice in ["y", "n", "c"]: choice = menu.menu_close() if choice == "y": database.commit_queue(storyfile.abs_to_sql()) elif choice == "n": pass else: return False database.conn.close() context = [VERSION, "INIT", None] return True