Module: check_mk
Branch: master
Commit: fc0f1c12c9c1251a27b405eb8fe50df4725d7e50
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc0f1c12c9c125…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 11 09:06:07 2014 +0100
New valuespec for Weekday
---
web/htdocs/valuespec.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3ab26c8..8fdec8b 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -489,6 +489,7 @@ class RegExpUnicode(TextUnicode, RegExp):
class EmailAddress(TextAscii):
def __init__(self, **kwargs):
+ kwargs.setdefault("size", 40)
TextAscii.__init__(self, **kwargs)
self._regex =
re.compile('^[A-Z0-9._%+-]+(a)(localhost|[A-Z0-9.-]+\.[A-Z]{2,4})$'})$', re.I)
self._make_clickable = kwargs.get("make_clickable", False)
@@ -1730,6 +1731,14 @@ weekdays = {
6: _("Sunday"),
}
+class Weekday(DropdownChoice):
+ def __init__(self, **kwargs):
+ choices = weekdays.items()
+ choices.sort()
+ kwargs['choices'] = choices
+ DropdownChoice.__init__(self, **kwargs)
+
+
class RelativeDate(OptionalDropdownChoice):
def __init__(self, **kwargs):
choices = [