diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-12-05 17:39:50 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-12-08 16:38:13 +0100 |
commit | be68e46f920f07edd82ac2187d961199ebcbb01c (patch) | |
tree | 7414dcc88201e65314cd00ec398708ff40fac147 /filter.py | |
parent | f0524193f40360ad83fcf5c2171997eb6deb312c (diff) | |
download | clufter-be68e46f920f07edd82ac2187d961199ebcbb01c.tar.gz clufter-be68e46f920f07edd82ac2187d961199ebcbb01c.tar.xz clufter-be68e46f920f07edd82ac2187d961199ebcbb01c.zip |
filter{,s/*}: simplify declaration of default xslt filter
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'filter.py')
-rw-r--r-- | filter.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -900,6 +900,16 @@ class XMLFilter(Filter, MetaPlugin): return self.filter_proceed_xslt(in_obj, **kwargs) @classmethod + def deco_xslt(cls, in_format, out_format, **kwargs): + def deco_cls(new_cls): + fnc = lambda ctxt, in_obj: \ + ('etree', ctxt.ctxt_proceed_xslt(in_obj, **kwargs)) + fnc.__name__ = new_cls.__name__ + fnc.__module__ = new_cls.__module__ + return cls.deco(in_format, out_format)(fnc) + return deco_cls + + @classmethod def get_template(cls, in_obj, root_dir=None, **kwargs): """Generate the overall XSLT template""" if not root_dir: |