summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
Diffstat (limited to 'grc')
-rw-r--r--grc/blocks/variable_check_box.xml8
-rw-r--r--grc/blocks/variable_chooser.xml8
-rw-r--r--grc/blocks/variable_config.xml8
-rw-r--r--grc/blocks/variable_slider.xml8
-rw-r--r--grc/blocks/variable_static_text.xml8
-rw-r--r--grc/blocks/variable_text_box.xml8
6 files changed, 25 insertions, 23 deletions
diff --git a/grc/blocks/variable_check_box.xml b/grc/blocks/variable_check_box.xml
index 59ace503b..7054ca1eb 100644
--- a/grc/blocks/variable_check_box.xml
+++ b/grc/blocks/variable_check_box.xml
@@ -10,7 +10,7 @@
<key>variable_check_box</key>
<import>from gnuradio.wxgui import forms</import>
<var_make>self.$(id) = $(id) = $value</var_make>
- <make>self.$(id)_check_box = forms.check_box(
+ <make>self._$(id)_check_box = forms.check_box(
parent=self.GetWin(),
value=self.$id,
callback=self.set_$(id),
@@ -24,12 +24,12 @@
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self.$(id)_check_box)
+self.Add(self._$(id)_check_box)
#else
-self.GridAdd(self.$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self._$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<callback>self.set_$(id)($value)</callback>
- <callback>self.$(id)_check_box.set_value($id)</callback>
+ <callback>self._$(id)_check_box.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_chooser.xml b/grc/blocks/variable_chooser.xml
index 2f0e9bbf3..2bf199872 100644
--- a/grc/blocks/variable_chooser.xml
+++ b/grc/blocks/variable_chooser.xml
@@ -11,7 +11,7 @@
<key>variable_chooser</key>
<import>from gnuradio.wxgui import forms</import>
<var_make>self.$(id) = $(id) = $value</var_make>
- <make>self.$(id)_chooser = forms.$(type)(
+ <make>self._$(id)_chooser = forms.$(type)(
parent=self.GetWin(),
value=self.$id,
callback=self.set_$(id),
@@ -28,12 +28,12 @@
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self.$(id)_chooser)
+self.Add(self._$(id)_chooser)
#else
-self.GridAdd(self.$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self._$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<callback>self.set_$(id)($value)</callback>
- <callback>self.$(id)_chooser.set_value($id)</callback>
+ <callback>self._$(id)_chooser.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_config.xml b/grc/blocks/variable_config.xml
index f62a3def1..1c815c347 100644
--- a/grc/blocks/variable_config.xml
+++ b/grc/blocks/variable_config.xml
@@ -11,14 +11,16 @@
<import>import ConfigParser</import>
<var_make>self._$(id)_config = ConfigParser.ConfigParser()
self._$(id)_config.read($config_file)
-if not self._$(id)_config.has_section($section):
- self._$(id)_config.add_section($section)
try: $(id) = self._$(id)_config.$(type.get)($section, $option)
except: $(id) = $value
self.$(id) = $(id)</var_make>
<make></make>
<callback>self.set_$(id)($value)</callback>
- <callback>self._$(id)_config.set($section, $option, str($writeback))
+ <callback>self._$(id)_config = ConfigParser.ConfigParser()
+self._$(id)_config.read($config_file)
+if not self._$(id)_config.has_section($section):
+ self._$(id)_config.add_section($section)
+self._$(id)_config.set($section, $option, str($writeback))
self._$(id)_config.write(open($config_file, 'w'))</callback>
<param>
<name>Default Value</name>
diff --git a/grc/blocks/variable_slider.xml b/grc/blocks/variable_slider.xml
index 6a7c400ea..875ae74af 100644
--- a/grc/blocks/variable_slider.xml
+++ b/grc/blocks/variable_slider.xml
@@ -11,7 +11,7 @@
<import>from gnuradio.wxgui import forms</import>
<var_make>self.$(id) = $(id) = $value</var_make>
<make>_$(id)_sizer = wx.BoxSizer(wx.VERTICAL)
-self.$(id)_text_box = forms.text_box(
+self._$(id)_text_box = forms.text_box(
parent=self.GetWin(),
sizer=_$(id)_sizer,
value=self.$id,
@@ -24,7 +24,7 @@ self.$(id)_text_box = forms.text_box(
converter=forms.$(converver)(),
proportion=0,
)
-self.$(id)_slider = forms.slider(
+self._$(id)_slider = forms.slider(
parent=self.GetWin(),
sizer=_$(id)_sizer,
value=self.$id,
@@ -43,8 +43,8 @@ self.Add(_$(id)_sizer)
self.GridAdd(_$(id)_sizer, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<callback>self.set_$(id)($value)</callback>
- <callback>self.$(id)_slider.set_value($id)</callback>
- <callback>self.$(id)_text_box.set_value($id)</callback>
+ <callback>self._$(id)_slider.set_value($id)</callback>
+ <callback>self._$(id)_text_box.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_static_text.xml b/grc/blocks/variable_static_text.xml
index 0179eb6e3..4be80a9bb 100644
--- a/grc/blocks/variable_static_text.xml
+++ b/grc/blocks/variable_static_text.xml
@@ -10,7 +10,7 @@
<key>variable_static_text</key>
<import>from gnuradio.wxgui import forms</import>
<var_make>self.$(id) = $(id) = $value</var_make>
- <make>self.$(id)_static_text = forms.static_text(
+ <make>self._$(id)_static_text = forms.static_text(
parent=self.GetWin(),
value=self.$id,
callback=self.set_$(id),
@@ -27,12 +27,12 @@
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self.$(id)_static_text)
+self.Add(self._$(id)_static_text)
#else
-self.GridAdd(self.$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self._$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<callback>self.set_$(id)($value)</callback>
- <callback>self.$(id)_static_text.set_value($id)</callback>
+ <callback>self._$(id)_static_text.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>
diff --git a/grc/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml
index 2bcb680f2..65d491ba0 100644
--- a/grc/blocks/variable_text_box.xml
+++ b/grc/blocks/variable_text_box.xml
@@ -10,7 +10,7 @@
<key>variable_text_box</key>
<import>from gnuradio.wxgui import forms</import>
<var_make>self.$(id) = $(id) = $value</var_make>
- <make>self.$(id)_text_box = forms.text_box(
+ <make>self._$(id)_text_box = forms.text_box(
parent=self.GetWin(),
value=self.$id,
callback=self.set_$(id),
@@ -27,12 +27,12 @@
)
#set $grid_pos = $grid_pos()
#if not grid_pos
-self.Add(self.$(id)_text_box)
+self.Add(self._$(id)_text_box)
#else
-self.GridAdd(self.$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+self.GridAdd(self._$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<callback>self.set_$(id)($value)</callback>
- <callback>self.$(id)_text_box.set_value($id)</callback>
+ <callback>self._$(id)_text_box.set_value($id)</callback>
<param>
<name>Label</name>
<key>label</key>