summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r--bitbake/lib/toaster/toastergui/views.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 11c8fd806e..b77be1a6e7 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -349,12 +349,36 @@ def builddashboard(request, build_id):
349 return render(request, template, context) 349 return render(request, template, context)
350 350
351def task(request, build_id, task_id): 351def task(request, build_id, task_id):
352 template = "singletask.html" 352 template = "task.html"
353 if Build.objects.filter(pk=build_id).count() == 0 : 353 if Task.objects.filter(pk=task_id).count() == 0 :
354 return redirect(builds) 354 return redirect(builds)
355 task = Task.objects.filter(pk=task_id)[0]
356
357 dependencies = sorted(_find_task_dep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
358 reverse_dependencies = sorted(_find_task_revdep(task), key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
359
360 log_head = ''
361 log_body = ''
362 if task.outcome == task.OUTCOME_FAILED:
363 pass
364# FIXME: the log should be read from the orm_logmessage table.
365# This will be fixed when the backend is done.
366
355 context = { 367 context = {
356 'build' : Build.objects.filter(pk=build_id)[0], 368 'build' : Build.objects.filter(pk=build_id)[0],
369 'object': task,
370 'task':task,
371 'deps': dependencies,
372 'rdeps': reverse_dependencies,
373 'log_head':log_head,
374 'log_body':log_body,
375 'showing_matches':False,
357 } 376 }
377
378 if request.GET.get('show_matches', ""):
379 context['showing_matches'] = True
380 context['matching_tasks'] = Task.objects.filter(sstate_checksum=task.sstate_checksum).filter(build__completed_on__lt=task.build.completed_on).order_by('-build__completed_on')
381
358 return render(request, template, context) 382 return render(request, template, context)
359 383
360def recipe(request, build_id, recipe_id): 384def recipe(request, build_id, recipe_id):
@@ -388,6 +412,12 @@ def target(request, build_id, target_id):
388 return render(request, template, context) 412 return render(request, template, context)
389 413
390 414
415def _find_task_dep(task):
416 tp = []
417 for p in Task_Dependency.objects.filter(task=task):
418 tp.append(p.depends_on);
419 return tp
420
391 421
392def _find_task_revdep(task): 422def _find_task_revdep(task):
393 tp = [] 423 tp = []