diff options
author | ewxl <elof@wecksell.se> | 2020-04-21 14:45:32 +0200 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-05-03 10:49:12 -0400 |
commit | aa8f15d6408b0a2b70b6a012c53b8cf0bd955b9c (patch) | |
tree | 16204d9aa775026fa2a1bd20a834465b3943ebce | |
parent | 5808314010d533690c7c20c81d7062396e0110f5 (diff) |
grc: add length to tooltip for variable with len
Improving the module grc.gui.canvas.param to add length to tooltip of attributes of a block in grc.
-rw-r--r-- | grc/gui/canvas/param.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/grc/gui/canvas/param.py b/grc/gui/canvas/param.py index 4277bfe665..b612902928 100644 --- a/grc/gui/canvas/param.py +++ b/grc/gui/canvas/param.py @@ -67,7 +67,10 @@ class Param(CoreParam): errors = self.get_error_messages() tooltip_lines = ['Key: ' + self.key, 'Type: ' + self.dtype] if self.is_valid(): - value = str(self.get_evaluated()) + value = self.get_evaluated() + if hasattr(value,"__len__"): + tooltip_lines.append('Length: {}'.format(len(value))) + value = str(value) if len(value) > 100: value = '{}...{}'.format(value[:50], value[-50:]) tooltip_lines.append('Value: ' + value) |