Skip to content

Commit

Permalink
Remove the long-deprecated BeautifulSoup support.
Browse files Browse the repository at this point in the history
As has been stated before, this was deprecated due to lack of
namespace support, hence making it impossible for it to represent
any tree containing foreign content.
  • Loading branch information
gsnedders committed Apr 9, 2013
1 parent 4834f64 commit 17f9dba
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 325 deletions.
6 changes: 0 additions & 6 deletions html5lib/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
except ImportError:
pass

try:
import BeautifulSoup
treeTypes["beautifulsoup"] = treebuilders.getTreeBuilder("beautifulsoup", fullTree=True)
except ImportError:
pass

def get_data_files(subdirectory, files='*.dat'):
return glob.glob(os.path.join(test_dir,subdirectory,files))

Expand Down
8 changes: 0 additions & 8 deletions html5lib/tests/test_treewalkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ def PullDOMAdapter(node):
"walker": treewalkers.getTreeWalker("lxml")}
except ImportError:
pass

try:
import BeautifulSoup
treeTypes["beautifulsoup"] = \
{"builder": treebuilders.getTreeBuilder("beautifulsoup"),
"walker": treewalkers.getTreeWalker("beautifulsoup")}
except ImportError:
pass

#Try whatever etree implementations are available from a list that are
#"supposed" to work
Expand Down
6 changes: 1 addition & 5 deletions html5lib/treebuilders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
"""Get a TreeBuilder class for various types of tree with built-in support
treeType - the name of the tree type required (case-insensitive). Supported
values are "simpletree", "dom", "etree" and "beautifulsoup"
values are "simpletree", "dom", and "etree"
"simpletree" - a built-in DOM-ish tree type with support for some
more pythonic idioms.
Expand All @@ -51,7 +51,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
"etree" - A generic builder for tree implementations exposing an
elementtree-like interface (known to work with
ElementTree, cElementTree and lxml.etree).
"beautifulsoup" - Beautiful soup (if installed)
implementation - (Currently applies to the "etree" and "dom" tree types). A
module implementing the tree type e.g.
Expand All @@ -70,9 +69,6 @@ def getTreeBuilder(treeType, implementation=None, **kwargs):
elif treeType == "simpletree":
from . import simpletree
treeBuilderCache[treeType] = simpletree.TreeBuilder
elif treeType == "beautifulsoup":
from . import soup
treeBuilderCache[treeType] = soup.TreeBuilder
elif treeType == "lxml":
from . import etree_lxml
treeBuilderCache[treeType] = etree_lxml.TreeBuilder
Expand Down
238 changes: 0 additions & 238 deletions html5lib/treebuilders/soup.py

This file was deleted.

6 changes: 1 addition & 5 deletions html5lib/treewalkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
"""Get a TreeWalker class for various types of tree with built-in support
treeType - the name of the tree type required (case-insensitive). Supported
values are "simpletree", "dom", "etree" and "beautifulsoup"
values are "simpletree", "dom", and "etree"
"simpletree" - a built-in DOM-ish tree type with support for some
more pythonic idioms.
Expand All @@ -28,7 +28,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
elementtree-like interface (known to work with
ElementTree, cElementTree and lxml.etree).
"lxml" - Optimized walker for lxml.etree
"beautifulsoup" - Beautiful soup (if installed)
"genshi" - a Genshi stream
implementation - (Currently applies to the "etree" tree type only). A module
Expand All @@ -45,9 +44,6 @@ def getTreeWalker(treeType, implementation=None, **kwargs):
elif treeType == "genshi":
from . import genshistream
treeWalkerCache[treeType] = genshistream.TreeWalker
elif treeType == "beautifulsoup":
from . import soup
treeWalkerCache[treeType] = soup.TreeWalker
elif treeType == "lxml":
from . import lxmletree
treeWalkerCache[treeType] = lxmletree.TreeWalker
Expand Down
62 changes: 0 additions & 62 deletions html5lib/treewalkers/soup.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with the behaviour of major desktop web browsers.
Output is to a tree structure; the current release supports output to
DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a
DOM, ElementTree, and lxml tree formats as well as a
simple custom format"""

classifiers=[
Expand Down

0 comments on commit 17f9dba

Please sign in to comment.