commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/01: grc: fix error message in console wh


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/01: grc: fix error message in console when using qtgui blocks
Date: Wed, 26 Feb 2014 16:19:34 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch maint
in repository gnuradio.

commit 5d7316cb093a4708bbfcb5d61829f6e468b1c9aa
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Feb 26 14:56:32 2014 +0100

    grc: fix error message in console when using qtgui blocks
---
 grc/python/Param.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/grc/python/Param.py b/grc/python/Param.py
index e603d6c..3daa37f 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
         #########################



reply via email to

[Prev in Thread] Current Thread [Next in Thread]