From 15e136bd4a71a4eea3c145ff97e1070f75e60943 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Thu, 13 Sep 2012 12:15:48 +0200 Subject: [PATCH] Fix tests by re using __value__ --- pygal/ghost.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygal/ghost.py b/pygal/ghost.py index ea746d0..3660a5a 100644 --- a/pygal/ghost.py +++ b/pygal/ghost.py @@ -40,6 +40,8 @@ class Ghost(object): def __init__(self, config=None, **kwargs): """Init config""" + name = self.__class__.__name__ + self.cls = REAL_CHARTS[name] if config and type(config) == type: config = config() @@ -55,13 +57,11 @@ class Ghost(object): def add(self, title, values): """Add a serie to this graph""" self.series.append( - Serie(title, values, len(self.series), Value)) + Serie(title, values, len(self.series), self.cls.__value__)) def make_instance(self): self.config(**self.__dict__) - name = self.__class__.__name__ - cls = REAL_CHARTS[name] - self._last__inst = cls(self.config, self.series) + self._last__inst = self.cls(self.config, self.series) return self._last__inst # Rendering