flush todos to file
        :param delete_if_empty: delete if todo is empty

def write(self, delete_if_empty=False):
        """flush todos to file
        :param delete_if_empty: delete if todo is empty
        """
        with open(self.path, 'w') as f:
            if not self.todos:
                f.flush()
            else:
                for todo in _todo_to_file(self.todos):
                    f.write(todo)