summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorFrazer Clews <frazer.clews@codethink.co.uk>2020-01-16 16:55:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:31:05 +0000
commit0ac5174c7d39a3e49893df0d517d47bec1935555 (patch)
tree479496afb1da7814071e39e888e8926cd03bec57 /bitbake/lib
parent444bcb6cb6be8d5205fc88790360d864e633a555 (diff)
downloadpoky-0ac5174c7d39a3e49893df0d517d47bec1935555.tar.gz
bitbake: lib: remove unused imports
removed unused imports which made the code harder to read, and slightly but less efficient (Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/COW.py1
-rw-r--r--bitbake/lib/bb/build.py1
-rw-r--r--bitbake/lib/bb/cache.py1
-rw-r--r--bitbake/lib/bb/checksum.py1
-rw-r--r--bitbake/lib/bb/codeparser.py26
-rw-r--r--bitbake/lib/bb/cooker.py4
-rw-r--r--bitbake/lib/bb/event.py3
-rw-r--r--bitbake/lib/bb/fetch2/bzr.py2
-rw-r--r--bitbake/lib/bb/fetch2/clearcase.py1
-rw-r--r--bitbake/lib/bb/fetch2/cvs.py1
-rw-r--r--bitbake/lib/bb/fetch2/gitannex.py2
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py1
-rw-r--r--bitbake/lib/bb/fetch2/hg.py2
-rw-r--r--bitbake/lib/bb/fetch2/npm.py1
-rw-r--r--bitbake/lib/bb/fetch2/osc.py2
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py1
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py2
-rw-r--r--bitbake/lib/bb/fetch2/svn.py2
-rw-r--r--bitbake/lib/bb/fetch2/wget.py3
-rw-r--r--bitbake/lib/bb/monitordisk.py2
-rw-r--r--bitbake/lib/bb/msg.py2
-rw-r--r--bitbake/lib/bb/parse/ast.py4
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py2
-rw-r--r--bitbake/lib/bb/progress.py1
-rw-r--r--bitbake/lib/bb/runqueue.py4
-rw-r--r--bitbake/lib/bb/server/xmlrpcclient.py3
-rw-r--r--bitbake/lib/bb/server/xmlrpcserver.py3
-rw-r--r--bitbake/lib/bb/tests/cooker.py1
-rw-r--r--bitbake/lib/bb/tests/cow.py2
-rw-r--r--bitbake/lib/bb/tests/fetch.py1
-rw-r--r--bitbake/lib/bb/tests/runqueue.py1
-rw-r--r--bitbake/lib/bb/tinfoil.py4
-rw-r--r--bitbake/lib/bb/ui/knotty.py1
-rw-r--r--bitbake/lib/bb/ui/ncurses.py3
-rw-r--r--bitbake/lib/bb/ui/taskexp.py2
-rw-r--r--bitbake/lib/bb/utils.py1
-rw-r--r--bitbake/lib/bs4/builder/_html5lib.py1
-rw-r--r--bitbake/lib/bs4/dammit.py8
-rw-r--r--bitbake/lib/bs4/element.py1
-rw-r--r--bitbake/lib/bs4/testing.py1
-rw-r--r--bitbake/lib/bs4/tests/test_docs.py4
-rw-r--r--bitbake/lib/bs4/tests/test_htmlparser.py1
-rw-r--r--bitbake/lib/bs4/tests/test_lxml.py8
-rw-r--r--bitbake/lib/bs4/tests/test_soup.py6
-rw-r--r--bitbake/lib/bs4/tests/test_tree.py11
-rw-r--r--bitbake/lib/hashserv/client.py1
-rw-r--r--bitbake/lib/layerindexlib/cooker.py3
-rw-r--r--bitbake/lib/layerindexlib/plugin.py3
-rw-r--r--bitbake/lib/layerindexlib/tests/cooker.py3
-rw-r--r--bitbake/lib/layerindexlib/tests/layerindexobj.py6
-rw-r--r--bitbake/lib/layerindexlib/tests/restapi.py3
-rw-r--r--bitbake/lib/toaster/bldcollector/urls.py2
-rw-r--r--bitbake/lib/toaster/bldcollector/views.py8
-rw-r--r--bitbake/lib/toaster/bldcontrol/admin.py1
-rw-r--r--bitbake/lib/toaster/bldcontrol/bbcontroller.py4
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py11
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py4
-rw-r--r--bitbake/lib/toaster/bldcontrol/models.py3
-rw-r--r--bitbake/lib/toaster/orm/management/commands/lsupdates.py2
-rw-r--r--bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py2
-rw-r--r--bitbake/lib/toaster/tests/browser/selenium_helpers_base.py1
-rw-r--r--bitbake/lib/toaster/tests/browser/test_project_config_page.py3
-rw-r--r--bitbake/lib/toaster/tests/functional/test_functional_basic.py1
-rw-r--r--bitbake/lib/toaster/toastergui/api.py3
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py9
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py1
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py2
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py5
-rw-r--r--bitbake/lib/toaster/toastergui/views.py9
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/builddelete.py4
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/buildimport.py6
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/buildslist.py3
72 files changed, 36 insertions, 202 deletions
diff --git a/bitbake/lib/bb/COW.py b/bitbake/lib/bb/COW.py
index d26e981951..bc20ce38e2 100644
--- a/bitbake/lib/bb/COW.py
+++ b/bitbake/lib/bb/COW.py
@@ -10,7 +10,6 @@
10 10
11 11
12import copy 12import copy
13import types
14ImmutableTypes = ( 13ImmutableTypes = (
15 bool, 14 bool,
16 complex, 15 complex,
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 3d9cc10c8c..b6d23e6805 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -15,7 +15,6 @@
15import os 15import os
16import sys 16import sys
17import logging 17import logging
18import shlex
19import glob 18import glob
20import time 19import time
21import stat 20import stat
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index ead8abc5d8..a5aaf3b999 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -17,7 +17,6 @@
17# 17#
18 18
19import os 19import os
20import sys
21import logging 20import logging
22import pickle 21import pickle
23from collections import defaultdict 22from collections import defaultdict
diff --git a/bitbake/lib/bb/checksum.py b/bitbake/lib/bb/checksum.py
index 677020f497..1d50a26426 100644
--- a/bitbake/lib/bb/checksum.py
+++ b/bitbake/lib/bb/checksum.py
@@ -9,7 +9,6 @@ import glob
9import operator 9import operator
10import os 10import os
11import stat 11import stat
12import pickle
13import bb.utils 12import bb.utils
14import logging 13import logging
15from bb.cache import MultiProcessCache 14from bb.cache import MultiProcessCache
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index fd2c4734f0..25a7ac69d3 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -25,13 +25,11 @@ import ast
25import sys 25import sys
26import codegen 26import codegen
27import logging 27import logging
28import pickle
29import bb.pysh as pysh 28import bb.pysh as pysh
30import os.path
31import bb.utils, bb.data 29import bb.utils, bb.data
32import hashlib 30import hashlib
33from itertools import chain 31from itertools import chain
34from bb.pysh import pyshyacc, pyshlex, sherrors 32from bb.pysh import pyshyacc, pyshlex
35from bb.cache import MultiProcessCache 33from bb.cache import MultiProcessCache
36 34
37logger = logging.getLogger('BitBake.CodeParser') 35logger = logging.getLogger('BitBake.CodeParser')
@@ -58,30 +56,10 @@ def check_indent(codestr):
58 56
59 return codestr 57 return codestr
60 58
61
62# Basically pickle, in python 2.7.3 at least, does badly with data duplication
63# upon pickling and unpickling. Combine this with duplicate objects and things
64# are a mess.
65#
66# When the sets are originally created, python calls intern() on the set keys
67# which significantly improves memory usage. Sadly the pickle/unpickle process
68# doesn't call intern() on the keys and results in the same strings being duplicated
69# in memory. This also means pickle will save the same string multiple times in
70# the cache file.
71#
72# By having shell and python cacheline objects with setstate/getstate, we force
73# the object creation through our own routine where we can call intern (via internSet).
74#
75# We also use hashable frozensets and ensure we use references to these so that
76# duplicates can be removed, both in memory and in the resulting pickled data.
77#
78# By playing these games, the size of the cache file shrinks dramatically
79# meaning faster load times and the reloaded cache files also consume much less
80# memory. Smaller cache files, faster load times and lower memory usage is good.
81#
82# A custom getstate/setstate using tuples is actually worth 15% cachesize by 59# A custom getstate/setstate using tuples is actually worth 15% cachesize by
83# avoiding duplication of the attribute names! 60# avoiding duplication of the attribute names!
84 61
62
85class SetCache(object): 63class SetCache(object):
86 def __init__(self): 64 def __init__(self):
87 self.setcache = {} 65 self.setcache = {}
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index b74affa7ec..3d65b0cb74 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -10,7 +10,6 @@
10# 10#
11 11
12import sys, os, glob, os.path, re, time 12import sys, os, glob, os.path, re, time
13import atexit
14import itertools 13import itertools
15import logging 14import logging
16import multiprocessing 15import multiprocessing
@@ -18,14 +17,11 @@ import sre_constants
18import threading 17import threading
19from io import StringIO, UnsupportedOperation 18from io import StringIO, UnsupportedOperation
20from contextlib import closing 19from contextlib import closing
21from functools import wraps
22from collections import defaultdict, namedtuple 20from collections import defaultdict, namedtuple
23import bb, bb.exceptions, bb.command 21import bb, bb.exceptions, bb.command
24from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build 22from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build
25import queue 23import queue
26import signal 24import signal
27import subprocess
28import errno
29import prserv.serv 25import prserv.serv
30import pyinotify 26import pyinotify
31import json 27import json
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index d44621edf4..42143e7407 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -10,8 +10,7 @@ BitBake build tools.
10# SPDX-License-Identifier: GPL-2.0-only 10# SPDX-License-Identifier: GPL-2.0-only
11# 11#
12 12
13import os, sys 13import sys
14import warnings
15import pickle 14import pickle
16import logging 15import logging
17import atexit 16import atexit
diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py
index c56d875300..566ace9f05 100644
--- a/bitbake/lib/bb/fetch2/bzr.py
+++ b/bitbake/lib/bb/fetch2/bzr.py
@@ -14,8 +14,6 @@ BitBake 'Fetch' implementation for bzr.
14# 14#
15 15
16import os 16import os
17import sys
18import logging
19import bb 17import bb
20from bb.fetch2 import FetchMethod 18from bb.fetch2 import FetchMethod
21from bb.fetch2 import FetchError 19from bb.fetch2 import FetchError
diff --git a/bitbake/lib/bb/fetch2/clearcase.py b/bitbake/lib/bb/fetch2/clearcase.py
index ad2f3edc74..49d7ae1b09 100644
--- a/bitbake/lib/bb/fetch2/clearcase.py
+++ b/bitbake/lib/bb/fetch2/clearcase.py
@@ -49,7 +49,6 @@ User credentials:
49# 49#
50 50
51import os 51import os
52import sys
53import shutil 52import shutil
54import bb 53import bb
55from bb.fetch2 import FetchMethod 54from bb.fetch2 import FetchMethod
diff --git a/bitbake/lib/bb/fetch2/cvs.py b/bitbake/lib/bb/fetch2/cvs.py
index 1b35ba4cf0..29123a483c 100644
--- a/bitbake/lib/bb/fetch2/cvs.py
+++ b/bitbake/lib/bb/fetch2/cvs.py
@@ -14,7 +14,6 @@ BitBake build tools.
14# 14#
15 15
16import os 16import os
17import logging
18import bb 17import bb
19from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger 18from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
20from bb.fetch2 import runfetchcmd 19from bb.fetch2 import runfetchcmd
diff --git a/bitbake/lib/bb/fetch2/gitannex.py b/bitbake/lib/bb/fetch2/gitannex.py
index 1d497dcb0f..80a808d88f 100644
--- a/bitbake/lib/bb/fetch2/gitannex.py
+++ b/bitbake/lib/bb/fetch2/gitannex.py
@@ -8,11 +8,9 @@ BitBake 'Fetch' git annex implementation
8# SPDX-License-Identifier: GPL-2.0-only 8# SPDX-License-Identifier: GPL-2.0-only
9# 9#
10 10
11import os
12import bb 11import bb
13from bb.fetch2.git import Git 12from bb.fetch2.git import Git
14from bb.fetch2 import runfetchcmd 13from bb.fetch2 import runfetchcmd
15from bb.fetch2 import logger
16 14
17class GitANNEX(Git): 15class GitANNEX(Git):
18 def supports(self, ud, d): 16 def supports(self, ud, d):
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index c622771d21..aa121cbee1 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -24,7 +24,6 @@ from bb.fetch2.git import Git
24from bb.fetch2 import runfetchcmd 24from bb.fetch2 import runfetchcmd
25from bb.fetch2 import logger 25from bb.fetch2 import logger
26from bb.fetch2 import Fetch 26from bb.fetch2 import Fetch
27from bb.fetch2 import BBFetchException
28 27
29class GitSM(Git): 28class GitSM(Git):
30 def supports(self, ud, d): 29 def supports(self, ud, d):
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index e21115debf..8f503701ed 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -13,8 +13,6 @@ BitBake 'Fetch' implementation for mercurial DRCS (hg).
13# 13#
14 14
15import os 15import os
16import sys
17import logging
18import bb 16import bb
19import errno 17import errno
20from bb.fetch2 import FetchMethod 18from bb.fetch2 import FetchMethod
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 9700e61029..be21399e59 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -20,7 +20,6 @@ Usage in the recipe:
20""" 20"""
21 21
22import os 22import os
23import sys
24import urllib.request, urllib.parse, urllib.error 23import urllib.request, urllib.parse, urllib.error
25import json 24import json
26import subprocess 25import subprocess
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py
index 3e567155dc..f55db6f791 100644
--- a/bitbake/lib/bb/fetch2/osc.py
+++ b/bitbake/lib/bb/fetch2/osc.py
@@ -7,8 +7,6 @@ Based on the svn "Fetch" implementation.
7 7
8""" 8"""
9 9
10import os
11import sys
12import logging 10import logging
13import bb 11import bb
14from bb.fetch2 import FetchMethod 12from bb.fetch2 import FetchMethod
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index 54d001ec81..b2ac11ecab 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -11,7 +11,6 @@ BitBake 'Fetch' implementation for perforce
11# Based on functions from the base bb module, Copyright 2003 Holger Schurig 11# Based on functions from the base bb module, Copyright 2003 Holger Schurig
12 12
13import os 13import os
14import logging
15import bb 14import bb
16from bb.fetch2 import FetchMethod 15from bb.fetch2 import FetchMethod
17from bb.fetch2 import FetchError 16from bb.fetch2 import FetchError
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py
index f5be060c43..34debe399b 100644
--- a/bitbake/lib/bb/fetch2/ssh.py
+++ b/bitbake/lib/bb/fetch2/ssh.py
@@ -32,8 +32,6 @@ IETF secsh internet draft:
32 32
33import re, os 33import re, os
34from bb.fetch2 import FetchMethod 34from bb.fetch2 import FetchMethod
35from bb.fetch2 import FetchError
36from bb.fetch2 import logger
37from bb.fetch2 import runfetchcmd 35from bb.fetch2 import runfetchcmd
38 36
39 37
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index 96d666ba33..6c8caf5fb9 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -11,8 +11,6 @@ BitBake 'Fetch' implementation for svn.
11# Based on functions from the base bb module, Copyright 2003 Holger Schurig 11# Based on functions from the base bb module, Copyright 2003 Holger Schurig
12 12
13import os 13import os
14import sys
15import logging
16import bb 14import bb
17import re 15import re
18from bb.fetch2 import FetchMethod 16from bb.fetch2 import FetchMethod
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 725586d2b5..72bc6c8f4d 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -14,9 +14,7 @@ BitBake build tools.
14 14
15import re 15import re
16import tempfile 16import tempfile
17import subprocess
18import os 17import os
19import logging
20import errno 18import errno
21import bb 19import bb
22import bb.progress 20import bb.progress
@@ -27,7 +25,6 @@ from bb.fetch2 import FetchMethod
27from bb.fetch2 import FetchError 25from bb.fetch2 import FetchError
28from bb.fetch2 import logger 26from bb.fetch2 import logger
29from bb.fetch2 import runfetchcmd 27from bb.fetch2 import runfetchcmd
30from bb.fetch2 import FetchConnectionCache
31from bb.utils import export_proxies 28from bb.utils import export_proxies
32from bs4 import BeautifulSoup 29from bs4 import BeautifulSoup
33from bs4 import SoupStrainer 30from bs4 import SoupStrainer
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 1a25b0041f..e7c07264a8 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -4,7 +4,7 @@
4# SPDX-License-Identifier: GPL-2.0-only 4# SPDX-License-Identifier: GPL-2.0-only
5# 5#
6 6
7import os, logging, re, sys 7import os, logging, re
8import bb 8import bb
9logger = logging.getLogger("BitBake.Monitor") 9logger = logging.getLogger("BitBake.Monitor")
10 10
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 6216eb3bc4..33c0e2fa19 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -13,9 +13,7 @@ Message handling infrastructure for bitbake
13import sys 13import sys
14import copy 14import copy
15import logging 15import logging
16import collections
17from itertools import groupby 16from itertools import groupby
18import warnings
19import bb 17import bb
20import bb.event 18import bb.event
21 19
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index f0911e6fb7..362c1a39ce 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -9,11 +9,7 @@
9# SPDX-License-Identifier: GPL-2.0-only 9# SPDX-License-Identifier: GPL-2.0-only
10# 10#
11 11
12import re
13import string
14import logging
15import bb 12import bb
16import itertools
17from bb import methodpool 13from bb import methodpool
18from bb.parse import logger 14from bb.parse import logger
19 15
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 6f7cf82b25..6e216effb8 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -13,9 +13,7 @@
13# 13#
14 14
15import re, bb, os 15import re, bb, os
16import logging
17import bb.build, bb.utils 16import bb.build, bb.utils
18from bb import data
19 17
20from . import ConfHandler 18from . import ConfHandler
21from .. import resolve_file, ast, logger, ParseError 19from .. import resolve_file, ast, logger, ParseError
diff --git a/bitbake/lib/bb/progress.py b/bitbake/lib/bb/progress.py
index 4022caa717..9c755b7f73 100644
--- a/bitbake/lib/bb/progress.py
+++ b/bitbake/lib/bb/progress.py
@@ -7,7 +7,6 @@ BitBake progress handling code
7# SPDX-License-Identifier: GPL-2.0-only 7# SPDX-License-Identifier: GPL-2.0-only
8# 8#
9 9
10import sys
11import re 10import re
12import time 11import time
13import inspect 12import inspect
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index d7186e8516..71108eeed7 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -12,14 +12,12 @@ Handles preparation and execution of a queue of tasks
12import copy 12import copy
13import os 13import os
14import sys 14import sys
15import signal
16import stat 15import stat
17import fcntl
18import errno 16import errno
19import logging 17import logging
20import re 18import re
21import bb 19import bb
22from bb import msg, data, event 20from bb import msg, event
23from bb import monitordisk 21from bb import monitordisk
24import subprocess 22import subprocess
25import pickle 23import pickle
diff --git a/bitbake/lib/bb/server/xmlrpcclient.py b/bitbake/lib/bb/server/xmlrpcclient.py
index c054c3c89d..442ea7b264 100644
--- a/bitbake/lib/bb/server/xmlrpcclient.py
+++ b/bitbake/lib/bb/server/xmlrpcclient.py
@@ -7,9 +7,6 @@
7# SPDX-License-Identifier: GPL-2.0-only 7# SPDX-License-Identifier: GPL-2.0-only
8# 8#
9 9
10import os
11import sys
12
13import socket 10import socket
14import http.client 11import http.client
15import xmlrpc.client 12import xmlrpc.client
diff --git a/bitbake/lib/bb/server/xmlrpcserver.py b/bitbake/lib/bb/server/xmlrpcserver.py
index 54fa32f573..2fa71be667 100644
--- a/bitbake/lib/bb/server/xmlrpcserver.py
+++ b/bitbake/lib/bb/server/xmlrpcserver.py
@@ -7,9 +7,6 @@
7# SPDX-License-Identifier: GPL-2.0-only 7# SPDX-License-Identifier: GPL-2.0-only
8# 8#
9 9
10import os
11import sys
12
13import hashlib 10import hashlib
14import time 11import time
15import inspect 12import inspect
diff --git a/bitbake/lib/bb/tests/cooker.py b/bitbake/lib/bb/tests/cooker.py
index 090916e949..74c903f010 100644
--- a/bitbake/lib/bb/tests/cooker.py
+++ b/bitbake/lib/bb/tests/cooker.py
@@ -5,7 +5,6 @@
5# 5#
6 6
7import unittest 7import unittest
8import tempfile
9import os 8import os
10import bb, bb.cooker 9import bb, bb.cooker
11import re 10import re
diff --git a/bitbake/lib/bb/tests/cow.py b/bitbake/lib/bb/tests/cow.py
index b4af4bbcbf..bf6e79fcee 100644
--- a/bitbake/lib/bb/tests/cow.py
+++ b/bitbake/lib/bb/tests/cow.py
@@ -7,7 +7,7 @@
7# 7#
8 8
9import unittest 9import unittest
10import os 10
11 11
12class COWTestCase(unittest.TestCase): 12class COWTestCase(unittest.TestCase):
13 """ 13 """
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 83fad3ff0d..4d347dead7 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -9,7 +9,6 @@
9import unittest 9import unittest
10import hashlib 10import hashlib
11import tempfile 11import tempfile
12import subprocess
13import collections 12import collections
14import os 13import os
15from bb.fetch2 import URI 14from bb.fetch2 import URI
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py
index 20c88ac3d5..4ba12a0772 100644
--- a/bitbake/lib/bb/tests/runqueue.py
+++ b/bitbake/lib/bb/tests/runqueue.py
@@ -7,7 +7,6 @@
7# 7#
8 8
9import unittest 9import unittest
10import bb
11import os 10import os
12import tempfile 11import tempfile
13import subprocess 12import subprocess
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 0a1b913055..0bd7836323 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -21,8 +21,8 @@ import bb.taskdata
21import bb.utils 21import bb.utils
22import bb.command 22import bb.command
23import bb.remotedata 23import bb.remotedata
24from bb.cookerdata import CookerConfiguration, ConfigParameters 24from bb.cookerdata import CookerConfiguration
25from bb.main import setup_bitbake, BitBakeConfigParameters, BBMainException 25from bb.main import setup_bitbake, BitBakeConfigParameters
26import bb.fetch2 26import bb.fetch2
27 27
28 28
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index c6abb2a114..19008a4ead 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -12,7 +12,6 @@ from __future__ import division
12 12
13import os 13import os
14import sys 14import sys
15import xmlrpc.client as xmlrpclib
16import logging 15import logging
17import progressbar 16import progressbar
18import signal 17import signal
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py
index c422732b26..49569e375b 100644
--- a/bitbake/lib/bb/ui/ncurses.py
+++ b/bitbake/lib/bb/ui/ncurses.py
@@ -37,7 +37,7 @@
37 37
38 38
39import logging 39import logging
40import os, sys, itertools, time, subprocess 40import os, sys, itertools, time
41 41
42try: 42try:
43 import curses 43 import curses
@@ -46,7 +46,6 @@ except ImportError:
46 46
47import bb 47import bb
48import xmlrpc.client 48import xmlrpc.client
49from bb import ui
50from bb.ui import uihelper 49from bb.ui import uihelper
51 50
52parsespin = itertools.cycle( r'|/-\\' ) 51parsespin = itertools.cycle( r'|/-\\' )
diff --git a/bitbake/lib/bb/ui/taskexp.py b/bitbake/lib/bb/ui/taskexp.py
index 50a943cd05..7895102b95 100644
--- a/bitbake/lib/bb/ui/taskexp.py
+++ b/bitbake/lib/bb/ui/taskexp.py
@@ -11,10 +11,8 @@ import sys
11import gi 11import gi
12gi.require_version('Gtk', '3.0') 12gi.require_version('Gtk', '3.0')
13from gi.repository import Gtk, Gdk, GObject 13from gi.repository import Gtk, Gdk, GObject
14from multiprocessing import Queue
15import threading 14import threading
16from xmlrpc import client 15from xmlrpc import client
17import time
18import bb 16import bb
19import bb.event 17import bb.event
20 18
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index d65265c461..06c8819d26 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -24,7 +24,6 @@ import fnmatch
24import traceback 24import traceback
25import errno 25import errno
26import signal 26import signal
27import ast
28import collections 27import collections
29import copy 28import copy
30from subprocess import getstatusoutput 29from subprocess import getstatusoutput
diff --git a/bitbake/lib/bs4/builder/_html5lib.py b/bitbake/lib/bs4/builder/_html5lib.py
index 2b7a70aa11..4091ce88b9 100644
--- a/bitbake/lib/bs4/builder/_html5lib.py
+++ b/bitbake/lib/bs4/builder/_html5lib.py
@@ -2,7 +2,6 @@ __all__ = [
2 'HTML5TreeBuilder', 2 'HTML5TreeBuilder',
3 ] 3 ]
4 4
5from pdb import set_trace
6import warnings 5import warnings
7from bs4.builder import ( 6from bs4.builder import (
8 PERMISSIVE, 7 PERMISSIVE,
diff --git a/bitbake/lib/bs4/dammit.py b/bitbake/lib/bs4/dammit.py
index 805aa908a5..7ad9e0dd1e 100644
--- a/bitbake/lib/bs4/dammit.py
+++ b/bitbake/lib/bs4/dammit.py
@@ -8,12 +8,10 @@ XML or HTML to reflect a new encoding; that's the tree builder's job.
8""" 8"""
9__license__ = "MIT" 9__license__ = "MIT"
10 10
11from pdb import set_trace
12import codecs 11import codecs
13from html.entities import codepoint2name 12from html.entities import codepoint2name
14import re 13import re
15import logging 14import logging
16import string
17 15
18# Import a library to autodetect character encodings. 16# Import a library to autodetect character encodings.
19chardet_type = None 17chardet_type = None
@@ -38,12 +36,6 @@ except ImportError:
38 def chardet_dammit(s): 36 def chardet_dammit(s):
39 return None 37 return None
40 38
41# Available from http://cjkpython.i18n.org/.
42try:
43 import iconv_codec
44except ImportError:
45 pass
46
47xml_encoding_re = re.compile( 39xml_encoding_re = re.compile(
48 r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I) 40 r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I)
49html_meta_re = re.compile( 41html_meta_re = re.compile(
diff --git a/bitbake/lib/bs4/element.py b/bitbake/lib/bs4/element.py
index 3775a60458..68be42d138 100644
--- a/bitbake/lib/bs4/element.py
+++ b/bitbake/lib/bs4/element.py
@@ -1,6 +1,5 @@
1__license__ = "MIT" 1__license__ = "MIT"
2 2
3from pdb import set_trace
4import collections.abc 3import collections.abc
5import re 4import re
6import sys 5import sys
diff --git a/bitbake/lib/bs4/testing.py b/bitbake/lib/bs4/testing.py
index 3a2f260e24..953bca8e91 100644
--- a/bitbake/lib/bs4/testing.py
+++ b/bitbake/lib/bs4/testing.py
@@ -4,7 +4,6 @@ __license__ = "MIT"
4 4
5import pickle 5import pickle
6import copy 6import copy
7import functools
8import unittest 7import unittest
9from unittest import TestCase 8from unittest import TestCase
10from bs4 import BeautifulSoup 9from bs4 import BeautifulSoup
diff --git a/bitbake/lib/bs4/tests/test_docs.py b/bitbake/lib/bs4/tests/test_docs.py
index 5b9f677093..d1d76a33bf 100644
--- a/bitbake/lib/bs4/tests/test_docs.py
+++ b/bitbake/lib/bs4/tests/test_docs.py
@@ -7,19 +7,15 @@ __all__ = [
7 'additional_tests', 7 'additional_tests',
8 ] 8 ]
9 9
10import atexit
11import doctest 10import doctest
12import os
13#from pkg_resources import ( 11#from pkg_resources import (
14# resource_filename, resource_exists, resource_listdir, cleanup_resources) 12# resource_filename, resource_exists, resource_listdir, cleanup_resources)
15import unittest
16 13
17DOCTEST_FLAGS = ( 14DOCTEST_FLAGS = (
18 doctest.ELLIPSIS | 15 doctest.ELLIPSIS |
19 doctest.NORMALIZE_WHITESPACE | 16 doctest.NORMALIZE_WHITESPACE |
20 doctest.REPORT_NDIFF) 17 doctest.REPORT_NDIFF)
21 18
22
23# def additional_tests(): 19# def additional_tests():
24# "Run the doc tests (README.txt and docs/*, if any exist)" 20# "Run the doc tests (README.txt and docs/*, if any exist)"
25# doctest_files = [ 21# doctest_files = [
diff --git a/bitbake/lib/bs4/tests/test_htmlparser.py b/bitbake/lib/bs4/tests/test_htmlparser.py
index b45e35f999..30a25e6709 100644
--- a/bitbake/lib/bs4/tests/test_htmlparser.py
+++ b/bitbake/lib/bs4/tests/test_htmlparser.py
@@ -1,7 +1,6 @@
1"""Tests to ensure that the html.parser tree builder generates good 1"""Tests to ensure that the html.parser tree builder generates good
2trees.""" 2trees."""
3 3
4from pdb import set_trace
5import pickle 4import pickle
6from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest 5from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
7from bs4.builder import HTMLParserTreeBuilder 6from bs4.builder import HTMLParserTreeBuilder
diff --git a/bitbake/lib/bs4/tests/test_lxml.py b/bitbake/lib/bs4/tests/test_lxml.py
index 6c2a1d73eb..6b6cdd07cb 100644
--- a/bitbake/lib/bs4/tests/test_lxml.py
+++ b/bitbake/lib/bs4/tests/test_lxml.py
@@ -1,6 +1,5 @@
1"""Tests to ensure that the lxml tree builder generates good trees.""" 1"""Tests to ensure that the lxml tree builder generates good trees."""
2 2
3import re
4import warnings 3import warnings
5 4
6try: 5try:
@@ -14,13 +13,8 @@ except ImportError as e:
14if LXML_PRESENT: 13if LXML_PRESENT:
15 from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML 14 from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
16 15
17from bs4 import ( 16from bs4 import BeautifulStoneSoup
18 BeautifulSoup,
19 BeautifulStoneSoup,
20 )
21from bs4.element import Comment, Doctype, SoupStrainer
22from bs4.testing import skipIf 17from bs4.testing import skipIf
23from bs4.tests import test_htmlparser
24from bs4.testing import ( 18from bs4.testing import (
25 HTMLTreeBuilderSmokeTest, 19 HTMLTreeBuilderSmokeTest,
26 XMLTreeBuilderSmokeTest, 20 XMLTreeBuilderSmokeTest,
diff --git a/bitbake/lib/bs4/tests/test_soup.py b/bitbake/lib/bs4/tests/test_soup.py
index f87949e3d3..6ad3cb3765 100644
--- a/bitbake/lib/bs4/tests/test_soup.py
+++ b/bitbake/lib/bs4/tests/test_soup.py
@@ -1,16 +1,12 @@
1# -*- coding: utf-8 -*- 1# -*- coding: utf-8 -*-
2"""Tests of Beautiful Soup as a whole.""" 2"""Tests of Beautiful Soup as a whole."""
3 3
4from pdb import set_trace
5import logging 4import logging
6import unittest 5import unittest
7import sys 6import sys
8import tempfile 7import tempfile
9 8
10from bs4 import ( 9from bs4 import BeautifulSoup
11 BeautifulSoup,
12 BeautifulStoneSoup,
13)
14from bs4.element import ( 10from bs4.element import (
15 CharsetMetaAttributeValue, 11 CharsetMetaAttributeValue,
16 ContentMetaAttributeValue, 12 ContentMetaAttributeValue,
diff --git a/bitbake/lib/bs4/tests/test_tree.py b/bitbake/lib/bs4/tests/test_tree.py
index 6d3e67f311..8e5c66426e 100644
--- a/bitbake/lib/bs4/tests/test_tree.py
+++ b/bitbake/lib/bs4/tests/test_tree.py
@@ -9,16 +9,12 @@ same markup, but all Beautiful Soup trees can be traversed with the
9methods tested here. 9methods tested here.
10""" 10"""
11 11
12from pdb import set_trace
13import copy 12import copy
14import pickle 13import pickle
15import re 14import re
16import warnings 15import warnings
17from bs4 import BeautifulSoup 16from bs4 import BeautifulSoup
18from bs4.builder import ( 17from bs4.builder import builder_registry
19 builder_registry,
20 HTMLParserTreeBuilder,
21)
22from bs4.element import ( 18from bs4.element import (
23 PY3K, 19 PY3K,
24 CData, 20 CData,
@@ -29,10 +25,7 @@ from bs4.element import (
29 SoupStrainer, 25 SoupStrainer,
30 Tag, 26 Tag,
31) 27)
32from bs4.testing import ( 28from bs4.testing import SoupTest
33 SoupTest,
34 skipIf,
35)
36 29
37XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None) 30XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None)
38LXML_PRESENT = (builder_registry.lookup("lxml") is not None) 31LXML_PRESENT = (builder_registry.lookup("lxml") is not None)
diff --git a/bitbake/lib/hashserv/client.py b/bitbake/lib/hashserv/client.py
index ae0cce9df4..46085d6418 100644
--- a/bitbake/lib/hashserv/client.py
+++ b/bitbake/lib/hashserv/client.py
@@ -3,7 +3,6 @@
3# SPDX-License-Identifier: GPL-2.0-only 3# SPDX-License-Identifier: GPL-2.0-only
4# 4#
5 5
6from contextlib import closing
7import json 6import json
8import logging 7import logging
9import socket 8import socket
diff --git a/bitbake/lib/layerindexlib/cooker.py b/bitbake/lib/layerindexlib/cooker.py
index 604a9611dd..4ce397d884 100644
--- a/bitbake/lib/layerindexlib/cooker.py
+++ b/bitbake/lib/layerindexlib/cooker.py
@@ -4,9 +4,8 @@
4# 4#
5 5
6import logging 6import logging
7import json
8 7
9from collections import OrderedDict, defaultdict 8from collections import defaultdict
10 9
11from urllib.parse import unquote, urlparse 10from urllib.parse import unquote, urlparse
12 11
diff --git a/bitbake/lib/layerindexlib/plugin.py b/bitbake/lib/layerindexlib/plugin.py
index 7015a1af26..cadda36c74 100644
--- a/bitbake/lib/layerindexlib/plugin.py
+++ b/bitbake/lib/layerindexlib/plugin.py
@@ -7,10 +7,7 @@
7# Plugin base class 7# Plugin base class
8# Utility Functions for working on layerindex data 8# Utility Functions for working on layerindex data
9 9
10import argparse
11import logging 10import logging
12import os
13import bb.msg
14 11
15logger = logging.getLogger('BitBake.layerindexlib.plugin') 12logger = logging.getLogger('BitBake.layerindexlib.plugin')
16 13
diff --git a/bitbake/lib/layerindexlib/tests/cooker.py b/bitbake/lib/layerindexlib/tests/cooker.py
index 1fa102e602..1d0685e099 100644
--- a/bitbake/lib/layerindexlib/tests/cooker.py
+++ b/bitbake/lib/layerindexlib/tests/cooker.py
@@ -3,15 +3,12 @@
3# SPDX-License-Identifier: GPL-2.0-only 3# SPDX-License-Identifier: GPL-2.0-only
4# 4#
5 5
6import unittest
7import tempfile
8import os 6import os
9import bb 7import bb
10 8
11import layerindexlib 9import layerindexlib
12from layerindexlib.tests.common import LayersTest 10from layerindexlib.tests.common import LayersTest
13 11
14import logging
15 12
16class LayerIndexCookerTest(LayersTest): 13class LayerIndexCookerTest(LayersTest):
17 14
diff --git a/bitbake/lib/layerindexlib/tests/layerindexobj.py b/bitbake/lib/layerindexlib/tests/layerindexobj.py
index 0c5ec8881b..de1e474687 100644
--- a/bitbake/lib/layerindexlib/tests/layerindexobj.py
+++ b/bitbake/lib/layerindexlib/tests/layerindexobj.py
@@ -3,14 +3,8 @@
3# SPDX-License-Identifier: GPL-2.0-only 3# SPDX-License-Identifier: GPL-2.0-only
4# 4#
5 5
6import unittest
7import tempfile
8import os
9import bb
10
11from layerindexlib.tests.common import LayersTest 6from layerindexlib.tests.common import LayersTest
12 7
13import logging
14 8
15class LayerIndexObjectsTest(LayersTest): 9class LayerIndexObjectsTest(LayersTest):
16 def setUp(self): 10 def setUp(self):
diff --git a/bitbake/lib/layerindexlib/tests/restapi.py b/bitbake/lib/layerindexlib/tests/restapi.py
index 6d8dc0058e..e5ccafe5c9 100644
--- a/bitbake/lib/layerindexlib/tests/restapi.py
+++ b/bitbake/lib/layerindexlib/tests/restapi.py
@@ -4,14 +4,11 @@
4# 4#
5 5
6import unittest 6import unittest
7import tempfile
8import os 7import os
9import bb
10 8
11import layerindexlib 9import layerindexlib
12from layerindexlib.tests.common import LayersTest 10from layerindexlib.tests.common import LayersTest
13 11
14import logging
15 12
16def skipIfNoNetwork(): 13def skipIfNoNetwork():
17 if os.environ.get("BB_SKIP_NETTESTS") == "yes": 14 if os.environ.get("BB_SKIP_NETTESTS") == "yes":
diff --git a/bitbake/lib/toaster/bldcollector/urls.py b/bitbake/lib/toaster/bldcollector/urls.py
index 8eb1e34a53..efd67a81a5 100644
--- a/bitbake/lib/toaster/bldcollector/urls.py
+++ b/bitbake/lib/toaster/bldcollector/urls.py
@@ -6,7 +6,7 @@
6# SPDX-License-Identifier: GPL-2.0-only 6# SPDX-License-Identifier: GPL-2.0-only
7# 7#
8 8
9from django.conf.urls import include, url 9from django.conf.urls import url
10 10
11import bldcollector.views 11import bldcollector.views
12 12
diff --git a/bitbake/lib/toaster/bldcollector/views.py b/bitbake/lib/toaster/bldcollector/views.py
index c708b415e1..6d9227cd7f 100644
--- a/bitbake/lib/toaster/bldcollector/views.py
+++ b/bitbake/lib/toaster/bldcollector/views.py
@@ -6,16 +6,8 @@
6# SPDX-License-Identifier: GPL-2.0-only 6# SPDX-License-Identifier: GPL-2.0-only
7# 7#
8 8
9from django.views.decorators.cache import cache_control
10from django.core.urlresolvers import reverse 9from django.core.urlresolvers import reverse
11from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
12from django.http import HttpResponseBadRequest, HttpResponse 10from django.http import HttpResponseBadRequest, HttpResponse
13from django.utils import timezone
14from django.utils.html import escape
15from datetime import timedelta
16from django.utils import formats
17from toastergui.templatetags.projecttags import json as jsonfilter
18import json
19import os 11import os
20import tempfile 12import tempfile
21import subprocess 13import subprocess
diff --git a/bitbake/lib/toaster/bldcontrol/admin.py b/bitbake/lib/toaster/bldcontrol/admin.py
index e85c30ed11..1754bc11cc 100644
--- a/bitbake/lib/toaster/bldcontrol/admin.py
+++ b/bitbake/lib/toaster/bldcontrol/admin.py
@@ -3,7 +3,6 @@
3# 3#
4 4
5from django.contrib import admin 5from django.contrib import admin
6from django.contrib.admin.filters import RelatedFieldListFilter
7from .models import BuildEnvironment 6from .models import BuildEnvironment
8 7
9class BuildEnvironmentAdmin(admin.ModelAdmin): 8class BuildEnvironmentAdmin(admin.ModelAdmin):
diff --git a/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
index 301df1880a..71c288df34 100644
--- a/bitbake/lib/toaster/bldcontrol/bbcontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -8,10 +8,8 @@
8 8
9import os 9import os
10import sys 10import sys
11import re
12from django.db import transaction
13from django.db.models import Q 11from django.db.models import Q
14from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake 12from bldcontrol.models import BuildEnvironment, BRLayer, BRBitbake
15 13
16# load Bitbake components 14# load Bitbake components
17path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) 15path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 39ea736b58..75674ccbf1 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -7,27 +7,24 @@
7# 7#
8 8
9import os 9import os
10import sys
11import re 10import re
12import shutil 11import shutil
13import time 12import time
14from django.db import transaction 13from bldcontrol.models import BuildEnvironment, BuildRequest, Build
15from django.db.models import Q 14from orm.models import CustomImageRecipe, Layer, Layer_Version, Project, ToasterSetting
16from bldcontrol.models import BuildEnvironment, BuildRequest, BRLayer, BRVariable, BRTarget, BRBitbake, Build
17from orm.models import CustomImageRecipe, Layer, Layer_Version, Project, ProjectLayer, ToasterSetting
18from orm.models import signal_runbuilds 15from orm.models import signal_runbuilds
19import subprocess 16import subprocess
20 17
21from toastermain import settings 18from toastermain import settings
22 19
23from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController 20from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException
24 21
25import logging 22import logging
26logger = logging.getLogger("toaster") 23logger = logging.getLogger("toaster")
27 24
28install_dir = os.environ.get('TOASTER_DIR') 25install_dir = os.environ.get('TOASTER_DIR')
29 26
30from pprint import pprint, pformat 27from pprint import pformat
31 28
32class LocalhostBEController(BuildEnvironmentController): 29class LocalhostBEController(BuildEnvironmentController):
33 """ Implementation of the BuildEnvironmentController for the localhost; 30 """ Implementation of the BuildEnvironmentController for the localhost;
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
index fe2c4dc2bb..cfcd4a00e5 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -2,11 +2,9 @@
2# SPDX-License-Identifier: GPL-2.0-only 2# SPDX-License-Identifier: GPL-2.0-only
3# 3#
4 4
5from django.core.management.base import BaseCommand, CommandError 5from django.core.management.base import BaseCommand
6from django.db import transaction
7 6
8from django.core.management import call_command 7from django.core.management import call_command
9from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException
10from bldcontrol.models import BuildRequest, BuildEnvironment, BRError 8from bldcontrol.models import BuildRequest, BuildEnvironment, BRError
11from orm.models import ToasterSetting, Build, Layer 9from orm.models import ToasterSetting, Build, Layer
12 10
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index bcffcf5e20..0d30fd9be0 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -4,9 +4,8 @@
4 4
5from __future__ import unicode_literals 5from __future__ import unicode_literals
6from django.db import models 6from django.db import models
7from django.core.validators import MaxValueValidator, MinValueValidator
8from django.utils.encoding import force_text 7from django.utils.encoding import force_text
9from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version 8from orm.models import Project, Build, Layer_Version
10 9
11import logging 10import logging
12logger = logging.getLogger("toaster") 11logger = logging.getLogger("toaster")
diff --git a/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/bitbake/lib/toaster/orm/management/commands/lsupdates.py
index 5b5abbb295..a4dbcaa76e 100644
--- a/bitbake/lib/toaster/orm/management/commands/lsupdates.py
+++ b/bitbake/lib/toaster/orm/management/commands/lsupdates.py
@@ -8,7 +8,7 @@
8 8
9from django.core.management.base import BaseCommand 9from django.core.management.base import BaseCommand
10 10
11from orm.models import LayerSource, Layer, Release, Layer_Version 11from orm.models import Layer, Release, Layer_Version
12from orm.models import LayerVersionDependency, Machine, Recipe 12from orm.models import LayerVersionDependency, Machine, Recipe
13from orm.models import Distro 13from orm.models import Distro
14from orm.models import ToasterSetting 14from orm.models import ToasterSetting
diff --git a/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py b/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py
index 75506961a9..3f3a2e1612 100644
--- a/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py
+++ b/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py
@@ -1,7 +1,7 @@
1# -*- coding: utf-8 -*- 1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals 2from __future__ import unicode_literals
3 3
4from django.db import migrations, models 4from django.db import migrations
5 5
6 6
7class Migration(migrations.Migration): 7class Migration(migrations.Migration):
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
index 6c94684e86..644d45fe58 100644
--- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
+++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
@@ -19,7 +19,6 @@ import os
19import time 19import time
20import unittest 20import unittest
21 21
22from django.contrib.staticfiles.testing import StaticLiveServerTestCase
23from selenium import webdriver 22from selenium import webdriver
24from selenium.webdriver.support.ui import WebDriverWait 23from selenium.webdriver.support.ui import WebDriverWait
25from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 24from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
diff --git a/bitbake/lib/toaster/tests/browser/test_project_config_page.py b/bitbake/lib/toaster/tests/browser/test_project_config_page.py
index 2816eb9072..eaf27a1e78 100644
--- a/bitbake/lib/toaster/tests/browser/test_project_config_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_project_config_page.py
@@ -7,10 +7,7 @@
7# SPDX-License-Identifier: GPL-2.0-only 7# SPDX-License-Identifier: GPL-2.0-only
8# 8#
9 9
10import re
11
12from django.core.urlresolvers import reverse 10from django.core.urlresolvers import reverse
13from django.utils import timezone
14from tests.browser.selenium_helpers import SeleniumTestCase 11from tests.browser.selenium_helpers import SeleniumTestCase
15 12
16from orm.models import BitbakeVersion, Release, Project, ProjectVariable 13from orm.models import BitbakeVersion, Release, Project, ProjectVariable
diff --git a/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/bitbake/lib/toaster/tests/functional/test_functional_basic.py
index 56c84fba8f..5683e3873e 100644
--- a/bitbake/lib/toaster/tests/functional/test_functional_basic.py
+++ b/bitbake/lib/toaster/tests/functional/test_functional_basic.py
@@ -7,7 +7,6 @@
7# SPDX-License-Identifier: GPL-2.0-only 7# SPDX-License-Identifier: GPL-2.0-only
8# 8#
9 9
10import time
11import re 10import re
12from tests.functional.functional_helpers import SeleniumFunctionalTestCase 11from tests.functional.functional_helpers import SeleniumFunctionalTestCase
13from orm.models import Project 12from orm.models import Project
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py
index 8b49b3ee3f..a4afc9e704 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -13,7 +13,6 @@ import logging
13import json 13import json
14import subprocess 14import subprocess
15from collections import Counter 15from collections import Counter
16from shutil import copyfile
17 16
18from orm.models import Project, ProjectTarget, Build, Layer_Version 17from orm.models import Project, ProjectTarget, Build, Layer_Version
19from orm.models import LayerVersionDependency, LayerSource, ProjectLayer 18from orm.models import LayerVersionDependency, LayerSource, ProjectLayer
@@ -29,8 +28,6 @@ from django.core.urlresolvers import reverse
29from django.db.models import Q, F 28from django.db.models import Q, F
30from django.db import Error 29from django.db import Error
31from toastergui.templatetags.projecttags import filtered_filesizeformat 30from toastergui.templatetags.projecttags import filtered_filesizeformat
32from django.utils import timezone
33import pytz
34 31
35# development/debugging support 32# development/debugging support
36verbose = 2 33verbose = 2
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index b3ea2227e0..528dd32b0c 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -7,15 +7,10 @@
7# 7#
8 8
9from toastergui.widgets import ToasterTable 9from toastergui.widgets import ToasterTable
10from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project 10from orm.models import Recipe, ProjectLayer, Layer_Version, Project
11from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task 11from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task
12from orm.models import CustomImagePackage, Package_DependencyManager 12from orm.models import CustomImagePackage, Package_DependencyManager
13from orm.models import Distro 13from django.db.models import Q, Sum, Count, When, Case, Value, IntegerField
14from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField
15from django.conf.urls import url
16from django.core.urlresolvers import reverse, resolve
17from django.http import HttpResponse
18from django.views.generic import TemplateView
19 14
20from toastergui.tablefilter import TableFilter 15from toastergui.tablefilter import TableFilter
21from toastergui.tablefilter import TableFilterActionToggle 16from toastergui.tablefilter import TableFilterActionToggle
diff --git a/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py b/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
index 048d533871..e242234bfd 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
@@ -3,7 +3,6 @@
3# 3#
4 4
5from django import template 5from django import template
6import json
7 6
8register = template.Library() 7register = template.Library()
9 8
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 1dbab3bdb9..354b61f081 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -6,7 +6,7 @@
6# SPDX-License-Identifier: GPL-2.0-only 6# SPDX-License-Identifier: GPL-2.0-only
7# 7#
8 8
9from datetime import datetime, timedelta 9from datetime import timedelta
10from os.path import relpath 10from os.path import relpath
11import re 11import re
12from django import template 12from django import template
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py
index 673d9ae967..d2df4e6048 100644
--- a/bitbake/lib/toaster/toastergui/urls.py
+++ b/bitbake/lib/toaster/toastergui/urls.py
@@ -6,10 +6,9 @@
6# SPDX-License-Identifier: GPL-2.0-only 6# SPDX-License-Identifier: GPL-2.0-only
7# 7#
8 8
9from django.conf.urls import include, url 9from django.conf.urls import url
10from django.views.generic import RedirectView, TemplateView 10from django.views.generic import RedirectView
11 11
12from django.http import HttpResponseBadRequest
13from toastergui import tables 12from toastergui import tables
14from toastergui import buildtables 13from toastergui import buildtables
15from toastergui import typeaheads 14from toastergui import typeaheads
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index d7acaff892..7fecdaa973 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -20,7 +20,7 @@ from orm.models import TargetKernelFile, TargetSDKFile, Target_Image_File
20from orm.models import BitbakeVersion, CustomImageRecipe 20from orm.models import BitbakeVersion, CustomImageRecipe
21 21
22from django.core.urlresolvers import reverse, resolve 22from django.core.urlresolvers import reverse, resolve
23from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist 23from django.core.exceptions import ObjectDoesNotExist
24from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger 24from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
25from django.http import HttpResponseNotFound, JsonResponse 25from django.http import HttpResponseNotFound, JsonResponse
26from django.utils import timezone 26from django.utils import timezone
@@ -664,7 +664,6 @@ def recipe_packages(request, build_id, recipe_id):
664 _set_parameters_values(pagesize, orderby, request) 664 _set_parameters_values(pagesize, orderby, request)
665 return response 665 return response
666 666
667from django.core.serializers.json import DjangoJSONEncoder
668from django.http import HttpResponse 667from django.http import HttpResponse
669def xhr_dirinfo(request, build_id, target_id): 668def xhr_dirinfo(request, build_id, target_id):
670 top = request.GET.get('start', '/') 669 top = request.GET.get('start', '/')
@@ -1340,7 +1339,7 @@ def json_build(request,build_id):
1340 1339
1341import toastermain.settings 1340import toastermain.settings
1342 1341
1343from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable 1342from orm.models import Project, ProjectLayer, ProjectVariable
1344from bldcontrol.models import BuildEnvironment 1343from bldcontrol.models import BuildEnvironment
1345 1344
1346# we have a set of functions if we're in managed mode, or 1345# we have a set of functions if we're in managed mode, or
@@ -1349,10 +1348,8 @@ from bldcontrol.models import BuildEnvironment
1349if True: 1348if True:
1350 from django.contrib.auth.models import User 1349 from django.contrib.auth.models import User
1351 from django.contrib.auth import authenticate, login 1350 from django.contrib.auth import authenticate, login
1352 from django.contrib.auth.decorators import login_required
1353 1351
1354 from orm.models import LayerSource, ToasterSetting, Release, Machine, LayerVersionDependency 1352 from orm.models import LayerSource, ToasterSetting, Release
1355 from bldcontrol.models import BuildRequest
1356 1353
1357 import traceback 1354 import traceback
1358 1355
diff --git a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
index c2d773a577..93919dec2d 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
@@ -2,12 +2,10 @@
2# SPDX-License-Identifier: GPL-2.0-only 2# SPDX-License-Identifier: GPL-2.0-only
3# 3#
4 4
5from django.core.management.base import BaseCommand, CommandError 5from django.core.management.base import BaseCommand
6from django.core.exceptions import ObjectDoesNotExist 6from django.core.exceptions import ObjectDoesNotExist
7from orm.models import Build 7from orm.models import Build
8from django.db import OperationalError 8from django.db import OperationalError
9import os
10
11 9
12 10
13class Command(BaseCommand): 11class Command(BaseCommand):
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
index 408ad44e6e..9af54ec2f2 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
@@ -31,12 +31,10 @@
31 31
32# ../bitbake/lib/toaster/manage.py buildimport --name=test --path=`pwd` --callback="" --command=import 32# ../bitbake/lib/toaster/manage.py buildimport --name=test --path=`pwd` --callback="" --command=import
33 33
34from django.core.management.base import BaseCommand, CommandError 34from django.core.management.base import BaseCommand
35from django.core.exceptions import ObjectDoesNotExist 35from orm.models import Project, Release, ProjectVariable
36from orm.models import ProjectManager, Project, Release, ProjectVariable
37from orm.models import Layer, Layer_Version, LayerSource, ProjectLayer 36from orm.models import Layer, Layer_Version, LayerSource, ProjectLayer
38from toastergui.api import scan_layer_content 37from toastergui.api import scan_layer_content
39from django.db import OperationalError
40 38
41import os 39import os
42import re 40import re
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildslist.py b/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
index 1ed20224d3..3ad5289c5e 100644
--- a/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
+++ b/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
@@ -2,9 +2,8 @@
2# SPDX-License-Identifier: GPL-2.0-only 2# SPDX-License-Identifier: GPL-2.0-only
3# 3#
4 4
5from django.core.management.base import BaseCommand, CommandError 5from django.core.management.base import BaseCommand
6from orm.models import Build 6from orm.models import Build
7import os
8 7
9 8
10 9