diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2009-04-09 12:14:58 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2009-04-09 12:14:58 -0400 |
commit | 4440f31504605ac7572ca8d84d4cbfd7af19aa1e (patch) | |
tree | 8fc50a3382e442f6234d5e0ea8c38df04f9857cd /BeautifulSoup.py | |
parent | 09516183e935676302431fcdd04b08d40f0ed2e7 (diff) |
Minor cleanup.
Diffstat (limited to 'BeautifulSoup.py')
-rw-r--r-- | BeautifulSoup.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/BeautifulSoup.py b/BeautifulSoup.py index a16448c..99ce460 100644 --- a/BeautifulSoup.py +++ b/BeautifulSoup.py @@ -1012,13 +1012,16 @@ class TreeBuilder(Entities): self_closing_tags = set() assume_html = False + def __init__(self): + self.soup = None + def isSelfClosingTag(self, name): return name in self.self_closing_tags def reset(self): pass - def close(self): + def feed(self): pass @@ -1469,7 +1472,6 @@ class BeautifulStoneSoup(Tag): except StopParsing: pass self.markup = None # The markup can now be GCed. - self.builder.close() self.builder.soup = None self.builder = None # So can the builder. @@ -1654,7 +1656,7 @@ class BeautifulStoneSoup(Tag): class BeautifulSoup(BeautifulStoneSoup): - + """A convenience class for parsing HTML without creating a builder.""" def _defaultBuilder(self): return HTMLParserBuilder() @@ -1670,7 +1672,7 @@ class StopParsing(Exception): # or Unicode). It is heavily based on code from Mark Pilgrim's # Universal Feed Parser. It does not rewrite the XML or HTML to # reflect a new encoding: that happens in BeautifulStoneSoup.handle_pi -# (XML) and BeautifulSoup.start_meta (HTML). +# (XML) and BeautifulSoup.handleSpecialMetaTag (HTML). # Autodetects character encodings. # Download from http://chardet.feedparser.org/ |