See attached patch (I've inlined it to as I can't remember what google
groups does to attachments.
I deliberately forced the params _get_simple_html_string() of match
_get_formatted_html_string() (whether those params are used or not) for
consistency.
Chris
--- prettytable-0.5-RC1.py Thu May 21 10:30:33 2009
+++ prettytable.py Thu May 21 17:08:24 2009
@@ -456,21 +456,23 @@
return self.html_cache[key]
if format:
- string = self._get_formatted_html_string(start, end,
fields, sortby, reversesort, header, border, hrules, attributes)
+ tmp_html_func=self._get_formatted_html_string
else:
- string = self._get_simple_html_string(start, end, fields,
sortby, reversesort, attributes)
+ tmp_html_func=self._get_simple_html_string
+ string = tmp_html_func(start, end, fields, sortby, reversesort,
header, border, hrules, attributes)
if self.caching:
self.html_cache[key] = string
return string
- def _get_simple_html_string(self, start, end, fields, sortby,
reversesort, attributes):
+ def _get_simple_html_string(self, start, end, fields, sortby,
reversesort, header, border, hrules, attributes):
bits = []
# Slow but works
table_tag = '<table'
- table_tag += ' border="1"'
+ if border:
+ table_tag += ' border="1"'
if attributes:
for attr_name in attributes:
table_tag += ' %s="%s"' % (attr_name,
attributes[attr_name])