本文整理汇总了Python中jobbrowser.models.JobLinkage.get_task方法的典型用法代码示例。如果您正苦于以下问题:Python JobLinkage.get_task方法的具体用法?Python JobLinkage.get_task怎么用?Python JobLinkage.get_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jobbrowser.models.JobLinkage
的用法示例。
在下文中一共展示了JobLinkage.get_task方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: single_task_attempt_logs
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def single_task_attempt_logs(request, jobid, taskid, attemptid):
"""
We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/logs
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
try:
attempt = task.get_attempt(attemptid)
except KeyError:
raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid))
try:
# Add a diagnostic log
diagnostic_log = ", ".join(task.diagnosticMap[attempt.attemptId])
logs = [ diagnostic_log ]
# Add remaining logs
logs += [ section.strip() for section in attempt.get_task_log() ]
except TaskTrackerNotFoundException:
# Four entries,
# for diagnostic, stdout, stderr and syslog
logs = [ _("Failed to retrieve log. TaskTracker not found.") ] * 4
return render("attempt_logs.mako", request,
{
"attempt":attempt,
"taskid":taskid,
"joblnk": job_link,
"task": task,
"logs": logs
})
示例2: single_task
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def single_task(request, jobid, taskid):
"""
We get here from /jobs/jobid/tasks/taskid
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
return render("task.mako", request, {'task': task, 'joblnk': job_link})
示例3: task_attempt_counters
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def task_attempt_counters(request, jobid, taskid, attemptid):
"""
We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/counters
(phew!)
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
attempt = task.get_attempt(attemptid)
counters = {}
if attempt:
counters = attempt.counters
return render("counters.html", request, {'counters':counters})
示例4: single_task_attempt
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def single_task_attempt(request, jobid, taskid, attemptid):
"""
We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
try:
attempt = task.get_attempt(attemptid)
except KeyError:
raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid))
return render("attempt.mako", request, {"attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task})
示例5: single_task_attempt
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def single_task_attempt(request, jobid, taskid, attemptid):
"""
We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
try:
attempt = task.get_attempt(attemptid)
except KeyError:
raise KeyError("Cannot find attempt '%s' in task" % (attemptid,))
logs = [ section.strip() for section in attempt.get_task_log() ]
return render("attempt.mako", request,
{
"attempt":attempt,
"taskid":taskid,
"joblnk": job_link,
"task": task,
"logs": logs
})
示例6: single_task_attempt
# 需要导入模块: from jobbrowser.models import JobLinkage [as 别名]
# 或者: from jobbrowser.models.JobLinkage import get_task [as 别名]
def single_task_attempt(request, jobid, taskid, attemptid):
"""
We get here from /jobs/jobid/tasks/taskid/attempts/attemptid
"""
job_link = JobLinkage(request.jt, jobid)
task = job_link.get_task(taskid)
try:
attempt = task.get_attempt(attemptid)
except KeyError:
raise KeyError("Cannot find attempt '%s' in task" % (attemptid,))
try:
logs = [ section.strip() for section in attempt.get_task_log() ]
except TaskTrackerNotFoundException:
# Three entries for stdout, stderr and syslog
logs = [ "Failed to retrieve log. TaskTracker not found." ] * 3
return render("attempt.mako", request,
{
"attempt":attempt,
"taskid":taskid,
"joblnk": job_link,
"task": task,
"logs": logs
})