summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grc/core/base.py3
-rw-r--r--grc/core/ports/port.py1
-rw-r--r--grc/gui/VariableEditor.py16
3 files changed, 3 insertions, 17 deletions
diff --git a/grc/core/base.py b/grc/core/base.py
index e92c4f923a..8d9a20aa75 100644
--- a/grc/core/base.py
+++ b/grc/core/base.py
@@ -23,8 +23,6 @@ class Element(object):
Validate this element and call validate on all children.
Call this base method before adding error messages in the subclass.
"""
- del self._error_messages[:]
-
for child in self.children():
child.validate()
@@ -77,6 +75,7 @@ class Element(object):
Rewrite this element and call rewrite on all children.
Call this base method before rewriting the element.
"""
+ del self._error_messages[:]
for child in self.children():
child.rewrite()
diff --git a/grc/core/ports/port.py b/grc/core/ports/port.py
index 36b951717f..ade961e296 100644
--- a/grc/core/ports/port.py
+++ b/grc/core/ports/port.py
@@ -92,6 +92,7 @@ class Port(Element):
return not self.dtype
def validate(self):
+ del self._error_messages[:]
Element.validate(self)
platform = self.parent_platform
diff --git a/grc/gui/VariableEditor.py b/grc/gui/VariableEditor.py
index d815e5ddd1..afffc22008 100644
--- a/grc/gui/VariableEditor.py
+++ b/grc/gui/VariableEditor.py
@@ -180,21 +180,7 @@ class VariableEditor(Gtk.VBox):
else:
# Evaluate and show the value (if it is a variable)
if block.is_variable:
- # Evaluate the params
- for key in block.params:
- evaluated = str(block.params[key].evaluate())
- # ensure that evaluated is a UTF-8 string
- # Old PMTs could produce non-UTF-8 strings
- evaluated = evaluated.encode('utf-8', 'backslashreplace').decode('utf-8')
- self.set_tooltip_text(evaluated)
-
- # Evaluate the block value
- try:
- evaluated = str(eval(block.value, block.parent.namespace, block.namespace))
- self.set_tooltip_text(evaluated)
- except Exception as error:
- self.set_tooltip_text(str(error))
- pass
+ value = str(block.evaluate(block.value))
# Always set the text value.
sp('text', value)