Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit17f9dba

Browse files
committed
Remove the long-deprecated BeautifulSoup support.
As has been stated before, this was deprecated due to lack ofnamespace support, hence making it impossible for it to representany tree containing foreign content.
1 parent4834f64 commit17f9dba

File tree

7 files changed

+3
-325
lines changed

7 files changed

+3
-325
lines changed

‎html5lib/tests/support.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@
4848
exceptImportError:
4949
pass
5050

51-
try:
52-
importBeautifulSoup
53-
treeTypes["beautifulsoup"]=treebuilders.getTreeBuilder("beautifulsoup",fullTree=True)
54-
exceptImportError:
55-
pass
56-
5751
defget_data_files(subdirectory,files='*.dat'):
5852
returnglob.glob(os.path.join(test_dir,subdirectory,files))
5953

‎html5lib/tests/test_treewalkers.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ def PullDOMAdapter(node):
9393
"walker":treewalkers.getTreeWalker("lxml")}
9494
exceptImportError:
9595
pass
96-
97-
try:
98-
importBeautifulSoup
99-
treeTypes["beautifulsoup"]= \
100-
{"builder":treebuilders.getTreeBuilder("beautifulsoup"),
101-
"walker":treewalkers.getTreeWalker("beautifulsoup")}
102-
exceptImportError:
103-
pass
10496

10597
#Try whatever etree implementations are available from a list that are
10698
#"supposed" to work

‎html5lib/treebuilders/__init__.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
4040
"""Get a TreeBuilder class for various types of tree with built-in support
4141
4242
treeType - the name of the tree type required (case-insensitive). Supported
43-
values are "simpletree", "dom","etree"and "beautifulsoup"
43+
values are "simpletree", "dom", and "etree"
4444
4545
"simpletree" - a built-in DOM-ish tree type with support for some
4646
more pythonic idioms.
@@ -51,7 +51,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
5151
"etree" - A generic builder for tree implementations exposing an
5252
elementtree-like interface (known to work with
5353
ElementTree, cElementTree and lxml.etree).
54-
"beautifulsoup" - Beautiful soup (if installed)
5554
5655
implementation - (Currently applies to the "etree" and "dom" tree types). A
5756
module implementing the tree type e.g.
@@ -70,9 +69,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
7069
eliftreeType=="simpletree":
7170
from .importsimpletree
7271
treeBuilderCache[treeType]=simpletree.TreeBuilder
73-
eliftreeType=="beautifulsoup":
74-
from .importsoup
75-
treeBuilderCache[treeType]=soup.TreeBuilder
7672
eliftreeType=="lxml":
7773
from .importetree_lxml
7874
treeBuilderCache[treeType]=etree_lxml.TreeBuilder

‎html5lib/treebuilders/soup.py‎

Lines changed: 0 additions & 238 deletions
This file was deleted.

‎html5lib/treewalkers/__init__.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
1818
"""Get a TreeWalker class for various types of tree with built-in support
1919
2020
treeType - the name of the tree type required (case-insensitive). Supported
21-
values are "simpletree", "dom","etree"and "beautifulsoup"
21+
values are "simpletree", "dom", and "etree"
2222
2323
"simpletree" - a built-in DOM-ish tree type with support for some
2424
more pythonic idioms.
@@ -28,7 +28,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
2828
elementtree-like interface (known to work with
2929
ElementTree, cElementTree and lxml.etree).
3030
"lxml" - Optimized walker for lxml.etree
31-
"beautifulsoup" - Beautiful soup (if installed)
3231
"genshi" - a Genshi stream
3332
3433
implementation - (Currently applies to the "etree" tree type only). A module
@@ -45,9 +44,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
4544
eliftreeType=="genshi":
4645
from .importgenshistream
4746
treeWalkerCache[treeType]=genshistream.TreeWalker
48-
eliftreeType=="beautifulsoup":
49-
from .importsoup
50-
treeWalkerCache[treeType]=soup.TreeWalker
5147
eliftreeType=="lxml":
5248
from .importlxmletree
5349
treeWalkerCache[treeType]=lxmletree.TreeWalker

‎html5lib/treewalkers/soup.py‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
with the behaviour of major desktop web browsers.
88
99
Output is to a tree structure; the current release supports output to
10-
DOM, ElementTree,lxmlandBeautifulSoup tree formats as well as a
10+
DOM, ElementTree, andlxml tree formats as well as a
1111
simple custom format"""
1212

1313
classifiers=[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp