Module: check_mk
Branch: master
Commit: be4b54aef9f49b2833aab684cf3c02b655e796b6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be4b54aef9f49b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 9 10:33:35 2016 +0100
htmllib: new helper for getting all variables with some prefix
---
web/htdocs/htmllib.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 26bba1a..4644683 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1204,6 +1204,13 @@ class html(GUITester):
def all_vars(self):
return self.vars
+
+ def all_varnames_with_prefix(self, prefix):
+ for varname, value in self.vars.items():
+ if varname.startswith(prefix):
+ yield varname
+
+
# Return all values of a variable that possible occurs more
# than once in the URL. note: self.listvars does contain those
# variable only, if the really occur more than once.