From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: by yocto-www.yoctoproject.org (Postfix, from userid 118)
id CB39EE00CCC; Tue, 23 Feb 2016 04:22:30 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
yocto-www.yoctoproject.org
X-Spam-Level:
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1
X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at
http://www.dnswl.org/, low * trust
* [74.125.82.44 listed in list.dnswl.org]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44])
by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0CFAFE00C25
for ; Tue, 23 Feb 2016 04:22:27 -0800 (PST)
Received: by mail-wm0-f44.google.com with SMTP id g62so207434744wme.0
for ; Tue, 23 Feb 2016 04:22:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=intel-com.20150623.gappssmtp.com; s=20150623;
h=subject:to:references:from:message-id:date:user-agent:mime-version
:in-reply-to:content-type:content-transfer-encoding;
bh=icJAeKlGdmrTT38idmNl+BAnHr5m3JeRfKgaY6YPRBU=;
b=F7o+GV09ZF9v28iq/UqxJw7Swrlte7LvRK5H38UJTmYnnrxPtplwiV52zuvjz9Wb6o
EXDFlfYHW+NYbwBCyEvuJ/Z+YWw64gbHSMwmS1dLQfhE6Hvn8V+uf4Mv8xyIJGm0z/rq
tLwlyhsw0evM8G2ruAppX0os1TP1Xzs/kh8byLmF46AHOpYQuztdN2VUAY+4GcCvN/Vi
yrjNUnnxEEDLrNvH7Z1vzP7cWa+YFiHsnWDZaGkazaaxyxn3xfiLKfRs64X/IogP1rpe
VO1C7Ag0VT5gt72ElZJ+zDQeoL0TmLE28Rwm9vGYSOSo9mA8N+uNQ26GcZu2eLDKdXvz
NvPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:subject:to:references:from:message-id:date
:user-agent:mime-version:in-reply-to:content-type
:content-transfer-encoding;
bh=icJAeKlGdmrTT38idmNl+BAnHr5m3JeRfKgaY6YPRBU=;
b=jPsOz1vb10sBU6cKsetgloPTZ6zhufEvM+4WW+xAbwGBp1b9UAMZ+7grMc+FFxuXJw
CaIz12YCRtNzGXB7SVCLp8JX064nGe5fo+Dia3MGX2SdnwYuuCyc2pw9aD4dpuEKB+Ko
rcUaLhITpHg1+WVjoM22QOG7EGp1D29+Y/JEokrxx9fKUN9xwIxazWPxe+7riMD6CJ2P
hahsoYUTbgukNDXyc8OtYtJnkkP6o8zfuG4+RaT70WJVtkoxl8QFdZMlUuLXt5DuxKqT
VvJqYrIu82tsq5m/i5yiLw1qOTvRO96NVmRKo6vQ53vlWLyt8ZlGh3vqpAsrh/CPScm8
YHcQ==
X-Gm-Message-State: AG10YOTfuqfyytULJxL/WppsGCmxabvlOwsLgm6BOpNjI6XenrnAwQ8DQBtcYseAB0B4/I8N
X-Received: by 10.194.78.148 with SMTP id b20mr33140661wjx.71.1456230146259;
Tue, 23 Feb 2016 04:22:26 -0800 (PST)
Received: from [192.168.0.44]
(host109-149-84-27.range109-149.btcentralplus.com. [109.149.84.27])
by smtp.googlemail.com with ESMTPSA id
n131sm25870692wmf.9.2016.02.23.04.22.25
for (version=TLSv1/SSLv3 cipher=OTHER);
Tue, 23 Feb 2016 04:22:25 -0800 (PST)
To: toaster@yoctoproject.org
References: <1454407914-26139-1-git-send-email-elliot.smith@intel.com>
From: Michael Wood
Message-ID: <56CC4F00.4090000@intel.com>
Date: Tue, 23 Feb 2016 12:22:24 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To:
Subject: Re: [review-request][PATCH] toaster: show suffix for image files and basename for artifact files
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: Tue, 23 Feb 2016 12:22:31 -0000
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Thanks sent to bitbake-devel and pushed to toaster-next
On 02/02/16 10:13, Smith, Elliot wrote:
> On 2 February 2016 at 10:11, Elliot Smith > wrote:
>
> The build dashboard doesn't show image and artifact files correctly,
> as it shows the full filename for images and the filename plus
> path relative to DEPLOY_DIR for artifacts.
>
>
> Note that Belen has already informally reviewed this patch and
> verified its behaviour:
> https://lists.yoctoproject.org/pipermail/toaster/2016-February/003760.html
>
> Elliot
>
>
> Instead, show just the suffix for image files, and the basename
> for artifact files.
>
> Signed-off-by: Elliot Smith >
> ---
> bitbake/lib/toaster/orm/models.py | 8 ++++++++
> .../toastergui/templates/builddashboard.html | 22
> +++++++++++-----------
> bitbake/lib/toaster/toastergui/views.py | 7 ++++++-
> 3 files changed, 25 insertions(+), 12 deletions(-)
>
> diff --git a/bitbake/lib/toaster/orm/models.py
> b/bitbake/lib/toaster/orm/models.py
> index ac2aa9e..bb95b75 100644
> --- a/bitbake/lib/toaster/orm/models.py
> +++ b/bitbake/lib/toaster/orm/models.py
> @@ -522,6 +522,8 @@ class BuildArtifact(models.Model):
>
> return self.file_name
>
> + def get_basename(self):
> + return os.path.basename(self.file_name)
>
> def is_available(self):
> return
> self.build.buildrequest.environment.has_artifact(self.file_name)
> @@ -560,6 +562,12 @@ class Target_Image_File(models.Model):
> file_name = models.FilePathField(max_length=254)
> file_size = models.IntegerField()
>
> + @property
> + def suffix(self):
> + filename, suffix = os.path.splitext(self.file_name)
> + suffix = suffix.lstrip('.')
> + return suffix
> +
> class Target_File(models.Model):
> ITYPE_REGULAR = 1
> ITYPE_DIRECTORY = 2
> diff --git
> a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
> b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
> index 323bbbb..5dac4db 100644
> --- a/bitbake/lib/toaster/toastergui/templates/builddashboard.html
> +++ b/bitbake/lib/toaster/toastergui/templates/builddashboard.html
> @@ -111,7 +111,7 @@
>
>
>
> - {% else %}
> + {% else %}
>
>
>
> @@ -126,18 +126,18 @@
>
>
>
> - {% for i in target.imageFiles %}
> - {% if build.project %}
> - - {{i.path}}
> - {% else %}
> -
- {{i.path}}
> - {% endif %}
> - ({{i.size|filtered_filesizeformat}})
> - {% endfor %}
> + {% for i in target.imageFiles %}
> + -
> +
> + {{i.suffix}}
> +
> + ({{i.size|filtered_filesizeformat}})
> +
> + {% endfor %}
>
>
>
> - {% endif %}
> + {% endif %}
>
> {% endif %}
> {% endfor %}
> @@ -161,7 +161,7 @@
>
> {% for ba in
> build.buildartifact_set.all|dictsort:"file_name" %}
>
> - {{ba.get_local_file_name}}
> + {{ba.get_basename}}
>
>
> ({{ba.file_size|filtered_filesizeformat}})
> diff --git a/bitbake/lib/toaster/toastergui/views.py
> b/bitbake/lib/toaster/toastergui/views.py
> index 995937a..4932885 100755
> --- a/bitbake/lib/toaster/toastergui/views.py
> +++ b/bitbake/lib/toaster/toastergui/views.py
> @@ -480,7 +480,12 @@ def builddashboard( request, build_id ):
> if ( ndx < 0 ):
> ndx = 0;
> f = i.file_name[ ndx + 1: ]
> - imageFiles.append({ 'id': i.id
, 'path':
> f, 'size' : i.file_size })
> + imageFiles.append({
> + 'id': i.id ,
> + 'path': f,
> + 'size': i.file_size,
> + 'suffix': i.suffix
> + })
> if t.is_image and (len(imageFiles) <= 0 or
> len(t.license_manifest_path) <= 0):
> targetHasNoImages = True
> elem[ 'imageFiles' ] = imageFiles
> --
> Elliot Smith
> Software Engineer
> Intel OTC
>
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
>
>
> --
> Elliot Smith
> Software Engineer
> Intel Open Source Technology Centre
>
>