def taskToXML(task: Task) -> XML: run = task.getLatestRun() return xml.task( name = task.getName(), priority = task.getPriority() if taskprio else None, waiting = run.isWaiting(), running = run.isRunning(), done = run.isDone(), cancelled = run.isCancelled(), result = task.result, alert = task.getAlert(), summary = run.getSummary(), report = task.getURL(), starttime = formatTimeAttr(task.startTime), duration = task.getDuration(), runner = run.getTaskRunnerId(), )[ ( xml.param(name = name, value = value) for name, value in task.getVisibleParameters().items() ) ]
def taskSummary(task: Task) -> XML: return pageLink( 'Task', TaskIdArgs(jobId=task.getJob().getId(), taskName=task.getName()) )[ task.getLatestRun().getSummary() or '(empty summary)' ]
def presentCell(self, record: Task, **kwargs: object) -> XMLContent: proc = cast(ExtractedData_GET.Processor, kwargs['proc']) runId = record.getLatestRun().getId() data = proc.dataByRunId.get(runId) return '-' if data is None else data.get(self.__key, '-')