summaryrefslogtreecommitdiffstats
path: root/filter.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-12-05 17:39:50 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-12-08 16:38:13 +0100
commitbe68e46f920f07edd82ac2187d961199ebcbb01c (patch)
tree7414dcc88201e65314cd00ec398708ff40fac147 /filter.py
parentf0524193f40360ad83fcf5c2171997eb6deb312c (diff)
downloadclufter-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.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/filter.py b/filter.py
index 7411b97..6c53bb7 100644
--- a/filter.py
+++ b/filter.py
@@ -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: