RegExp valuespecs
Message-ID: <52b0952d.MOJfmLsBfs0aUJ56%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: b1f7a0f421cf9aea39b67e2eb01da5e81ee1723a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1f7a0f421cf9a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 17 19:17:01 2013 +0100
Added cssclass attribute to TextAscii/RegExp valuespecs
---
web/htdocs/valuespec.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index fa02b21..90cb9f8 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -317,6 +317,7 @@ class TextAscii(ValueSpec):
ValueSpec.__init__(self, **kwargs)
self._label = kwargs.get("label")
self._size = kwargs.get("size", 25) # also possible:
"max"
+ self._cssclass = kwargs.get("cssclass", "text")
self._strip = kwargs.get("strip", True)
self._allow_empty = kwargs.get("allow_empty", True)
self._read_only = kwargs.get("read_only")
@@ -342,7 +343,7 @@ class TextAscii(ValueSpec):
html.write(self._label)
html.write(" ")
- html.text_input(varprefix, value, size = self._size, read_only =
self._read_only)
+ html.text_input(varprefix, value, size = self._size, read_only = self._read_only,
cssclass = self._cssclass)
self.render_buttons()
def render_buttons(self):
@@ -414,7 +415,7 @@ class ID(TextAscii):
class RegExp(TextAscii):
def __init__(self, **kwargs):
- TextAscii.__init__(self, attrencode = True, **kwargs)
+ TextAscii.__init__(self, attrencode = True, cssclass = 'text regexp',
**kwargs)
self._mingroups = kwargs.get("mingroups", 0)
self._maxgroups = kwargs.get("maxgroups")