diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-26 23:19:10 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-26 23:19:10 -0500 |
commit | 5082ca97607846f3be18859f1b803ac15ef77083 (patch) | |
tree | b2fdb5381c6433652aebdf63aad0d0ef6aa47f13 /beautifulsoup/__init__.py | |
parent | a5f2ee72f16d0b6755ab84ddf2eff8e3d412e755 (diff) |
Removed the redundant pretty_print argument except for the top level.
Diffstat (limited to 'beautifulsoup/__init__.py')
-rw-r--r-- | beautifulsoup/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/beautifulsoup/__init__.py b/beautifulsoup/__init__.py index 5aa1406..53130e0 100644 --- a/beautifulsoup/__init__.py +++ b/beautifulsoup/__init__.py @@ -262,7 +262,7 @@ class BeautifulSoup(Tag): def handle_data(self, data): self.currentData.append(data) - def decode(self, pretty_print=False, indent_level=0, + def decode(self, pretty_print=False, eventual_encoding=DEFAULT_OUTPUT_ENCODING, substitute_html_entities=False): """Returns a string or Unicode representation of this document. @@ -275,8 +275,12 @@ class BeautifulSoup(Tag): prefix = u'<?xml version="1.0"%s>\n' % encoding_part else: prefix = u'' + if not pretty_print: + indent_level = None + else: + indent_level = 0 return prefix + super(BeautifulSoup, self).decode( - pretty_print, indent_level, eventual_encoding, + indent_level, eventual_encoding, substitute_html_entities) |