diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-12-19 11:04:47 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-01-09 10:21:18 +0100 |
commit | 573b466c3973021fccca745d2e2ce4921d1ba852 (patch) | |
tree | f9e1d0e78e7c1cbdc8e615bf21fc18913b007420 | |
parent | a12fb1f94171e61b0c93f2dbfaa5b171087f2a52 (diff) | |
download | clufter-573b466c3973021fccca745d2e2ce4921d1ba852.tar.gz clufter-573b466c3973021fccca745d2e2ce4921d1ba852.tar.xz clufter-573b466c3973021fccca745d2e2ce4921d1ba852.zip |
utils_*: add helpers as utilized in experimental plugins now
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | utils_cib.py | 8 | ||||
-rw-r--r-- | utils_xslt.py | 3 |
2 files changed, 11 insertions, 0 deletions
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 += ('<xsl:attribute name="type">{0}</xsl:attribute>' .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ý <jpokorny @at@ Red Hat .dot. com>" from .utils_xml import NAMESPACES, XSL +NL = '
' + + def xslt_identity(particular_selector=''): return '''\ <xsl:template match="{0}@*|{0}node()" |