Module: check_mk
Branch: master
Commit: a2640d7404fb0daed022560c357b9fee7389ab75
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a2640d7404fb0d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 30 15:48:55 2016 +0200
Removed unused old "transformation" feature from htmllib
---
web/htdocs/htmllib.py | 14 --------------
web/htdocs/valuespec.py | 7 ++-----
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index d373bff..d430557 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -102,7 +102,6 @@ class html(GUITester):
self.context_buttons_open = False
self.mobile = False
self.buffering = True
- self.transformations = []
self.final_javascript_code = ""
self.auto_id = 0
self.have_help = False
@@ -171,16 +170,6 @@ class html(GUITester):
self.buffering = b
- # TODO: Can this be dropped?
- def push_transformation(self, tf):
- self.transformations.append(tf)
-
-
- # TODO: Can this be dropped?
- def pop_transformation(self):
- del self.transformations[-1]
-
-
# TODO: Can this please be dropped?
def some_id(self):
self.auto_id += 1
@@ -614,9 +603,6 @@ class html(GUITester):
#
def write(self, text):
- for tf in self.transformations:
- text = tf(text)
-
if self.plugged:
self.plugged_text += text
else:
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index ba4520e..d4ddf73 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1030,19 +1030,16 @@ class ListOf(ValueSpec):
# Actual table of currently existing entries
html.write('<table class="valuespec_listof"
id="%s_table">' % varprefix)
- # FIXME: Use plug/unplug mechanism instead of transform / then remove transform
for nr, v in enumerate(value):
- html.push_transformation(lambda x: x.replace(self._magic, str(nr+1)))
html.write('<tr><td class=vlof_buttons>')
html.hidden_field(varprefix + "_indexof_%d" % (nr+1), "",
add_var=True) # reconstruct order after moving stuff
self.del_button(varprefix, nr+1)
if self._movable:
- self.move_button(varprefix, self._magic, "up") # visibility
fixed by javascript
- self.move_button(varprefix, self._magic, "down")
+ self.move_button(varprefix, nr+1, "up") # visibility fixed by
javascript
+ self.move_button(varprefix, nr+1, "down")
html.write("</td><td class=vlof_content>")
self._valuespec.render_input(varprefix + "_%d" % (nr+1), v)
html.write("</td></tr>")
- html.pop_transformation()
html.write("</table>")
html.write("<br>")
html.jsbutton(varprefix + "_add", self._add_label,