summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bs4
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/bs4
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/bs4')
-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
9 files changed, 4 insertions, 37 deletions
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)