alexras/boomslang — pull request #20 by liulonnie (2012-09-04 20:35:31+00:00)
Title: Handle "rc" suffix in matplotlib version parsing.

Hi Alex,

I modified the file Util.py to trim the "rc" suffix (if any) in matplotlib.__version__. The matplotlib from Ubuntu 12.04 LTS official source has a version name of "1.1.1rc", which would trigger the following exception:

Traceback (most recent call last):
File "test.py", line 16, in
plot.save('test.svg')
File "/usr/local/lib/python2.7/dist-packages/boomslang/Plot.py", line 516, in save
layout.save(filename,**kwargs)
File "/usr/local/lib/python2.7/dist-packages/boomslang/PlotLayout.py", line 310, in save
fig = self._doPlot()
File "/usr/local/lib/python2.7/dist-packages/boomslang/PlotLayout.py", line 283, in _doPlot
if _check_min_matplotlib_version(1, 1, 0):
File "/usr/local/lib/python2.7/dist-packages/boomslang/Utils.py", line 196, in _check_min_matplotlib_version
for x in matplotlib.__version__.split('.')]
File "/usr/local/lib/python2.7/dist-packages/boomslang/Utils.py", line 193, in version_piece_to_int
return int(piece)
ValueError: invalid literal for int() with base 10: '1rc'

Thanks.