def run(self, unused_args, config): config.ee_init() tasks = ee.data.getTaskList() descs = [utils.truncate(task.get('description', ''), 40) for task in tasks] desc_length = max(len(word) for word in descs) format_str = '{:25s} {:13s} {:%ds} {:10s} {:s}' % (desc_length + 1) for task in tasks: truncated_desc = utils.truncate(task.get('description', ''), 40) task_type = TASK_TYPES.get(task['task_type'], 'Unknown') print(format_str.format( task['id'], task_type, truncated_desc, task['state'], task.get('error_message', '---')))