From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mail.openembedded.org (Postfix) with ESMTP id 1F70C6AC3E for ; Tue, 5 May 2015 14:35:29 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 05 May 2015 07:35:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,372,1427785200"; d="scan'208";a="724013906" Received: from linux.intel.com ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 05 May 2015 07:35:30 -0700 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id 50E5A6A408D for ; Tue, 5 May 2015 07:35:02 -0700 (PDT) Date: Tue, 5 May 2015 17:35:24 +0300 From: Ed Bartosh To: openembedded-core@lists.openembedded.org Message-ID: <20150505143524.GA26276@linux.intel.com> References: <1430830633-30115-1-git-send-email-ed.bartosh@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <1430830633-30115-1-git-send-email-ed.bartosh@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [PATCH] bitbake: toastergui: show relative paths in configvars view X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ed.bartosh@linux.intel.com List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 14:35:34 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 05, 2015 at 03:57:13PM +0300, Ed Bartosh wrote: Sorry, wrong list. Please ignore. > Stripped topdir from paths to config files in configvars view. > > [YOCTO #7463] > > Signed-off-by: Ed Bartosh > --- > bitbake/lib/toaster/toastergui/templates/configvars.html | 4 ++-- > bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 6 ++++++ > bitbake/lib/toaster/toastergui/views.py | 2 ++ > 3 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/bitbake/lib/toaster/toastergui/templates/configvars.html b/bitbake/lib/toaster/toastergui/templates/configvars.html > index 3e4c7e8..99ffe8b 100644 > --- a/bitbake/lib/toaster/toastergui/templates/configvars.html > +++ b/bitbake/lib/toaster/toastergui/templates/configvars.html > @@ -55,7 +55,7 @@ > {{variable.variable_value|truncatechars:153}} > > {% if variable.vhistory.all %} {% autoescape off %} > - {{variable.vhistory.all | filter_setin_files:file_filter | cut_layer_path_prefix:layer_names}} > + {{variable.vhistory.all | filter_setin_files:file_filter | cut_layer_path_prefix:layer_names | cut_topdir_path_prefix:topdir}} > {% endautoescape %} {% endif %} > > > @@ -115,7 +115,7 @@ > > {% for vh in variable.vhistory.all %} > > - {{forloop.counter}}{{vh.file_name|cut_layer_path_prefix:layer_names}}{{vh.operation}}{{vh.line_number}} > + {{forloop.counter}}{{vh.file_name|cut_layer_path_prefix:layer_names|cut_topdir_path_prefix:topdir}}{{vh.operation}}{{vh.line_number}} > > {%endfor%} > > diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py > index 54700e3..67762a5 100644 > --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py > +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py > @@ -20,6 +20,7 @@ > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > > from datetime import datetime, timedelta > +from os.path import relpath > import re > from django import template > from django.utils import timezone > @@ -326,3 +327,8 @@ def cut_layer_path_prefix(fullpath,layer_names): > parts = re.split(lname, fullpath, 1) > return lname + parts[1] > return fullpath > + > +@register.filter > +def cut_topdir_path_prefix(fullpath, topdir): > + """Cut topdir from the fullpath.""" > + return relpath(fullpath, topdir) if fullpath.startswith(topdir) else fullpath > diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py > index 7849b50..d2cd367 100755 > --- a/bitbake/lib/toaster/toastergui/views.py > +++ b/bitbake/lib/toaster/toastergui/views.py > @@ -39,6 +39,7 @@ from datetime import timedelta, datetime, date > from django.utils import formats > from toastergui.templatetags.projecttags import json as jsonfilter > import json > +from os.path import dirname > > # all new sessions should come through the landing page; > # determine in which mode we are running in, and redirect appropriately > @@ -1326,6 +1327,7 @@ def configvars(request, build_id): > 'default_orderby' : 'variable_name:+', > 'search_term':search_term, > 'layer_names' : layer_names, > + 'topdir': dirname(build_dir), > # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns > 'tablecols' : [ > {'name': 'Variable', > -- > 2.1.4 > -- -- Regards, Ed