diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2010-12-24 10:09:17 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2010-12-24 10:09:17 -0500 |
commit | 66237256dfec2976aa62cff78ae1dbeafab0c4cf (patch) | |
tree | 9d411f0186f5bfcfe4cacf34099b48e6e4588f5c | |
parent | 7cf03ca17f51970579ead05953cfa2306877c44c (diff) |
Since this is 4.0, got rid of compatibility methods.
-rw-r--r-- | src/beautifulsoup/element.py | 19 | ||||
-rw-r--r-- | src/beautifulsoup/tests/test_soup.py | 2 |
2 files changed, 1 insertions, 20 deletions
diff --git a/src/beautifulsoup/element.py b/src/beautifulsoup/element.py index 3bdb01f..b5b8e84 100644 --- a/src/beautifulsoup/element.py +++ b/src/beautifulsoup/element.py @@ -696,25 +696,6 @@ class Tag(PageElement, Entities): return self._findAll(name, attrs, text, limit, generator, **kwargs) findChildren = findAll - # Pre-3.x compatibility methods. Will go away in 4.0. - first = find - fetch = findAll - - def fetchText(self, text=None, recursive=True, limit=None): - return self.findAll(text=text, recursive=recursive, limit=limit) - - def firstText(self, text=None, recursive=True): - return self.find(text=text, recursive=recursive) - - # 3.x compatibility methods. Will go away in 4.0. - def renderContents(self, encoding=DEFAULT_OUTPUT_ENCODING, - prettyPrint=False, indentLevel=0): - if encoding is None: - return self.decodeContents(prettyPrint, indentLevel, encoding) - else: - return self.encodeContents(encoding, prettyPrint, indentLevel) - - #Private methods def _getAttrMap(self): diff --git a/src/beautifulsoup/tests/test_soup.py b/src/beautifulsoup/tests/test_soup.py index 24b333e..ff91104 100644 --- a/src/beautifulsoup/tests/test_soup.py +++ b/src/beautifulsoup/tests/test_soup.py @@ -734,7 +734,7 @@ class EncodeRed(SoupTest): "Otherwise, ignore it.") self.assertEquals(soup.originalEncoding, "euc-jp") - self.assertEquals(soup.renderContents('utf-8'), utf8) + self.assertEquals(soup.encodeContents('utf-8'), utf8) old_text = "<?xml encoding='windows-1252'><foo>\x92</foo>" new_text = "<?xml version='1.0' encoding='utf-8'?><foo>’</foo>" |