diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-05-21 11:57:46 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-05-21 11:57:46 -0400 |
commit | bc568d5a817c9104d984215e036dad87506f6bfc (patch) | |
tree | 4c95ac802b523ac16a39b10f9e644736c8f3adf6 /bs4/__init__.py | |
parent | 5045b8cfcdd7556a1e2c4a2999d4ed1108b0425a (diff) |
Renamed .next and .previous to .next_element and .previous_element.
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index 22ecc43..6406bef 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -159,10 +159,10 @@ class BeautifulSoup(Tag): def object_was_parsed(self, o): """Add an object to the parse tree.""" - o.setup(self.currentTag, self.previous) - if self.previous: - self.previous.next = o - self.previous = o + o.setup(self.currentTag, self.previous_element) + if self.previous_element: + self.previous_element.next_element = o + self.previous_element = o self.currentTag.contents.append(o) @@ -206,12 +206,12 @@ class BeautifulSoup(Tag): return None tag = Tag(self, self.builder, name, attrs, self.currentTag, - self.previous) + self.previous_element) if tag is None: return tag - if self.previous: - self.previous.next = tag - self.previous = tag + if self.previous_element: + self.previous_element.next_element = tag + self.previous_element = tag self.pushTag(tag) return tag |