'read all pages of deleted/expired tasks'

def read_all_history(self, type=0):

    all_tasks = []
    (tasks, next_link) = self.read_history_page(type)
    all_tasks.extend(tasks)
    while next_link:
        if (self.limit and (len(all_tasks) > self.limit)):
            break
        (tasks, next_link) = self.read_history_page_url(next_link)
        all_tasks.extend(tasks)
    if self.limit:
        all_tasks = all_tasks[0:self.limit]
    for (i, task) in enumerate(all_tasks):
        task['#'] = i
    return all_tasks
