tasks: descending task order in short format

This affects update_days, colorized and similar reports:
now tasks with the largest IDs go first. This helps
reading reports on smaller screens.
This commit is contained in:
Ivan A. Melnikov 2019-03-02 21:40:37 +04:00
parent f9ef19f8d9
commit a1c774089f

View File

@ -130,8 +130,8 @@ def format_task(info, extra_info=None):
def format_tasks_short(tasks, separator=','):
return separator.join('%(taskid)s=%(state)s' % t
for t in (tasks or []))
tasks = sorted(tasks or (), key=lambda t: -t.get('taskid', 0))
return separator.join('%(taskid)s=%(state)s' % t for t in tasks)
def task_packages(info):