Hi PrettyTable users,
Today I have released PrettyTable 0.7.1! The new release is available
to download from the "Downloads" tab of the project home page and has
also been uploaded to PyPI so you can install it using easy_install,
pip or other tools.
0.7.1 contains a few small improvements/changes from 0.7, but no major
changes.
* In 0.7, when vrules was set to FRAME or NONE, PrettyTable
would include spurious junction characters in horizontal rules, like
this:
+---------+---------+---------+---------+
| Field 1 Field 2 Field 3 Field 4 |
+---------+---------+---------+---------+
| 0 1 2 3 |
+---------+---------+---------+---------+
| 5 6 7 8 |
+---------+---------+---------+---------+
This has been fixed so that pure horizontal rules are produced, like
this:
+---------------------------------------+
| Field 1 Field 2 Field 3 Field 4 |
+---------------------------------------+
| 0 1 2 3 |
+---------------------------------------+
| 5 6 7 8 |
+---------------------------------------+
Thanks to Antonio Messina for pointing out this shortcoming.
* PrettyTable now recognises ANSII colour codes as not being
visibly printed and therefore does not count them when
calculating the length of strings. This means you can now put
coloured text into PrettyTables and everything will still be
correctly aligned. The Python module termcolor
(
https://pypi.python.org/pypi/termcolor) makes this easy to
do. Thanks to Geoffrey Lehée and Google Code user mockba for both
suggesting this improvement.
* Until now, get_html_string() has always used <br/> to produce
linebreaks when tables contain multiline strings. This is valid
XHTML, but invalid HTML. get_html_string() now accepts an "xhtml"
keyword argument, which may be True or False (default is False).
When xhtml=False, linebreaks will be <br>, and when xhtml=True they
will be <br/>. This allows PrettyTable to produce valid HTML or
XHTML depending on the user's needs. Note that the default behaviour
is changing, so if you are relying on get_html_string() to produce
XHTML and not HTML you will need to make some (very minor) changes.
Happy hacking!
Luke
--
Luke Maurits <
lu...@maurits.id.au>
http://www.luke.maurits.id.au
CompCogSci | Crypto | Maths | Python | Unix