How to use the todoman.interactive.TodomanItem function in todoman

To help you get started, we’ve selected a few todoman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pimutils / todoman / todoman / interactive.py View on Github external
def items_to_display(self):
        '''
        Create a list of TodomanItems to display, based on the associated
        Database and the current done_is_hidden setting.

        (TodomanItemListPage) -> [TodomanItem]
        '''
        items = []
        for t in self.database.todos():
            todo = TodomanItem(t, self.database, self.generate_label)
            if not self.done_is_hidden or not todo.is_completed:
                items.append(todo)
        items.sort(key=lambda item: item.label.lower())
        return items
github pimutils / todoman / todoman / interactive.py View on Github external
def new_item(self):
        '''
        Create a new TodomanItem and open a TodomanItemDetailsPage in which
        the user can edit the new item.

        (TodomanItemListPage) -> None
        '''
        item = TodomanItem(None, self.database, self.generate_label)
        new_page = TodomanItemDetailsPage(self.parent, self.callback, item)
        self.open_page(new_page)