From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3D57CE007B6; Wed, 6 May 2015 11:03:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id DF401E00306 for ; Wed, 6 May 2015 11:03:28 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 06 May 2015 11:03:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,380,1427785200"; d="scan'208";a="724797591" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga002.jf.intel.com with ESMTP; 06 May 2015 11:03:11 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 6 May 2015 19:03:09 +0100 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.5]) by irsmsx155.ger.corp.intel.com ([169.254.14.172]) with mapi id 14.03.0224.002; Wed, 6 May 2015 19:03:09 +0100 From: "Barros Pena, Belen" To: Ed Bartosh , "toaster@yoctoproject.org" Thread-Topic: [Toaster] [review-request][PATCH] bitbake: toastergui: show relative paths in configvars view Thread-Index: AQHQiCbpFH3RsJs8rEyV87AVjkHDyg== Date: Wed, 6 May 2015 18:03:09 +0000 Message-ID: References: <1430830785-30934-1-git-send-email-ed.bartosh@linux.intel.com> In-Reply-To: <1430830785-30934-1-git-send-email-ed.bartosh@linux.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.9.150325 x-originating-ip: [10.237.224.37] MIME-Version: 1.0 Subject: Re: [review-request][PATCH] bitbake: toastergui: show relative paths in configvars view X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 18:03:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: <67652CE69C82A54287B3EF7ABE2B117A@intel.com> Content-Transfer-Encoding: quoted-printable On 05/05/2015 13:59, "Ed Bartosh" wrote: >Stripped topdir from paths to config files in configvars view. Almost! Most paths are now ok, but we still seem to be showing full paths for files inside the /bitbake directory. It can be seen quite well it in this screenshot: http://i.imgur.com/Kk4WmeB.png=09 Thanks!! Bel=E9n > >[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 @@ > href=3D"#variable-{{variable.pk}}">{{variable.variable_value|truncatechars= :1 >53}} > href=3D"#variable-{{variable.pk}}"> > {% 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 %} > >- =20 >{{forloop.counter}}{{vh.file_name|cut_layer_path_prefix:layer >_names}}{{vh.operation}}{{vh.line_number}} >+ =20 >{{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. >=20 > 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 =3D 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 >=20 > # 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', >--=20 >2.1.4 > >--=20 >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster