Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 85AA5E00C27; Fri, 15 Jan 2016 03:44:54 -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=-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 * [134.134.136.20 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D8F70E00BF5 for ; Fri, 15 Jan 2016 03:44:31 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 15 Jan 2016 03:44:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,299,1449561600"; d="scan'208";a="633885739" Received: from ffolivei-mobl2.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.20.40]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jan 2016 03:44:31 -0800 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 15 Jan 2016 11:43:50 +0000 Message-Id: <1452858230-31457-24-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1452858230-31457-1-git-send-email-elliot.smith@intel.com> References: <1452858230-31457-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 23/23] toaster: toastergui: code formatting and clean-up 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: Fri, 15 Jan 2016 11:44:54 -0000 Minor fixes to code formatting and small improvements from code review. Signed-off-by: Elliot Smith --- bitbake/lib/toaster/orm/models.py | 12 +++--------- bitbake/lib/toaster/toastergui/tables.py | 4 +++- bitbake/lib/toaster/toastergui/views.py | 5 ++--- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 3dc4d6d..ac2aa9e 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -477,15 +477,9 @@ class Build(models.Model): targets in this build """ targets = self.target_set.all() - target_labels = [] - target_label = None - - for target in targets: - target_label = target.target - if target.task: - target_label = target_label + ':' + target.task - target_labels.append(target_label) - + target_labels = [target.target + + (':' + target.task if target.task else '') + for target in targets] target_labels.sort() return target_labels diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 2279731..e9f1fdc 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -688,7 +688,9 @@ class ProjectsTable(ToasterTable): self.queryset = queryset - # columns: last activity on (updated) - DEFAULT, project (name), release, machine, number of builds, last build outcome, recipe (name), errors, warnings, image files + # columns: last activity on (updated) - DEFAULT, project (name), release, + # machine, number of builds, last build outcome, recipe (name), errors, + # warnings, image files def setup_columns(self, *args, **kwargs): name_template = ''' {% load project_url_tag %} diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 4f7b50f..59e16b2 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -462,7 +462,7 @@ def builddashboard( request, build_id ): for t in tgts: elem = { } elem[ 'target' ] = t - if ( t.is_image ): + if t.is_image: hasImages = True npkg = 0 pkgsz = 0 @@ -481,8 +481,7 @@ def builddashboard( request, build_id ): ndx = 0; f = i.file_name[ ndx + 1: ] imageFiles.append({ 'id': i.id, 'path': f, 'size' : i.file_size }) - if ( t.is_image and - (( len( imageFiles ) <= 0 ) or ( len( t.license_manifest_path ) <= 0 ))): + if t.is_image and (len(imageFiles) <= 0 or len(t.license_manifest_path) <= 0): targetHasNoImages = True elem[ 'imageFiles' ] = imageFiles elem[ 'targetHasNoImages' ] = targetHasNoImages -- 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.