Browse Source

Fix table import

pull/130/head
Florian Mounier 11 years ago
parent
commit
c881ad7850
  1. 2
      CHANGELOG
  2. 3
      pygal/ghost.py
  3. 2
      tox.ini

2
CHANGELOG

@ -2,7 +2,7 @@ V 1.5.0 UNRELEASED
Add per serie configuration Add per serie configuration
Add half pie (thanks philt2001) Add half pie (thanks philt2001)
Add render_table (WIP) Add render_table (WIP)
Make lxml an optionnal dependency Make lxml an optionnal dependency (huge speed boost in pypy)
V 1.4.6 V 1.4.6
Add support for \n separated multiline titles (thanks sirlark) Add support for \n separated multiline titles (thanks sirlark)

3
pygal/ghost.py

@ -30,7 +30,6 @@ from pygal._compat import u, is_list_like
from pygal.graph import CHARTS_NAMES from pygal.graph import CHARTS_NAMES
from pygal.config import Config, CONFIG_ITEMS from pygal.config import Config, CONFIG_ITEMS
from pygal.util import prepare_values from pygal.util import prepare_values
from pygal.table import Table
from uuid import uuid4 from uuid import uuid4
@ -115,6 +114,8 @@ class Ghost(object):
return self.make_instance().render_tree() return self.make_instance().render_tree()
def render_table(self, **kwargs): def render_table(self, **kwargs):
# Import here to avoid lxml import
from pygal.table import Table
real_cls, self.cls = self.cls, Table real_cls, self.cls = self.cls, Table
rv = self.make_instance().render(**kwargs) rv = self.make_instance().render(**kwargs)
self.cls = real_cls self.cls = real_cls

2
tox.ini

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py26,py27,py32,py33,py34 envlist = py26,py27,py32,py33,py34,pypy
[testenv] [testenv]
sitepackages=True sitepackages=True

Loading…
Cancel
Save