From 573b466c3973021fccca745d2e2ce4921d1ba852 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Fri, 19 Dec 2014 11:04:47 +0100 Subject: utils_*: add helpers as utilized in experimental plugins now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- utils_cib.py | 8 ++++++++ utils_xslt.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/utils_cib.py b/utils_cib.py index de2bba1..bf5d3a0 100644 --- a/utils_cib.py +++ b/utils_cib.py @@ -54,3 +54,11 @@ class ResourceSpec(object): ret += ('{0}' .format(self._type)) return ret + + @property + def xsl_attrs_select(self): + ret = "@class='{0}'".format(self._class) + if self._provider is not None: + ret += " and @provider='{0}'".format(self._provider) + ret += " and @type='{0}'".format(self._type) + return ret diff --git a/utils_xslt.py b/utils_xslt.py index 553674d..bf2f14c 100644 --- a/utils_xslt.py +++ b/utils_xslt.py @@ -8,6 +8,9 @@ __author__ = "Jan Pokorný " from .utils_xml import NAMESPACES, XSL +NL = ' ' + + def xslt_identity(particular_selector=''): return '''\