'List the active tasks.'

def list_tasks(self):

    obj = self.obj
    callback_name = self.callback_name
    handler = self.handler
    tasks = [(k, v[0], v[1], v[2]) for (k, v) in handler.db.tasks.items()]
    if obj:
        tasks = [task for task in tasks if (task[2] is obj)]
    if callback_name:
        tasks = [task for task in tasks if (task[3] == callback_name)]
    tasks.sort()
    table = EvTable('ID', 'Object', 'Callback', 'In', width=78)
    table.reformat_column(0, align='r')
    now = datetime.now()
    for (task_id, future, obj, callback_name) in tasks:
        key = obj.get_display_name(self.caller)
        delta = time_format((future - now).total_seconds(), 1)
        table.add_row(task_id, key, callback_name, delta)
    self.msg(unicode(table))
