mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02:00
bitbake: toastergui fix size rendering in dirinfo page
We fix the rendering of the size field in dirinfo-related pages by directly calling filtered_filesizeformat and not rendering it through the template engine. Additionally, we enable error dumping into logs if an Exception happens. [YOCTO #6669] (Bitbake rev: afa2431c21b8271b05dc4cca4265f98d9f338007) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d6709b0133
commit
39ca8b429b
@@ -742,7 +742,6 @@ class LazyEncoder(json.JSONEncoder):
|
|||||||
return super(LazyEncoder, self).default(obj)
|
return super(LazyEncoder, self).default(obj)
|
||||||
|
|
||||||
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
||||||
from django import template
|
|
||||||
import os
|
import os
|
||||||
def _get_dir_entries(build_id, target_id, start):
|
def _get_dir_entries(build_id, target_id, start):
|
||||||
node_str = {
|
node_str = {
|
||||||
@@ -797,9 +796,7 @@ def _get_dir_entries(build_id, target_id, start):
|
|||||||
# don't use resolved path from above, show immediate link-to
|
# don't use resolved path from above, show immediate link-to
|
||||||
if o.sym_target_id != "" and o.sym_target_id != None:
|
if o.sym_target_id != "" and o.sym_target_id != None:
|
||||||
entry['link_to'] = Target_File.objects.get(pk=o.sym_target_id).path
|
entry['link_to'] = Target_File.objects.get(pk=o.sym_target_id).path
|
||||||
t = template.Template('{% load projecttags %} {{ size|filtered_filesizeformat }}')
|
entry['size'] = filtered_filesizeformat(o.size)
|
||||||
c = template.Context({'size': o.size})
|
|
||||||
entry['size'] = str(t.render(c))
|
|
||||||
if entry['link_to'] != None:
|
if entry['link_to'] != None:
|
||||||
entry['permission'] = node_str[o.inodetype] + o.permission
|
entry['permission'] = node_str[o.inodetype] + o.permission
|
||||||
else:
|
else:
|
||||||
@@ -808,7 +805,10 @@ def _get_dir_entries(build_id, target_id, start):
|
|||||||
entry['group'] = o.group
|
entry['group'] = o.group
|
||||||
response.append(entry)
|
response.append(entry)
|
||||||
|
|
||||||
except:
|
except Exception as e:
|
||||||
|
print "Exception ", e
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc(e)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# sort by directories first, then by name
|
# sort by directories first, then by name
|
||||||
|
|||||||
Reference in New Issue
Block a user