aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFarrell Wymore <farrell.wymore@windriver.com>2014-03-11 14:48:52 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-17 13:59:28 +0000
commit37ae4e94d6991d4f05b0236b525e29797ed6e49c (patch)
tree843d6e33e44d6d0c61bc8ad5eafb971909f3c585 /lib
parentf339555df40307420ce80a4ef8cba1a4d284d380 (diff)
downloadbitbake-37ae4e94d6991d4f05b0236b525e29797ed6e49c.tar.gz
toaster: added file types to the Outputs column in the build page
The file types are displayed in the Outputs column in the build page. The file types are derived from the target image filenames. [YOCTO #5947] Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/toaster/toastergui/templates/build.html6
-rw-r--r--lib/toaster/toastergui/templatetags/projecttags.py27
2 files changed, 32 insertions, 1 deletions
diff --git a/lib/toaster/toastergui/templates/build.html b/lib/toaster/toastergui/templates/build.html
index 3c9256cbd..f1fa70d06 100644
--- a/lib/toaster/toastergui/templates/build.html
+++ b/lib/toaster/toastergui/templates/build.html
@@ -92,7 +92,11 @@
<td class="warnings_no">{% if build.warnings_no %}<a class="warnings_no warning" href="{% url "builddashboard" build.id %}#warnings">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>{%endif%}</td>
<td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td>
<td class="log">{{build.cooker_log_path}}</td>
- <td class="output">{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}<a href="{%url "builddashboard" build.id%}#images">TODO: compute image output fstypes</a>{% endif %}{% endfor %}{% endif %}</td>
+ <td class="output">
+ {% if build.outcome == 0 %}
+ {{build|get_image_extensions}}
+ {% endif %}
+ </td>
</tr>
{% endfor %}
diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index 857680b35..60d5dd0b7 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -24,6 +24,8 @@ import re
from django import template
from django.utils import timezone
from django.template.defaultfilters import filesizeformat
+from orm.models import Target_Installed_Package, Target_Image_File
+from orm.models import Build, Target, Task, Layer, Layer_Version
register = template.Library()
@@ -188,3 +190,28 @@ def string_slice(strvar,slicevar):
else:
return strvar[int(first):int(last)]
+@register.filter
+def get_image_extensions( build ):
+ """
+ This is a simple filter that returns a list (string)
+ of extensions of the build-targets-image files. Note
+ that each build can have multiple targets and each
+ target can yield more than one image file
+ """
+ targets = Target.objects.filter( build_id = build.id );
+ comma = "";
+ extensions = "";
+ for t in targets:
+ if ( not t.is_image ):
+ continue;
+ tif = Target_Image_File.objects.filter( target_id = t.id );
+ for i in tif:
+ try:
+ ndx = i.file_name.index( "." );
+ except ValueError:
+ ndx = 0;
+ s = i.file_name[ ndx + 1 : ];
+ extensions += comma + s;
+ comma = ", ";
+ return( extensions );
+