summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2015-03-14 09:00:15 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-25 12:39:58 +0000
commiteeef93ad072cce86de9c59d51df2b8ccc4349b2e (patch)
tree1e74f541d0d62dda71bc1f298ebd0e36a8a9f68c /bitbake/lib/toaster/toastergui/views.py
parent1a4c8a849ac14e6a7a90d5730758b010b68ffd9f (diff)
downloadpoky-eeef93ad072cce86de9c59d51df2b8ccc4349b2e.tar.gz
bitbake: toaster: most-build-targets bug fixes
Fixes for the following for the "Most built targets" section of the project page: 1) limit the number of most built targets to 5, 2) order the list of most built targets by build count, 3) select only those builds that had build status of 'fail', 'success', or a BuildRequest of 'failed', 4) if there are no layers in the project then (on refresh) all of the checkboxes in the 'Most built targets' list are disabled. Note that per agreement with UI designer, the only sort on the most target list is build count as described in (3) above; secondary sorting is random. [YOCTO #7177] (Bitbake rev: dda2f07193e740860f4497c3761d340d8c5c2b41) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index d999959446..fdd80222ab 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2204,11 +2204,11 @@ if toastermain.settings.MANAGED:
2204 freqtargets = [] 2204 freqtargets = []
2205 try: 2205 try:
2206 freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.target_set.all()), Build.objects.filter(project = prj, outcome__lt = Build.IN_PROGRESS)))) 2206 freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.target_set.all()), Build.objects.filter(project = prj, outcome__lt = Build.IN_PROGRESS))))
2207 freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.brtarget_set.all()), BuildRequest.objects.filter(project = prj, state__lte = BuildRequest.REQ_QUEUED)))) 2207 freqtargets += map(lambda x: x.target, reduce(lambda x, y: x + y, map(lambda x: list(x.brtarget_set.all()), BuildRequest.objects.filter(project = prj, state = BuildRequest.REQ_FAILED))))
2208 except TypeError: 2208 except TypeError:
2209 pass 2209 pass
2210 freqtargets = Counter(freqtargets) 2210 freqtargets = Counter(freqtargets)
2211 freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x]) 2211 freqtargets = sorted(freqtargets, key = lambda x: freqtargets[x], reverse=True)
2212 2212
2213 context = { 2213 context = {
2214 "project" : prj, 2214 "project" : prj,
@@ -2228,7 +2228,7 @@ if toastermain.settings.MANAGED:
2228 "branch" : { "name" : x.layercommit.get_vcs_reference(), "layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}}, 2228 "branch" : { "name" : x.layercommit.get_vcs_reference(), "layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}},
2229 prj.projectlayer_set.all().order_by("id")), 2229 prj.projectlayer_set.all().order_by("id")),
2230 "targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()), 2230 "targets" : map(lambda x: {"target" : x.target, "task" : x.task, "pk": x.pk}, prj.projecttarget_set.all()),
2231 "freqtargets": freqtargets, 2231 "freqtargets": freqtargets[:5],
2232 "releases": map(lambda x: {"id": x.pk, "name": x.name, "description":x.description}, Release.objects.all()), 2232 "releases": map(lambda x: {"id": x.pk, "name": x.name, "description":x.description}, Release.objects.all()),
2233 "project_html": 1, 2233 "project_html": 1,
2234 } 2234 }