From 5d7316cb093a4708bbfcb5d61829f6e468b1c9aa Mon Sep 17 00:00:00 2001 From: Sebastian Koslowski <koslowski@kit.edu> Date: Wed, 26 Feb 2014 14:56:32 +0100 Subject: grc: fix error message in console when using qtgui blocks --- grc/python/Param.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'grc/python/Param.py') diff --git a/grc/python/Param.py b/grc/python/Param.py index e603d6cdbe..3daa37f637 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -377,11 +377,17 @@ class Param(_Param, _GUIParam): (False, False): 'self.top_layout.addWidget(%(widget)s)', }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} - def gui_hint(ws, w): - if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') - return ws%w + # FIXME: Move replace(...) into the make template of the qtgui blocks and return a string here + class GuiHint(object): + def __init__(self, ws): + self._ws = ws - return lambda w: gui_hint(widget_str, w) + def __call__(self, w): + return (self._ws.replace('addWidget', 'addLayout') if 'layout' in w else self._ws) % w + + def __str__(self): + return self._ws + return GuiHint(widget_str) ######################### # Grid Position Type ######################### -- cgit v1.2.3