diff options
author | Frazer Clews <frazer.clews@codethink.co.uk> | 2020-01-16 16:55:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:31:05 +0000 |
commit | 0ac5174c7d39a3e49893df0d517d47bec1935555 (patch) | |
tree | 479496afb1da7814071e39e888e8926cd03bec57 /bitbake/lib | |
parent | 444bcb6cb6be8d5205fc88790360d864e633a555 (diff) | |
download | poky-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')
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 | ||
12 | import copy | 12 | import copy |
13 | import types | ||
14 | ImmutableTypes = ( | 13 | ImmutableTypes = ( |
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 @@ | |||
15 | import os | 15 | import os |
16 | import sys | 16 | import sys |
17 | import logging | 17 | import logging |
18 | import shlex | ||
19 | import glob | 18 | import glob |
20 | import time | 19 | import time |
21 | import stat | 20 | import 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 | ||
19 | import os | 19 | import os |
20 | import sys | ||
21 | import logging | 20 | import logging |
22 | import pickle | 21 | import pickle |
23 | from collections import defaultdict | 22 | from 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 | |||
9 | import operator | 9 | import operator |
10 | import os | 10 | import os |
11 | import stat | 11 | import stat |
12 | import pickle | ||
13 | import bb.utils | 12 | import bb.utils |
14 | import logging | 13 | import logging |
15 | from bb.cache import MultiProcessCache | 14 | from 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 | |||
25 | import sys | 25 | import sys |
26 | import codegen | 26 | import codegen |
27 | import logging | 27 | import logging |
28 | import pickle | ||
29 | import bb.pysh as pysh | 28 | import bb.pysh as pysh |
30 | import os.path | ||
31 | import bb.utils, bb.data | 29 | import bb.utils, bb.data |
32 | import hashlib | 30 | import hashlib |
33 | from itertools import chain | 31 | from itertools import chain |
34 | from bb.pysh import pyshyacc, pyshlex, sherrors | 32 | from bb.pysh import pyshyacc, pyshlex |
35 | from bb.cache import MultiProcessCache | 33 | from bb.cache import MultiProcessCache |
36 | 34 | ||
37 | logger = logging.getLogger('BitBake.CodeParser') | 35 | logger = 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 | |||
85 | class SetCache(object): | 63 | class 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 | ||
12 | import sys, os, glob, os.path, re, time | 12 | import sys, os, glob, os.path, re, time |
13 | import atexit | ||
14 | import itertools | 13 | import itertools |
15 | import logging | 14 | import logging |
16 | import multiprocessing | 15 | import multiprocessing |
@@ -18,14 +17,11 @@ import sre_constants | |||
18 | import threading | 17 | import threading |
19 | from io import StringIO, UnsupportedOperation | 18 | from io import StringIO, UnsupportedOperation |
20 | from contextlib import closing | 19 | from contextlib import closing |
21 | from functools import wraps | ||
22 | from collections import defaultdict, namedtuple | 20 | from collections import defaultdict, namedtuple |
23 | import bb, bb.exceptions, bb.command | 21 | import bb, bb.exceptions, bb.command |
24 | from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build | 22 | from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build |
25 | import queue | 23 | import queue |
26 | import signal | 24 | import signal |
27 | import subprocess | ||
28 | import errno | ||
29 | import prserv.serv | 25 | import prserv.serv |
30 | import pyinotify | 26 | import pyinotify |
31 | import json | 27 | import 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 | ||
13 | import os, sys | 13 | import sys |
14 | import warnings | ||
15 | import pickle | 14 | import pickle |
16 | import logging | 15 | import logging |
17 | import atexit | 16 | import 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 | ||
16 | import os | 16 | import os |
17 | import sys | ||
18 | import logging | ||
19 | import bb | 17 | import bb |
20 | from bb.fetch2 import FetchMethod | 18 | from bb.fetch2 import FetchMethod |
21 | from bb.fetch2 import FetchError | 19 | from 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 | ||
51 | import os | 51 | import os |
52 | import sys | ||
53 | import shutil | 52 | import shutil |
54 | import bb | 53 | import bb |
55 | from bb.fetch2 import FetchMethod | 54 | from 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 | ||
16 | import os | 16 | import os |
17 | import logging | ||
18 | import bb | 17 | import bb |
19 | from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger | 18 | from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger |
20 | from bb.fetch2 import runfetchcmd | 19 | from 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 | ||
11 | import os | ||
12 | import bb | 11 | import bb |
13 | from bb.fetch2.git import Git | 12 | from bb.fetch2.git import Git |
14 | from bb.fetch2 import runfetchcmd | 13 | from bb.fetch2 import runfetchcmd |
15 | from bb.fetch2 import logger | ||
16 | 14 | ||
17 | class GitANNEX(Git): | 15 | class 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 | |||
24 | from bb.fetch2 import runfetchcmd | 24 | from bb.fetch2 import runfetchcmd |
25 | from bb.fetch2 import logger | 25 | from bb.fetch2 import logger |
26 | from bb.fetch2 import Fetch | 26 | from bb.fetch2 import Fetch |
27 | from bb.fetch2 import BBFetchException | ||
28 | 27 | ||
29 | class GitSM(Git): | 28 | class 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 | ||
15 | import os | 15 | import os |
16 | import sys | ||
17 | import logging | ||
18 | import bb | 16 | import bb |
19 | import errno | 17 | import errno |
20 | from bb.fetch2 import FetchMethod | 18 | from 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 | ||
22 | import os | 22 | import os |
23 | import sys | ||
24 | import urllib.request, urllib.parse, urllib.error | 23 | import urllib.request, urllib.parse, urllib.error |
25 | import json | 24 | import json |
26 | import subprocess | 25 | import 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 | ||
10 | import os | ||
11 | import sys | ||
12 | import logging | 10 | import logging |
13 | import bb | 11 | import bb |
14 | from bb.fetch2 import FetchMethod | 12 | from 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 | ||
13 | import os | 13 | import os |
14 | import logging | ||
15 | import bb | 14 | import bb |
16 | from bb.fetch2 import FetchMethod | 15 | from bb.fetch2 import FetchMethod |
17 | from bb.fetch2 import FetchError | 16 | from 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 | ||
33 | import re, os | 33 | import re, os |
34 | from bb.fetch2 import FetchMethod | 34 | from bb.fetch2 import FetchMethod |
35 | from bb.fetch2 import FetchError | ||
36 | from bb.fetch2 import logger | ||
37 | from bb.fetch2 import runfetchcmd | 35 | from 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 | ||
13 | import os | 13 | import os |
14 | import sys | ||
15 | import logging | ||
16 | import bb | 14 | import bb |
17 | import re | 15 | import re |
18 | from bb.fetch2 import FetchMethod | 16 | from 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 | ||
15 | import re | 15 | import re |
16 | import tempfile | 16 | import tempfile |
17 | import subprocess | ||
18 | import os | 17 | import os |
19 | import logging | ||
20 | import errno | 18 | import errno |
21 | import bb | 19 | import bb |
22 | import bb.progress | 20 | import bb.progress |
@@ -27,7 +25,6 @@ from bb.fetch2 import FetchMethod | |||
27 | from bb.fetch2 import FetchError | 25 | from bb.fetch2 import FetchError |
28 | from bb.fetch2 import logger | 26 | from bb.fetch2 import logger |
29 | from bb.fetch2 import runfetchcmd | 27 | from bb.fetch2 import runfetchcmd |
30 | from bb.fetch2 import FetchConnectionCache | ||
31 | from bb.utils import export_proxies | 28 | from bb.utils import export_proxies |
32 | from bs4 import BeautifulSoup | 29 | from bs4 import BeautifulSoup |
33 | from bs4 import SoupStrainer | 30 | from 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 | ||
7 | import os, logging, re, sys | 7 | import os, logging, re |
8 | import bb | 8 | import bb |
9 | logger = logging.getLogger("BitBake.Monitor") | 9 | logger = 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 | |||
13 | import sys | 13 | import sys |
14 | import copy | 14 | import copy |
15 | import logging | 15 | import logging |
16 | import collections | ||
17 | from itertools import groupby | 16 | from itertools import groupby |
18 | import warnings | ||
19 | import bb | 17 | import bb |
20 | import bb.event | 18 | import 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 | ||
12 | import re | ||
13 | import string | ||
14 | import logging | ||
15 | import bb | 12 | import bb |
16 | import itertools | ||
17 | from bb import methodpool | 13 | from bb import methodpool |
18 | from bb.parse import logger | 14 | from 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 | ||
15 | import re, bb, os | 15 | import re, bb, os |
16 | import logging | ||
17 | import bb.build, bb.utils | 16 | import bb.build, bb.utils |
18 | from bb import data | ||
19 | 17 | ||
20 | from . import ConfHandler | 18 | from . import ConfHandler |
21 | from .. import resolve_file, ast, logger, ParseError | 19 | from .. 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 | ||
10 | import sys | ||
11 | import re | 10 | import re |
12 | import time | 11 | import time |
13 | import inspect | 12 | import 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 | |||
12 | import copy | 12 | import copy |
13 | import os | 13 | import os |
14 | import sys | 14 | import sys |
15 | import signal | ||
16 | import stat | 15 | import stat |
17 | import fcntl | ||
18 | import errno | 16 | import errno |
19 | import logging | 17 | import logging |
20 | import re | 18 | import re |
21 | import bb | 19 | import bb |
22 | from bb import msg, data, event | 20 | from bb import msg, event |
23 | from bb import monitordisk | 21 | from bb import monitordisk |
24 | import subprocess | 22 | import subprocess |
25 | import pickle | 23 | import 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 | ||
10 | import os | ||
11 | import sys | ||
12 | |||
13 | import socket | 10 | import socket |
14 | import http.client | 11 | import http.client |
15 | import xmlrpc.client | 12 | import 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 | ||
10 | import os | ||
11 | import sys | ||
12 | |||
13 | import hashlib | 10 | import hashlib |
14 | import time | 11 | import time |
15 | import inspect | 12 | import 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 | ||
7 | import unittest | 7 | import unittest |
8 | import tempfile | ||
9 | import os | 8 | import os |
10 | import bb, bb.cooker | 9 | import bb, bb.cooker |
11 | import re | 10 | import 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 | ||
9 | import unittest | 9 | import unittest |
10 | import os | 10 | |
11 | 11 | ||
12 | class COWTestCase(unittest.TestCase): | 12 | class 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 @@ | |||
9 | import unittest | 9 | import unittest |
10 | import hashlib | 10 | import hashlib |
11 | import tempfile | 11 | import tempfile |
12 | import subprocess | ||
13 | import collections | 12 | import collections |
14 | import os | 13 | import os |
15 | from bb.fetch2 import URI | 14 | from 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 | ||
9 | import unittest | 9 | import unittest |
10 | import bb | ||
11 | import os | 10 | import os |
12 | import tempfile | 11 | import tempfile |
13 | import subprocess | 12 | import 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 | |||
21 | import bb.utils | 21 | import bb.utils |
22 | import bb.command | 22 | import bb.command |
23 | import bb.remotedata | 23 | import bb.remotedata |
24 | from bb.cookerdata import CookerConfiguration, ConfigParameters | 24 | from bb.cookerdata import CookerConfiguration |
25 | from bb.main import setup_bitbake, BitBakeConfigParameters, BBMainException | 25 | from bb.main import setup_bitbake, BitBakeConfigParameters |
26 | import bb.fetch2 | 26 | import 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 | ||
13 | import os | 13 | import os |
14 | import sys | 14 | import sys |
15 | import xmlrpc.client as xmlrpclib | ||
16 | import logging | 15 | import logging |
17 | import progressbar | 16 | import progressbar |
18 | import signal | 17 | import 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 | ||
39 | import logging | 39 | import logging |
40 | import os, sys, itertools, time, subprocess | 40 | import os, sys, itertools, time |
41 | 41 | ||
42 | try: | 42 | try: |
43 | import curses | 43 | import curses |
@@ -46,7 +46,6 @@ except ImportError: | |||
46 | 46 | ||
47 | import bb | 47 | import bb |
48 | import xmlrpc.client | 48 | import xmlrpc.client |
49 | from bb import ui | ||
50 | from bb.ui import uihelper | 49 | from bb.ui import uihelper |
51 | 50 | ||
52 | parsespin = itertools.cycle( r'|/-\\' ) | 51 | parsespin = 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 | |||
11 | import gi | 11 | import gi |
12 | gi.require_version('Gtk', '3.0') | 12 | gi.require_version('Gtk', '3.0') |
13 | from gi.repository import Gtk, Gdk, GObject | 13 | from gi.repository import Gtk, Gdk, GObject |
14 | from multiprocessing import Queue | ||
15 | import threading | 14 | import threading |
16 | from xmlrpc import client | 15 | from xmlrpc import client |
17 | import time | ||
18 | import bb | 16 | import bb |
19 | import bb.event | 17 | import 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 | |||
24 | import traceback | 24 | import traceback |
25 | import errno | 25 | import errno |
26 | import signal | 26 | import signal |
27 | import ast | ||
28 | import collections | 27 | import collections |
29 | import copy | 28 | import copy |
30 | from subprocess import getstatusoutput | 29 | from 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 | ||
5 | from pdb import set_trace | ||
6 | import warnings | 5 | import warnings |
7 | from bs4.builder import ( | 6 | from 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 | ||
11 | from pdb import set_trace | ||
12 | import codecs | 11 | import codecs |
13 | from html.entities import codepoint2name | 12 | from html.entities import codepoint2name |
14 | import re | 13 | import re |
15 | import logging | 14 | import logging |
16 | import string | ||
17 | 15 | ||
18 | # Import a library to autodetect character encodings. | 16 | # Import a library to autodetect character encodings. |
19 | chardet_type = None | 17 | chardet_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/. | ||
42 | try: | ||
43 | import iconv_codec | ||
44 | except ImportError: | ||
45 | pass | ||
46 | |||
47 | xml_encoding_re = re.compile( | 39 | xml_encoding_re = re.compile( |
48 | r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I) | 40 | r'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I) |
49 | html_meta_re = re.compile( | 41 | html_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 | ||
3 | from pdb import set_trace | ||
4 | import collections.abc | 3 | import collections.abc |
5 | import re | 4 | import re |
6 | import sys | 5 | import 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 | ||
5 | import pickle | 5 | import pickle |
6 | import copy | 6 | import copy |
7 | import functools | ||
8 | import unittest | 7 | import unittest |
9 | from unittest import TestCase | 8 | from unittest import TestCase |
10 | from bs4 import BeautifulSoup | 9 | from 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 | ||
10 | import atexit | ||
11 | import doctest | 10 | import doctest |
12 | import 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) |
15 | import unittest | ||
16 | 13 | ||
17 | DOCTEST_FLAGS = ( | 14 | DOCTEST_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 |
2 | trees.""" | 2 | trees.""" |
3 | 3 | ||
4 | from pdb import set_trace | ||
5 | import pickle | 4 | import pickle |
6 | from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest | 5 | from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest |
7 | from bs4.builder import HTMLParserTreeBuilder | 6 | from 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 | ||
3 | import re | ||
4 | import warnings | 3 | import warnings |
5 | 4 | ||
6 | try: | 5 | try: |
@@ -14,13 +13,8 @@ except ImportError as e: | |||
14 | if LXML_PRESENT: | 13 | if LXML_PRESENT: |
15 | from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML | 14 | from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML |
16 | 15 | ||
17 | from bs4 import ( | 16 | from bs4 import BeautifulStoneSoup |
18 | BeautifulSoup, | ||
19 | BeautifulStoneSoup, | ||
20 | ) | ||
21 | from bs4.element import Comment, Doctype, SoupStrainer | ||
22 | from bs4.testing import skipIf | 17 | from bs4.testing import skipIf |
23 | from bs4.tests import test_htmlparser | ||
24 | from bs4.testing import ( | 18 | from 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 | ||
4 | from pdb import set_trace | ||
5 | import logging | 4 | import logging |
6 | import unittest | 5 | import unittest |
7 | import sys | 6 | import sys |
8 | import tempfile | 7 | import tempfile |
9 | 8 | ||
10 | from bs4 import ( | 9 | from bs4 import BeautifulSoup |
11 | BeautifulSoup, | ||
12 | BeautifulStoneSoup, | ||
13 | ) | ||
14 | from bs4.element import ( | 10 | from 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 | |||
9 | methods tested here. | 9 | methods tested here. |
10 | """ | 10 | """ |
11 | 11 | ||
12 | from pdb import set_trace | ||
13 | import copy | 12 | import copy |
14 | import pickle | 13 | import pickle |
15 | import re | 14 | import re |
16 | import warnings | 15 | import warnings |
17 | from bs4 import BeautifulSoup | 16 | from bs4 import BeautifulSoup |
18 | from bs4.builder import ( | 17 | from bs4.builder import builder_registry |
19 | builder_registry, | ||
20 | HTMLParserTreeBuilder, | ||
21 | ) | ||
22 | from bs4.element import ( | 18 | from 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 | ) |
32 | from bs4.testing import ( | 28 | from bs4.testing import SoupTest |
33 | SoupTest, | ||
34 | skipIf, | ||
35 | ) | ||
36 | 29 | ||
37 | XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None) | 30 | XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None) |
38 | LXML_PRESENT = (builder_registry.lookup("lxml") is not None) | 31 | LXML_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 | ||
6 | from contextlib import closing | ||
7 | import json | 6 | import json |
8 | import logging | 7 | import logging |
9 | import socket | 8 | import 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 | ||
6 | import logging | 6 | import logging |
7 | import json | ||
8 | 7 | ||
9 | from collections import OrderedDict, defaultdict | 8 | from collections import defaultdict |
10 | 9 | ||
11 | from urllib.parse import unquote, urlparse | 10 | from 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 | ||
10 | import argparse | ||
11 | import logging | 10 | import logging |
12 | import os | ||
13 | import bb.msg | ||
14 | 11 | ||
15 | logger = logging.getLogger('BitBake.layerindexlib.plugin') | 12 | logger = 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 | ||
6 | import unittest | ||
7 | import tempfile | ||
8 | import os | 6 | import os |
9 | import bb | 7 | import bb |
10 | 8 | ||
11 | import layerindexlib | 9 | import layerindexlib |
12 | from layerindexlib.tests.common import LayersTest | 10 | from layerindexlib.tests.common import LayersTest |
13 | 11 | ||
14 | import logging | ||
15 | 12 | ||
16 | class LayerIndexCookerTest(LayersTest): | 13 | class 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 | ||
6 | import unittest | ||
7 | import tempfile | ||
8 | import os | ||
9 | import bb | ||
10 | |||
11 | from layerindexlib.tests.common import LayersTest | 6 | from layerindexlib.tests.common import LayersTest |
12 | 7 | ||
13 | import logging | ||
14 | 8 | ||
15 | class LayerIndexObjectsTest(LayersTest): | 9 | class 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 | ||
6 | import unittest | 6 | import unittest |
7 | import tempfile | ||
8 | import os | 7 | import os |
9 | import bb | ||
10 | 8 | ||
11 | import layerindexlib | 9 | import layerindexlib |
12 | from layerindexlib.tests.common import LayersTest | 10 | from layerindexlib.tests.common import LayersTest |
13 | 11 | ||
14 | import logging | ||
15 | 12 | ||
16 | def skipIfNoNetwork(): | 13 | def 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 | ||
9 | from django.conf.urls import include, url | 9 | from django.conf.urls import url |
10 | 10 | ||
11 | import bldcollector.views | 11 | import 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 | ||
9 | from django.views.decorators.cache import cache_control | ||
10 | from django.core.urlresolvers import reverse | 9 | from django.core.urlresolvers import reverse |
11 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | ||
12 | from django.http import HttpResponseBadRequest, HttpResponse | 10 | from django.http import HttpResponseBadRequest, HttpResponse |
13 | from django.utils import timezone | ||
14 | from django.utils.html import escape | ||
15 | from datetime import timedelta | ||
16 | from django.utils import formats | ||
17 | from toastergui.templatetags.projecttags import json as jsonfilter | ||
18 | import json | ||
19 | import os | 11 | import os |
20 | import tempfile | 12 | import tempfile |
21 | import subprocess | 13 | import 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 | ||
5 | from django.contrib import admin | 5 | from django.contrib import admin |
6 | from django.contrib.admin.filters import RelatedFieldListFilter | ||
7 | from .models import BuildEnvironment | 6 | from .models import BuildEnvironment |
8 | 7 | ||
9 | class BuildEnvironmentAdmin(admin.ModelAdmin): | 8 | class 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 | ||
9 | import os | 9 | import os |
10 | import sys | 10 | import sys |
11 | import re | ||
12 | from django.db import transaction | ||
13 | from django.db.models import Q | 11 | from django.db.models import Q |
14 | from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake | 12 | from bldcontrol.models import BuildEnvironment, BRLayer, BRBitbake |
15 | 13 | ||
16 | # load Bitbake components | 14 | # load Bitbake components |
17 | path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) | 15 | path = 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 | ||
9 | import os | 9 | import os |
10 | import sys | ||
11 | import re | 10 | import re |
12 | import shutil | 11 | import shutil |
13 | import time | 12 | import time |
14 | from django.db import transaction | 13 | from bldcontrol.models import BuildEnvironment, BuildRequest, Build |
15 | from django.db.models import Q | 14 | from orm.models import CustomImageRecipe, Layer, Layer_Version, Project, ToasterSetting |
16 | from bldcontrol.models import BuildEnvironment, BuildRequest, BRLayer, BRVariable, BRTarget, BRBitbake, Build | ||
17 | from orm.models import CustomImageRecipe, Layer, Layer_Version, Project, ProjectLayer, ToasterSetting | ||
18 | from orm.models import signal_runbuilds | 15 | from orm.models import signal_runbuilds |
19 | import subprocess | 16 | import subprocess |
20 | 17 | ||
21 | from toastermain import settings | 18 | from toastermain import settings |
22 | 19 | ||
23 | from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController | 20 | from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException |
24 | 21 | ||
25 | import logging | 22 | import logging |
26 | logger = logging.getLogger("toaster") | 23 | logger = logging.getLogger("toaster") |
27 | 24 | ||
28 | install_dir = os.environ.get('TOASTER_DIR') | 25 | install_dir = os.environ.get('TOASTER_DIR') |
29 | 26 | ||
30 | from pprint import pprint, pformat | 27 | from pprint import pformat |
31 | 28 | ||
32 | class LocalhostBEController(BuildEnvironmentController): | 29 | class 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 | ||
5 | from django.core.management.base import BaseCommand, CommandError | 5 | from django.core.management.base import BaseCommand |
6 | from django.db import transaction | ||
7 | 6 | ||
8 | from django.core.management import call_command | 7 | from django.core.management import call_command |
9 | from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException | ||
10 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError | 8 | from bldcontrol.models import BuildRequest, BuildEnvironment, BRError |
11 | from orm.models import ToasterSetting, Build, Layer | 9 | from 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 | ||
5 | from __future__ import unicode_literals | 5 | from __future__ import unicode_literals |
6 | from django.db import models | 6 | from django.db import models |
7 | from django.core.validators import MaxValueValidator, MinValueValidator | ||
8 | from django.utils.encoding import force_text | 7 | from django.utils.encoding import force_text |
9 | from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version | 8 | from orm.models import Project, Build, Layer_Version |
10 | 9 | ||
11 | import logging | 10 | import logging |
12 | logger = logging.getLogger("toaster") | 11 | logger = 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 | ||
9 | from django.core.management.base import BaseCommand | 9 | from django.core.management.base import BaseCommand |
10 | 10 | ||
11 | from orm.models import LayerSource, Layer, Release, Layer_Version | 11 | from orm.models import Layer, Release, Layer_Version |
12 | from orm.models import LayerVersionDependency, Machine, Recipe | 12 | from orm.models import LayerVersionDependency, Machine, Recipe |
13 | from orm.models import Distro | 13 | from orm.models import Distro |
14 | from orm.models import ToasterSetting | 14 | from 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 -*- |
2 | from __future__ import unicode_literals | 2 | from __future__ import unicode_literals |
3 | 3 | ||
4 | from django.db import migrations, models | 4 | from django.db import migrations |
5 | 5 | ||
6 | 6 | ||
7 | class Migration(migrations.Migration): | 7 | class 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 | |||
19 | import time | 19 | import time |
20 | import unittest | 20 | import unittest |
21 | 21 | ||
22 | from django.contrib.staticfiles.testing import StaticLiveServerTestCase | ||
23 | from selenium import webdriver | 22 | from selenium import webdriver |
24 | from selenium.webdriver.support.ui import WebDriverWait | 23 | from selenium.webdriver.support.ui import WebDriverWait |
25 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | 24 | from 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 | ||
10 | import re | ||
11 | |||
12 | from django.core.urlresolvers import reverse | 10 | from django.core.urlresolvers import reverse |
13 | from django.utils import timezone | ||
14 | from tests.browser.selenium_helpers import SeleniumTestCase | 11 | from tests.browser.selenium_helpers import SeleniumTestCase |
15 | 12 | ||
16 | from orm.models import BitbakeVersion, Release, Project, ProjectVariable | 13 | from 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 | ||
10 | import time | ||
11 | import re | 10 | import re |
12 | from tests.functional.functional_helpers import SeleniumFunctionalTestCase | 11 | from tests.functional.functional_helpers import SeleniumFunctionalTestCase |
13 | from orm.models import Project | 12 | from 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 | |||
13 | import json | 13 | import json |
14 | import subprocess | 14 | import subprocess |
15 | from collections import Counter | 15 | from collections import Counter |
16 | from shutil import copyfile | ||
17 | 16 | ||
18 | from orm.models import Project, ProjectTarget, Build, Layer_Version | 17 | from orm.models import Project, ProjectTarget, Build, Layer_Version |
19 | from orm.models import LayerVersionDependency, LayerSource, ProjectLayer | 18 | from orm.models import LayerVersionDependency, LayerSource, ProjectLayer |
@@ -29,8 +28,6 @@ from django.core.urlresolvers import reverse | |||
29 | from django.db.models import Q, F | 28 | from django.db.models import Q, F |
30 | from django.db import Error | 29 | from django.db import Error |
31 | from toastergui.templatetags.projecttags import filtered_filesizeformat | 30 | from toastergui.templatetags.projecttags import filtered_filesizeformat |
32 | from django.utils import timezone | ||
33 | import pytz | ||
34 | 31 | ||
35 | # development/debugging support | 32 | # development/debugging support |
36 | verbose = 2 | 33 | verbose = 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 | ||
9 | from toastergui.widgets import ToasterTable | 9 | from toastergui.widgets import ToasterTable |
10 | from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project | 10 | from orm.models import Recipe, ProjectLayer, Layer_Version, Project |
11 | from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task | 11 | from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task |
12 | from orm.models import CustomImagePackage, Package_DependencyManager | 12 | from orm.models import CustomImagePackage, Package_DependencyManager |
13 | from orm.models import Distro | 13 | from django.db.models import Q, Sum, Count, When, Case, Value, IntegerField |
14 | from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField | ||
15 | from django.conf.urls import url | ||
16 | from django.core.urlresolvers import reverse, resolve | ||
17 | from django.http import HttpResponse | ||
18 | from django.views.generic import TemplateView | ||
19 | 14 | ||
20 | from toastergui.tablefilter import TableFilter | 15 | from toastergui.tablefilter import TableFilter |
21 | from toastergui.tablefilter import TableFilterActionToggle | 16 | from 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 | ||
5 | from django import template | 5 | from django import template |
6 | import json | ||
7 | 6 | ||
8 | register = template.Library() | 7 | register = 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 | ||
9 | from datetime import datetime, timedelta | 9 | from datetime import timedelta |
10 | from os.path import relpath | 10 | from os.path import relpath |
11 | import re | 11 | import re |
12 | from django import template | 12 | from 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 | ||
9 | from django.conf.urls import include, url | 9 | from django.conf.urls import url |
10 | from django.views.generic import RedirectView, TemplateView | 10 | from django.views.generic import RedirectView |
11 | 11 | ||
12 | from django.http import HttpResponseBadRequest | ||
13 | from toastergui import tables | 12 | from toastergui import tables |
14 | from toastergui import buildtables | 13 | from toastergui import buildtables |
15 | from toastergui import typeaheads | 14 | from 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 | |||
20 | from orm.models import BitbakeVersion, CustomImageRecipe | 20 | from orm.models import BitbakeVersion, CustomImageRecipe |
21 | 21 | ||
22 | from django.core.urlresolvers import reverse, resolve | 22 | from django.core.urlresolvers import reverse, resolve |
23 | from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist | 23 | from django.core.exceptions import ObjectDoesNotExist |
24 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger | 24 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger |
25 | from django.http import HttpResponseNotFound, JsonResponse | 25 | from django.http import HttpResponseNotFound, JsonResponse |
26 | from django.utils import timezone | 26 | from 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 | ||
667 | from django.core.serializers.json import DjangoJSONEncoder | ||
668 | from django.http import HttpResponse | 667 | from django.http import HttpResponse |
669 | def xhr_dirinfo(request, build_id, target_id): | 668 | def 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 | ||
1341 | import toastermain.settings | 1340 | import toastermain.settings |
1342 | 1341 | ||
1343 | from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable | 1342 | from orm.models import Project, ProjectLayer, ProjectVariable |
1344 | from bldcontrol.models import BuildEnvironment | 1343 | from 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 | |||
1349 | if True: | 1348 | if 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 | ||
5 | from django.core.management.base import BaseCommand, CommandError | 5 | from django.core.management.base import BaseCommand |
6 | from django.core.exceptions import ObjectDoesNotExist | 6 | from django.core.exceptions import ObjectDoesNotExist |
7 | from orm.models import Build | 7 | from orm.models import Build |
8 | from django.db import OperationalError | 8 | from django.db import OperationalError |
9 | import os | ||
10 | |||
11 | 9 | ||
12 | 10 | ||
13 | class Command(BaseCommand): | 11 | class 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 | ||
34 | from django.core.management.base import BaseCommand, CommandError | 34 | from django.core.management.base import BaseCommand |
35 | from django.core.exceptions import ObjectDoesNotExist | 35 | from orm.models import Project, Release, ProjectVariable |
36 | from orm.models import ProjectManager, Project, Release, ProjectVariable | ||
37 | from orm.models import Layer, Layer_Version, LayerSource, ProjectLayer | 36 | from orm.models import Layer, Layer_Version, LayerSource, ProjectLayer |
38 | from toastergui.api import scan_layer_content | 37 | from toastergui.api import scan_layer_content |
39 | from django.db import OperationalError | ||
40 | 38 | ||
41 | import os | 39 | import os |
42 | import re | 40 | import 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 | ||
5 | from django.core.management.base import BaseCommand, CommandError | 5 | from django.core.management.base import BaseCommand |
6 | from orm.models import Build | 6 | from orm.models import Build |
7 | import os | ||
8 | 7 | ||
9 | 8 | ||
10 | 9 | ||