summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorAlexandru Damian <alexandru.damian@intel.com>2015-08-18 17:28:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-19 18:05:55 +0100
commitc9455a7484fa5ead1a90e40b78512867b4285020 (patch)
tree152a114ce3e7e528d3b3c0331c39e737b6bafd7d /bitbake/lib
parent07b58c97342d4f2efff80891981e8ee63dd198d0 (diff)
downloadpoky-c9455a7484fa5ead1a90e40b78512867b4285020.tar.gz
bitbake: toaster: fix pylint errors
Prompted by issues discovered during running pylint on the toaster sources, this patch fixes: * missing import in toaster ui * improper call of function in toaster ui (logger.debug) * improper function definitions in bbcontroller * invalid references to objects in bldcontrol.models * proper initialization of object fields in ToasterTables Also inhibiting specific pylint errors in files where the problems are mis-identified. (Bitbake rev: 1c71955c416fb68455f7f70669aba4202c411807) Signed-off-by: Alexandru Damian <alexandru.damian@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/toasterui.py5
-rw-r--r--bitbake/lib/toaster/bldcontrol/bbcontroller.py2
-rw-r--r--bitbake/lib/toaster/orm/models.py2
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py4
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py3
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/perf.py7
6 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index f30f89e409..767bfabe31 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -21,6 +21,7 @@
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 22
23from __future__ import division 23from __future__ import division
24import sys
24try: 25try:
25 import bb 26 import bb
26except RuntimeError as exc: 27except RuntimeError as exc:
@@ -255,10 +256,10 @@ def main(server, eventHandler, params ):
255 # we start a new build info 256 # we start a new build info
256 if buildinfohelper.brbe is not None: 257 if buildinfohelper.brbe is not None:
257 258
258 logger.debug(1, "ToasterUI under BuildEnvironment management - exiting after the build") 259 logger.debug("ToasterUI under BuildEnvironment management - exiting after the build")
259 server.terminateServer() 260 server.terminateServer()
260 else: 261 else:
261 logger.debug(1, "ToasterUI prepared for new build") 262 logger.debug("ToasterUI prepared for new build")
262 errors = 0 263 errors = 0
263 warnings = 0 264 warnings = 0
264 taskfailures = [] 265 taskfailures = []
diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index 9dd01e0deb..ad70ac8b54 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -177,7 +177,7 @@ class BuildEnvironmentController(object):
177 177
178 return BitbakeController(self.connection) 178 return BitbakeController(self.connection)
179 179
180 def getArtifact(path): 180 def getArtifact(self, path):
181 """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as 181 """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as
182 up to the implementing BEC. The return MUST be a REST URL where a GET will actually return 182 up to the implementing BEC. The return MUST be a REST URL where a GET will actually return
183 the content of the artifact, e.g. for use as a "download link" in a web UI. 183 the content of the artifact, e.g. for use as a "download link" in a web UI.
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index de0070272e..92fcaa7adf 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -81,7 +81,7 @@ class ProjectManager(models.Manager):
81 81
82 for rdl in release.releasedefaultlayer_set.all(): 82 for rdl in release.releasedefaultlayer_set.all():
83 try: 83 try:
84 lv =Layer_Version.objects.filter(layer__name = rdl.layer_name, up_branch__name = release.branch_name)[0].get_equivalents_wpriority(prj)[0] 84 lv = Layer_Version.objects.filter(layer__name = rdl.layer_name, up_branch__name = release.branch_name)[0].get_equivalents_wpriority(prj)[0]
85 ProjectLayer.objects.create( project = prj, 85 ProjectLayer.objects.create( project = prj,
86 layercommit = lv, 86 layercommit = lv,
87 optional = False ) 87 optional = False )
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 2aadc75b9e..586a69c314 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -19,6 +19,10 @@
19# with this program; if not, write to the Free Software Foundation, Inc., 19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22# pylint: disable=method-hidden
23# Gives E:848, 4: An attribute defined in json.encoder line 162 hides this method (method-hidden)
24# which is an invalid warning
25
22import operator,re 26import operator,re
23 27
24from django.db.models import F, Q, Sum, Count, Max 28from django.db.models import F, Q, Sum, Count, Max
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py
index 2adf574783..eb2914d87c 100644
--- a/bitbake/lib/toaster/toastergui/widgets.py
+++ b/bitbake/lib/toaster/toastergui/widgets.py
@@ -334,6 +334,9 @@ class ToasterTemplateView(TemplateView):
334 # renders a instance in a template, or returns the context as json 334 # renders a instance in a template, or returns the context as json
335 # the class-equivalent of the _template_renderer decorator for views 335 # the class-equivalent of the _template_renderer decorator for views
336 336
337 def __init__(self, *args, **kwargs):
338 super(ToasterTemplateView, self).__init__(*args, **kwargs)
339 self.context_entries = []
337 340
338 def get(self, *args, **kwargs): 341 def get(self, *args, **kwargs):
339 if self.request.GET.get('format', None) == 'json': 342 if self.request.GET.get('format', None) == 'json':
diff --git a/bitbake/lib/toaster/toastermain/management/commands/perf.py b/bitbake/lib/toaster/toastermain/management/commands/perf.py
index d28f26ab16..71a48e95d8 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/perf.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/perf.py
@@ -2,7 +2,12 @@ from django.core.management.base import BaseCommand
2from django.test.client import Client 2from django.test.client import Client
3import os, sys, re 3import os, sys, re
4import requests 4import requests
5import toastermain.settings as settings 5from django.conf import settings
6
7# pylint: disable=E1103
8# Instance of 'WSGIRequest' has no 'status_code' member
9# (but some types could not be inferred) (maybe-no-member)
10
6 11
7class Command(BaseCommand): 12class Command(BaseCommand):
8 help = "Test the response time for all toaster urls" 13 help = "Test the response time for all toaster urls"