diff options
author | David Reyna <David.Reyna@windriver.com> | 2014-03-25 10:42:55 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-28 13:44:52 +0000 |
commit | bae133add9b5a23d9c0f29ecdf2fe0db6f7677c2 (patch) | |
tree | b29b6fe8e28b7d589b16b453919c31ca56814baa /bitbake/lib/toaster | |
parent | 877dcd709e4cd54847e756e7a8dc1de6fa926967 (diff) | |
download | poky-bae133add9b5a23d9c0f29ecdf2fe0db6f7677c2.tar.gz |
bitbake: toaster: added file types to the Outputs column in the build
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]
(Bitbake rev: 842abf6759894690d5bc770f4ea2ac15b127e5e2)
Signed-off-by: Farrell Wymore <farrell.wymore@windriver.com>
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/build.html | 6 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 9 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 24 |
3 files changed, 36 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/build.html b/bitbake/lib/toaster/toastergui/templates/build.html index 38ab2bfd7b..7d13cc89a1 100644 --- a/bitbake/lib/toaster/toastergui/templates/build.html +++ b/bitbake/lib/toaster/toastergui/templates/build.html | |||
@@ -122,7 +122,11 @@ | |||
122 | <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> | 122 | <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> |
123 | <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td> | 123 | <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent|sectohms}}</a></td> |
124 | <td class="log">{{build.cooker_log_path}}</td> | 124 | <td class="log">{{build.cooker_log_path}}</td> |
125 | <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> | 125 | <td class="output"> |
126 | {% if build.outcome == build.SUCCEEDED %} | ||
127 | <a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a> | ||
128 | {% endif %} | ||
129 | </td> | ||
126 | </tr> | 130 | </tr> |
127 | 131 | ||
128 | {% endfor %} | 132 | {% endfor %} |
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 76166ca945..aa0ba3909e 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -240,3 +240,12 @@ def format_vpackage_namehelp(name): | |||
240 | r += ' title="' + name + ' only has dependency information available.">' | 240 | r += ' title="' + name + ' only has dependency information available.">' |
241 | r += '</i>' | 241 | r += '</i>' |
242 | return mark_safe(r) | 242 | return mark_safe(r) |
243 | |||
244 | @register.filter | ||
245 | def get_dict_value(dictionary, key): | ||
246 | """ return the value of a dictionary key | ||
247 | """ | ||
248 | try: | ||
249 | return dictionary[key] | ||
250 | except KeyError: | ||
251 | return '' | ||
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 0f92caf56b..d323b37013 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -19,13 +19,13 @@ | |||
19 | # with this program; if not, write to the Free Software Foundation, Inc., | 19 | # with this program; if not, write to the Free Software Foundation, Inc., |
20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
21 | 21 | ||
22 | import operator | 22 | import operator,re |
23 | 23 | ||
24 | from django.db.models import Q, Sum | 24 | from django.db.models import Q, Sum |
25 | from django.shortcuts import render, redirect | 25 | from django.shortcuts import render, redirect |
26 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable | 26 | from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, LogMessage, Variable |
27 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency | 27 | from orm.models import Task_Dependency, Recipe_Dependency, Package, Package_File, Package_Dependency |
28 | from orm.models import Target_Installed_Package, Target_Image_File | 28 | from orm.models import Target_Installed_Package, Target_File, Target_Image_File |
29 | from django.views.decorators.cache import cache_control | 29 | from django.views.decorators.cache import cache_control |
30 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | 30 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger |
31 | from django.http import HttpResponseBadRequest | 31 | from django.http import HttpResponseBadRequest |
@@ -231,6 +231,25 @@ def builds(request): | |||
231 | else: | 231 | else: |
232 | b.eta = 0 | 232 | b.eta = 0 |
233 | 233 | ||
234 | # set up list of fstypes for each build | ||
235 | fstypes_map = {}; | ||
236 | for build in build_info: | ||
237 | targets = Target.objects.filter( build_id = build.id ) | ||
238 | comma = ""; | ||
239 | extensions = ""; | ||
240 | for t in targets: | ||
241 | if ( not t.is_image ): | ||
242 | continue | ||
243 | tif = Target_Image_File.objects.filter( target_id = t.id ) | ||
244 | for i in tif: | ||
245 | s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name) | ||
246 | if s == i.file_name: | ||
247 | s=re.sub('.*\.', '', i.file_name) | ||
248 | if None == re.search(s,extensions): | ||
249 | extensions += comma + s | ||
250 | comma = ", " | ||
251 | fstypes_map[build.id]=extensions | ||
252 | |||
234 | # send the data to the template | 253 | # send the data to the template |
235 | context = { | 254 | context = { |
236 | # specific info for | 255 | # specific info for |
@@ -238,6 +257,7 @@ def builds(request): | |||
238 | # TODO: common objects for all table views, adapt as needed | 257 | # TODO: common objects for all table views, adapt as needed |
239 | 'objects' : build_info, | 258 | 'objects' : build_info, |
240 | 'objectname' : "builds", | 259 | 'objectname' : "builds", |
260 | 'fstypes' : fstypes_map, | ||
241 | 'search_term' : search_term, | 261 | 'search_term' : search_term, |
242 | 'total_count' : queryset_with_search.count(), | 262 | 'total_count' : queryset_with_search.count(), |
243 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns | 263 | # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns |