]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toastergui: code formatting and clean-up
authorElliot Smith <elliot.smith@intel.com>
Fri, 15 Jan 2016 11:01:06 +0000 (13:01 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Jan 2016 16:29:50 +0000 (16:29 +0000)
Minor fixes to code formatting and small improvements from
code review.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/orm/models.py
lib/toaster/toastergui/tables.py
lib/toaster/toastergui/views.py

index 3dc4d6d891e21a287654f93c822c5decb99a7d0a..ac2aa9e469b31340db96b659a7588b578953e202 100644 (file)
@@ -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
index 227973114cb55254970ae59aea7f3f540036bbd3..e9f1fdccb1f0c3a9e04c0de57aecec9fbc2b7a8c 100644 (file)
@@ -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 %}
index 4f7b50f9dc845776d8a43ee36e13d04e5676f2a1..59e16b27b202db7fc0de8d5124cb53154d6a1c6a 100755 (executable)
@@ -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