|
32 | 32 | histogram='Histogram')
|
33 | 33 |
|
34 | 34 |
|
| 35 | +class ChartManager(PluginManager): |
| 36 | + def __init__(self): |
| 37 | + PluginManager.__init__(self, 'chart') |
| 38 | + |
| 39 | + def get_a_plugin(self, key, **keywords): |
| 40 | + self._logger.debug("get a plugin called") |
| 41 | + plugin = self.load_me_now(key) |
| 42 | + return plugin(key) |
| 43 | + |
| 44 | + def raise_exception(self, key): |
| 45 | + raise Exception("No support for " + key) |
| 46 | + |
| 47 | + |
| 48 | +MANAGER = ChartManager() |
| 49 | + |
| 50 | + |
35 | 51 | class Chart(object):
|
36 | 52 |
|
37 | 53 | def __init__(self, cls_name):
|
@@ -169,22 +185,6 @@ def _render_a_sheet(self, instance, sheet,
|
169 | 185 | instance.add(sheet.name, points)
|
170 | 186 |
|
171 | 187 |
|
172 |
| -class ChartManager(PluginManager): |
173 |
| - def __init__(self): |
174 |
| - PluginManager.__init__(self, 'chart') |
175 |
| - |
176 |
| - def get_a_plugin(self, key, **keywords): |
177 |
| - self._logger.debug("get a plugin called") |
178 |
| - plugin = self.load_me_now(key) |
179 |
| - return plugin(key) |
180 |
| - |
181 |
| - def raise_exception(self, key): |
182 |
| - raise Exception("No support for " + key) |
183 |
| - |
184 |
| - |
185 |
| -MANAGER = ChartManager() |
186 |
| - |
187 |
| - |
188 | 188 | class ChartRenderer(BinaryRenderer):
|
189 | 189 |
|
190 | 190 | def render_sheet(self, sheet, title=DEFAULT_TITLE,
|
|
0 commit comments