1234567891011121314151617181920 |
- # -*- coding: utf-8 -*-
-
-
- class GmonPluginError(Exception):
- pass
-
-
- class BasePlugin(object):
-
- def __init__(self, data):
- self.data = data
-
- def render(self):
- method_n = "render_" + self.data.fmt
-
- def ex(__):
- raise GmonPluginError("method not defined: " + method_n)
-
- render_fn = getattr(self, method_n, ex)
- return render_fn()
|