summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py18
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py14
2 files changed, 16 insertions, 16 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index be75b214ac..b953aa1580 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -142,7 +142,7 @@ def variable_parent_name(value):
142 """ 142 """
143 value=re.sub('_\$.*', '', value) 143 value=re.sub('_\$.*', '', value)
144 return re.sub('_[a-z].*', '', value) 144 return re.sub('_[a-z].*', '', value)
145 145
146@register.filter 146@register.filter
147def filter_setin_files(file_list,matchstr): 147def filter_setin_files(file_list,matchstr):
148 """ filter/search the 'set in' file lists. Note 148 """ filter/search the 'set in' file lists. Note
@@ -150,7 +150,7 @@ def filter_setin_files(file_list,matchstr):
150 the <p> marks, but this is safe as the data 150 the <p> marks, but this is safe as the data
151 is file paths 151 is file paths
152 """ 152 """
153 153
154 # no filters, show last file (if any) 154 # no filters, show last file (if any)
155 if matchstr == ":": 155 if matchstr == ":":
156 if file_list: 156 if file_list:
@@ -162,24 +162,24 @@ def filter_setin_files(file_list,matchstr):
162 htmlstr="" 162 htmlstr=""
163 # match only filters 163 # match only filters
164 if search == '': 164 if search == '':
165 for i in range(len(file_list)): 165 for i in range(len(file_list)):
166 if re.search(filter, file_list[i].file_name): 166 if re.search(filter, file_list[i].file_name):
167 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 167 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
168 htmlstr += file_list[i].file_name + "<p>" 168 htmlstr += file_list[i].file_name + "<p>"
169 return htmlstr 169 return htmlstr
170 170
171 # match only search string, plus always last file 171 # match only search string, plus always last file
172 if filter == "": 172 if filter == "":
173 for i in range(len(file_list)-1): 173 for i in range(len(file_list)-1):
174 if re.search(search,file_list[i].file_name): 174 if re.search(search,file_list[i].file_name):
175 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 175 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
176 htmlstr += file_list[i].file_name + "<p>" 176 htmlstr += file_list[i].file_name + "<p>"
177 if htmlstr.find(file_list[len(file_list)-1].file_name) < 0: 177 if htmlstr.find(file_list[len(file_list)-1].file_name) < 0:
178 htmlstr += file_list[len(file_list)-1].file_name 178 htmlstr += file_list[len(file_list)-1].file_name
179 return htmlstr 179 return htmlstr
180 180
181 # match filter or search string 181 # match filter or search string
182 for i in range(len(file_list)): 182 for i in range(len(file_list)):
183 if re.search(filter, file_list[i].file_name) or re.search(search,file_list[i].file_name): 183 if re.search(filter, file_list[i].file_name) or re.search(search,file_list[i].file_name):
184 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 184 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
185 htmlstr += file_list[i].file_name + "<p>" 185 htmlstr += file_list[i].file_name + "<p>"
@@ -218,7 +218,7 @@ def filtered_packageversion(version, revision):
218 else "" 218 else ""
219 """ 219 """
220 return "" if (not version or version == "") else version if (not revision or revision == "") else version + "-" + revision 220 return "" if (not version or version == "") else version if (not revision or revision == "") else version + "-" + revision
221 221
222@register.filter 222@register.filter
223def filter_sizeovertotal(package_object, total_size): 223def filter_sizeovertotal(package_object, total_size):
224 """ Return the % size of the package over the total size argument 224 """ Return the % size of the package over the total size argument
@@ -227,7 +227,7 @@ def filter_sizeovertotal(package_object, total_size):
227 size = package_object.installed_size 227 size = package_object.installed_size
228 if size == None or size == '': 228 if size == None or size == '':
229 size = package_object.size 229 size = package_object.size
230 230
231 return '{:.1%}'.format(float(size)/float(total_size)) 231 return '{:.1%}'.format(float(size)/float(total_size))
232 232
233from django.utils.safestring import mark_safe 233from django.utils.safestring import mark_safe
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 89c02d41ab..a57f001459 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -429,7 +429,7 @@ def builddashboard( request, build_id ):
429 ndx = 0; 429 ndx = 0;
430 f = i.file_name[ ndx + 1: ] 430 f = i.file_name[ ndx + 1: ]
431 imageFiles.append({ 'path': f, 'size' : i.file_size }) 431 imageFiles.append({ 'path': f, 'size' : i.file_size })
432 if ( t.is_image and 432 if ( t.is_image and
433 (( len( imageFiles ) <= 0 ) or ( len( t.license_manifest_path ) <= 0 ))): 433 (( len( imageFiles ) <= 0 ) or ( len( t.license_manifest_path ) <= 0 ))):
434 targetHasNoImages = True 434 targetHasNoImages = True
435 elem[ 'imageFiles' ] = imageFiles 435 elem[ 'imageFiles' ] = imageFiles
@@ -516,8 +516,8 @@ def task( request, build_id, task_id ):
516 } 516 }
517 if request.GET.get( 'show_matches', "" ): 517 if request.GET.get( 'show_matches', "" ):
518 context[ 'showing_matches' ] = True 518 context[ 'showing_matches' ] = True
519 context[ 'matching_tasks' ] = Task.objects.filter( 519 context[ 'matching_tasks' ] = Task.objects.filter(
520 sstate_checksum=task.sstate_checksum ).filter( 520 sstate_checksum=task.sstate_checksum ).filter(
521 build__completed_on__lt=task.build.completed_on).exclude( 521 build__completed_on__lt=task.build.completed_on).exclude(
522 order__isnull=True).exclude(outcome=Task.OUTCOME_NA).order_by('-build__completed_on') 522 order__isnull=True).exclude(outcome=Task.OUTCOME_NA).order_by('-build__completed_on')
523 523
@@ -551,14 +551,14 @@ def target_common( request, build_id, target_id, variant ):
551 mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'name:+'}; 551 mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'name:+'};
552 retval = _verify_parameters( request.GET, mandatory_parameters ) 552 retval = _verify_parameters( request.GET, mandatory_parameters )
553 if retval: 553 if retval:
554 return _redirect_parameters( 554 return _redirect_parameters(
555 variant, request.GET, mandatory_parameters, 555 variant, request.GET, mandatory_parameters,
556 build_id = build_id, target_id = target_id ) 556 build_id = build_id, target_id = target_id )
557 ( filter_string, search_term, ordering_string ) = _search_tuple( request, Package ) 557 ( filter_string, search_term, ordering_string ) = _search_tuple( request, Package )
558 558
559 # FUTURE: get rid of nested sub-queries replacing with ManyToMany field 559 # FUTURE: get rid of nested sub-queries replacing with ManyToMany field
560 queryset = Package.objects.filter( 560 queryset = Package.objects.filter(
561 size__gte = 0, 561 size__gte = 0,
562 id__in = Target_Installed_Package.objects.filter( 562 id__in = Target_Installed_Package.objects.filter(
563 target_id=target_id ).values( 'package_id' )) 563 target_id=target_id ).values( 'package_id' ))
564 packages_sum = queryset.aggregate( Sum( 'installed_size' )) 564 packages_sum = queryset.aggregate( Sum( 'installed_size' ))
@@ -682,7 +682,7 @@ his package',
682 'clclass' : 'layer_directory', 682 'clclass' : 'layer_directory',
683 'hidden' : 1, 683 'hidden' : 1,
684 } 684 }
685 context = { 685 context = {
686 'objectname': variant, 686 'objectname': variant,
687 'build' : Build.objects.filter( pk = build_id )[ 0 ], 687 'build' : Build.objects.filter( pk = build_id )[ 0 ],
688 'target' : Target.objects.filter( pk = target_id )[ 0 ], 688 'target' : Target.objects.filter( pk = target_id )[ 0 ],