Exemple #1
0
 def presentCell(self, record: Task, **kwargs: object) -> XMLContent:
     table = cast(TaskRunsTable, kwargs['table'])
     if table.taskNameLink:
         return createTaskInfoLink(record.getJob().getId(),
                                   record.getName())
     else:
         return record.getName()
Exemple #2
0
 def checkAbort(task: Task) -> bool:
     if onlyWaiting and not task.isWaiting():
         return False
     elif taskNames and task.getName() not in taskNames:
         return False
     else:
         return True
Exemple #3
0
 def presentCell(self, record: Task, **kwargs: object) -> XMLContent:
     if record.canBeAborted():
         proc = cast(PageProcessor, kwargs['proc'])
         return pageLink(
             'AbortTask',
             TaskIdArgs(jobId=proc.args.jobId,
                        taskName=record.getName()))['Abort']
     else:
         return '-'
Exemple #4
0
 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() )
         ]
Exemple #5
0
def taskSummary(task: Task) -> XML:
    return pageLink(
        'Task',
        TaskIdArgs(jobId=task.getJob().getId(), taskName=task.getName())
        )[ task.getLatestRun().getSummary() or '(empty summary)' ]