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/toastergui/views.py | |
| 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/toastergui/views.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 24 |
1 files changed, 22 insertions, 2 deletions
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 |
