From 39ca8b429b6244e9649e7303cbb240adf007bf22 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Thu, 25 Sep 2014 16:10:33 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/toaster') diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index defbbbfa4c..ea81423d51 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -742,7 +742,6 @@ class LazyEncoder(json.JSONEncoder): return super(LazyEncoder, self).default(obj) from toastergui.templatetags.projecttags import filtered_filesizeformat -from django import template import os def _get_dir_entries(build_id, target_id, start): 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 if o.sym_target_id != "" and o.sym_target_id != None: entry['link_to'] = Target_File.objects.get(pk=o.sym_target_id).path - t = template.Template('{% load projecttags %} {{ size|filtered_filesizeformat }}') - c = template.Context({'size': o.size}) - entry['size'] = str(t.render(c)) + entry['size'] = filtered_filesizeformat(o.size) if entry['link_to'] != None: entry['permission'] = node_str[o.inodetype] + o.permission else: @@ -808,7 +805,10 @@ def _get_dir_entries(build_id, target_id, start): entry['group'] = o.group response.append(entry) - except: + except Exception as e: + print "Exception ", e + import traceback + traceback.print_exc(e) pass # sort by directories first, then by name -- cgit v1.2.3-54-g00ecf