def main(): options, body = get_args() if body: notetaker = Noter(options.db_path) notetaker.add_note(body, topics=options.topics, due_date=options.due_date) else: init_interface(options) if body and options.interactive: init_interface(options)
def load_interface(scr, options): """Load the interface module, passing it the curses scren received from init_interface and feed it the information from the database.""" notetaker = Noter(options.db_path) interface = Interface(scr, callback=lambda interface, **kwargs: update_notes(interface, notetaker, **kwargs)) for note in notetaker.get_notes(): interface.add_note(note) for keyword in notetaker.get_stored_keywords(): interface.add_keyword(keyword) interface.update() interface.handle_events()