f



Exception running GNU module "op25_grc.py" : AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

I am using using ubuntu 12.10 i am trying to run a python block, namely OP2=
5, in GNU Radio Companion v3.6.3-35-g4435082f, which uses python version 2.=
7.3 for some reason although python3.2 is in the lib folder. I run the foll=
owing trace command in terminal:

~$ python -m trace --count -C . op25_grc.py

Here is the output with an error:

Imported legacy fsk4
 Using Volk machine: ssse3_32
 Traceback (most recent call last):
 File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
 "_main__", fname, loader, pkg_name)
 File "/usr/lib/python2.7/runpy.py", line 72, in run_code
 exec code in run_globals
 File "/usr/lib/python2.7/trace.py", line 819, in
 main()
 File "/usr/lib/python2.7/trace.py", line 807, in main
 t.runctx(code, globs, globs)
 File "/usr/lib/python2.7/trace.py", line 513, in runctx
 exec cmd in globals, locals
 File "op25_grc.py", line 493, in
 tb =3D op25_grc()
 File "op25_grc.py", line 231, in __init_
 self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)
 File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", =
line 54, in getattr
 return getattr(self._hb, name)
 AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callbac=
k'

The code for "op25_grc.py":

#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Op25 Grc
# Generated: Wed Feb 13 19:37:41 2013
##################################################

from baz import message_callback
from baz import op25
from gnuradio import audio
from gnuradio import blks2
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import window
from gnuradio.eng_option import eng_option
from gnuradio.gr import firdes
from gnuradio.wxgui import fftsink2
from gnuradio.wxgui import forms
from gnuradio.wxgui import scopesink2
from gnuradio.wxgui import waterfallsink2
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import ConfigParser
import math
import wx

class op25_grc(grc_wxgui.top_block_gui):

	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title=3D"Op25 Grc")
		_icon_path =3D "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
		self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

		##################################################
		# Variables
		##################################################
		self._config_freq_config =3D ConfigParser.ConfigParser()
		self._config_freq_config.read(".grc_op25")
		try: config_freq =3D self._config_freq_config.getfloat("main", "freq")
		except: config_freq =3D 434075000
		self.config_freq =3D config_freq
		self.freq =3D freq =3D config_freq
		self._config_xlate_offset_config =3D ConfigParser.ConfigParser()
		self._config_xlate_offset_config.read(".grc_op25")
		try: config_xlate_offset =3D self._config_xlate_offset_config.getfloat("m=
ain", "xlate_offset")
		except: config_xlate_offset =3D 0
		self.config_xlate_offset =3D config_xlate_offset
		self.click_freq =3D click_freq =3D freq-config_xlate_offset
		self.xlate_offset_fine =3D xlate_offset_fine =3D 0
		self.xlate_offset =3D xlate_offset =3D freq-click_freq
		self.samp_rate =3D samp_rate =3D 48000
		self.samp_per_sym =3D samp_per_sym =3D 5+1
		self.decim =3D decim =3D 20
		self._config_xlate_bandwidth_config =3D ConfigParser.ConfigParser()
		self._config_xlate_bandwidth_config.read(".grc_rtl")
		try: config_xlate_bandwidth =3D self._config_xlate_bandwidth_config.getfl=
oat("main", "xlate_bandwidth")
		except: config_xlate_bandwidth =3D 24000
		self.config_xlate_bandwidth =3D config_xlate_bandwidth
		self.auto_tune_offset =3D auto_tune_offset =3D 0
		self.xlate_bandwidth =3D xlate_bandwidth =3D config_xlate_bandwidth
		self.variable_static_text_0 =3D variable_static_text_0 =3D freq+xlate_off=
set+xlate_offset_fine+auto_tune_offset
		self.pre_channel_rate =3D pre_channel_rate =3D samp_rate/decim
		self.gain =3D gain =3D 20
		self.fine_click_freq =3D fine_click_freq =3D 0
		self.channel_rate =3D channel_rate =3D op25.SYMBOL_RATE*samp_per_sym
		self.auto_tune_offset_freq =3D auto_tune_offset_freq =3D auto_tune_offset=
*op25.SYMBOL_DEVIATION
		self.audio_mul =3D audio_mul =3D 2

		##################################################
		# Message Queues
		##################################################
		op25_decoder_0_msgq_out =3D baz_message_callback_0_msgq_in =3D gr.msg_que=
ue(2)

		##################################################
		# Blocks
		##################################################
		_xlate_offset_fine_sizer =3D wx.BoxSizer(wx.VERTICAL)
		self._xlate_offset_fine_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			sizer=3D_xlate_offset_fine_sizer,
			value=3Dself.xlate_offset_fine,
			callback=3Dself.set_xlate_offset_fine,
			label=3D"Fine Offset",
			converter=3Dforms.float_converter(),
			proportion=3D0,
		)
		self._xlate_offset_fine_slider =3D forms.slider(
			parent=3Dself.GetWin(),
			sizer=3D_xlate_offset_fine_sizer,
			value=3Dself.xlate_offset_fine,
			callback=3Dself.set_xlate_offset_fine,
			minimum=3D-10000,
			maximum=3D10000,
			num_steps=3D1000,
			style=3Dwx.SL_HORIZONTAL,
			cast=3Dfloat,
			proportion=3D1,
		)
		self.Add(_xlate_offset_fine_sizer)
		self._xlate_offset_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			value=3Dself.xlate_offset,
			callback=3Dself.set_xlate_offset,
			label=3D"Xlate Offset",
			converter=3Dforms.float_converter(),
		)
		self.Add(self._xlate_offset_text_box)
		_xlate_bandwidth_sizer =3D wx.BoxSizer(wx.VERTICAL)
		self._xlate_bandwidth_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			sizer=3D_xlate_bandwidth_sizer,
			value=3Dself.xlate_bandwidth,
			callback=3Dself.set_xlate_bandwidth,
			label=3D"Xlate BW",
			converter=3Dforms.float_converter(),
			proportion=3D0,
		)
		self._xlate_bandwidth_slider =3D forms.slider(
			parent=3Dself.GetWin(),
			sizer=3D_xlate_bandwidth_sizer,
			value=3Dself.xlate_bandwidth,
			callback=3Dself.set_xlate_bandwidth,
			minimum=3D5000,
			maximum=3D50000,
			num_steps=3D1000,
			style=3Dwx.SL_HORIZONTAL,
			cast=3Dfloat,
			proportion=3D1,
		)
		self.Add(_xlate_bandwidth_sizer)
		self.nb =3D self.nb =3D wx.Notebook(self.GetWin(), style=3Dwx.NB_TOP)
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "BB-1")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "BB-2")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Xlate-1")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Xlate-2")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "4FSK")
		self.nb.AddPage(grc_wxgui.Panel(self.nb), "Dibits")
		self.Add(self.nb)
		self._auto_tune_offset_freq_static_text =3D forms.static_text(
			parent=3Dself.GetWin(),
			value=3Dself.auto_tune_offset_freq,
			callback=3Dself.set_auto_tune_offset_freq,
			label=3D"Auto tune",
			converter=3Dforms.float_converter(),
		)
		self.Add(self._auto_tune_offset_freq_static_text)
		_audio_mul_sizer =3D wx.BoxSizer(wx.VERTICAL)
		self._audio_mul_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			sizer=3D_audio_mul_sizer,
			value=3Dself.audio_mul,
			callback=3Dself.set_audio_mul,
			label=3D"Audio mul",
			converter=3Dforms.float_converter(),
			proportion=3D0,
		)
		self._audio_mul_slider =3D forms.slider(
			parent=3Dself.GetWin(),
			sizer=3D_audio_mul_sizer,
			value=3Dself.audio_mul,
			callback=3Dself.set_audio_mul,
			minimum=3D0,
			maximum=3D10,
			num_steps=3D100,
			style=3Dwx.SL_HORIZONTAL,
			cast=3Dfloat,
			proportion=3D1,
		)
		self.Add(_audio_mul_sizer)
		self.wxgui_waterfallsink2_0_0 =3D waterfallsink2.waterfall_sink_c(
			self.nb.GetPage(3).GetWin(),
			baseband_freq=3D0,
			dynamic_range=3D100,
			ref_level=3D50,
			ref_scale=3D2.0,
			sample_rate=3Dchannel_rate,
			fft_size=3D512,
			fft_rate=3D15,
			average=3DFalse,
			avg_alpha=3DNone,
			title=3D"Waterfall Plot",
		)
		self.nb.GetPage(3).Add(self.wxgui_waterfallsink2_0_0.win)
		self.wxgui_scopesink2_1 =3D scopesink2.scope_sink_f(
			self.nb.GetPage(4).GetWin(),
			title=3D"Scope Plot",
			sample_rate=3Dchannel_rate,
			v_scale=3D1.5,
			v_offset=3D0,
			t_scale=3D0.05,
			ac_couple=3DFalse,
			xy_mode=3DFalse,
			num_inputs=3D1,
			trig_mode=3Dgr.gr_TRIG_MODE_AUTO,
			y_axis_label=3D"Counts",
		)
		self.nb.GetPage(4).Add(self.wxgui_scopesink2_1.win)
		self.wxgui_scopesink2_0 =3D scopesink2.scope_sink_f(
			self.nb.GetPage(5).GetWin(),
			title=3D"Scope Plot",
			sample_rate=3Dop25.SYMBOL_RATE,
			v_scale=3D1,
			v_offset=3D0,
			t_scale=3D0.05,
			ac_couple=3DFalse,
			xy_mode=3DFalse,
			num_inputs=3D1,
			trig_mode=3Dgr.gr_TRIG_MODE_AUTO,
			y_axis_label=3D"Counts",
		)
		self.nb.GetPage(5).Add(self.wxgui_scopesink2_0.win)
		self.wxgui_fftsink2_0_0 =3D fftsink2.fft_sink_c(
			self.nb.GetPage(2).GetWin(),
			baseband_freq=3Dfine_click_freq,
			y_per_div=3D10,
			y_divs=3D10,
			ref_level=3D0,
			ref_scale=3D2.0,
			sample_rate=3Dchannel_rate,
			fft_size=3D1024,
			fft_rate=3D30,
			average=3DTrue,
			avg_alpha=3DNone,
			title=3D"FFT Plot",
			peak_hold=3DFalse,
		)
		self.nb.GetPage(2).Add(self.wxgui_fftsink2_0_0.win)
		def wxgui_fftsink2_0_0_callback(x, y):
			self.set_fine_click_freq(x)
	=09
		self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)
		self._variable_static_text_0_static_text =3D forms.static_text(
			parent=3Dself.GetWin(),
			value=3Dself.variable_static_text_0,
			callback=3Dself.set_variable_static_text_0,
			label=3D"Final freq",
			converter=3Dforms.float_converter(),
		)
		self.Add(self._variable_static_text_0_static_text)
		self.op25_decoder_0 =3D op25.op25_decoder(channel_rate=3Dchannel_rate, de=
fer_creation=3DTrue, output_dibits=3DTrue, key=3D"")
		self.op25_decoder_0.auto_tune_msgq =3D op25_decoder_0_msgq_out
		self.op25_decoder_0.create()
		self.gr_quadrature_demod_cf_0 =3D gr.quadrature_demod_cf((channel_rate/(2=
..0 * math.pi * op25.SYMBOL_DEVIATION)))
		self.gr_multiply_const_vxx_0 =3D gr.multiply_const_vff((audio_mul, ))
		self.gr_freq_xlating_fir_filter_xxx_0 =3D gr.freq_xlating_fir_filter_fcf(=
decim, (firdes.low_pass(1, samp_rate, xlate_bandwidth/2, 1000)), xlate_offs=
et+xlate_offset_fine-fine_click_freq-auto_tune_offset_freq, samp_rate)
		self.gr_fir_filter_xxx_0 =3D gr.fir_filter_fff(1, ((1.0/samp_per_sym,)*sa=
mp_per_sym))
		_gain_sizer =3D wx.BoxSizer(wx.VERTICAL)
		self._gain_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			sizer=3D_gain_sizer,
			value=3Dself.gain,
			callback=3Dself.set_gain,
			label=3D"Gain",
			converter=3Dforms.float_converter(),
			proportion=3D0,
		)
		self._gain_slider =3D forms.slider(
			parent=3Dself.GetWin(),
			sizer=3D_gain_sizer,
			value=3Dself.gain,
			callback=3Dself.set_gain,
			minimum=3D0,
			maximum=3D50,
			num_steps=3D100,
			style=3Dwx.SL_HORIZONTAL,
			cast=3Dfloat,
			proportion=3D1,
		)
		self.Add(_gain_sizer)
		self._freq_text_box =3D forms.text_box(
			parent=3Dself.GetWin(),
			value=3Dself.freq,
			callback=3Dself.set_freq,
			label=3D"Frequency",
			converter=3Dforms.float_converter(),
		)
		self.Add(self._freq_text_box)
		self.blks2_rational_resampler_xxx_1 =3D blks2.rational_resampler_ccc(
			interpolation=3Dchannel_rate,
			decimation=3Dpre_channel_rate,
			taps=3DNone,
			fractional_bw=3DNone,
		)
		self.blks2_rational_resampler_xxx_0 =3D blks2.rational_resampler_fff(
			interpolation=3D44100,
			decimation=3D8000,
			taps=3DNone,
			fractional_bw=3DNone,
		)
		self.baz_message_callback_0 =3D message_callback.message_callback(msgq=3D=
baz_message_callback_0_msgq_in,  callback=3Dauto_tune_offset
			, msg_part=3D"arg1", custom_parts=3D"", dummy=3DFalse)
		=09
		self.audio_source_0 =3D audio.source(samp_rate, "plughw:0,0", True)
		self.audio_sink_0 =3D audio.sink(44100, "", True)

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rati=
onal_resampler_xxx_1, 0))
		self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.wxgui_fftsin=
k2_0_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.wxgui_waterf=
allsink2_0_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.gr_quadratur=
e_demod_cf_0, 0))
		self.connect((self.gr_quadrature_demod_cf_0, 0), (self.gr_fir_filter_xxx_=
0, 0))
		self.connect((self.gr_fir_filter_xxx_0, 0), (self.op25_decoder_0, 0))
		self.connect((self.blks2_rational_resampler_xxx_0, 0), (self.gr_multiply_=
const_vxx_0, 0))
		self.connect((self.gr_multiply_const_vxx_0, 0), (self.audio_sink_0, 0))
		self.connect((self.op25_decoder_0, 1), (self.wxgui_scopesink2_0, 0))
		self.connect((self.gr_fir_filter_xxx_0, 0), (self.wxgui_scopesink2_1, 0))
		self.connect((self.op25_decoder_0, 0), (self.blks2_rational_resampler_xxx=
_0, 0))
		self.connect((self.audio_source_0, 0), (self.gr_freq_xlating_fir_filter_x=
xx_0, 0))


	def get_config_freq(self):
		return self.config_freq

	def set_config_freq(self, config_freq):
		self.config_freq =3D config_freq
		self.set_freq(self.config_freq)

	def get_freq(self):
		return self.freq

	def set_freq(self, freq):
		self.freq =3D freq
		self._config_freq_config =3D ConfigParser.ConfigParser()
		self._config_freq_config.read(".grc_op25")
		if not self._config_freq_config.has_section("main"):
			self._config_freq_config.add_section("main")
		self._config_freq_config.set("main", "freq", str(self.freq))
		self._config_freq_config.write(open(".grc_op25", 'w'))
		self.set_variable_static_text_0(self.freq+self.xlate_offset+self.xlate_of=
fset_fine+self.auto_tune_offset)
		self._freq_text_box.set_value(self.freq)
		self.set_xlate_offset(self.freq-self.click_freq)
		self.set_click_freq(self.freq-self.config_xlate_offset)

	def get_config_xlate_offset(self):
		return self.config_xlate_offset

	def set_config_xlate_offset(self, config_xlate_offset):
		self.config_xlate_offset =3D config_xlate_offset
		self.set_click_freq(self.freq-self.config_xlate_offset)

	def get_click_freq(self):
		return self.click_freq

	def set_click_freq(self, click_freq):
		self.click_freq =3D click_freq
		self.set_xlate_offset(self.freq-self.click_freq)

	def get_xlate_offset_fine(self):
		return self.xlate_offset_fine

	def set_xlate_offset_fine(self, xlate_offset_fine):
		self.xlate_offset_fine =3D xlate_offset_fine
		self._config_xlate_offset_config =3D ConfigParser.ConfigParser()
		self._config_xlate_offset_config.read(".grc_op25")
		if not self._config_xlate_offset_config.has_section("main"):
			self._config_xlate_offset_config.add_section("main")
		self._config_xlate_offset_config.set("main", "xlate_offset", str(self.xla=
te_offset+self.xlate_offset_fine))
		self._config_xlate_offset_config.write(open(".grc_op25", 'w'))
		self.set_variable_static_text_0(self.freq+self.xlate_offset+self.xlate_of=
fset_fine+self.auto_tune_offset)
		self._xlate_offset_fine_slider.set_value(self.xlate_offset_fine)
		self._xlate_offset_fine_text_box.set_value(self.xlate_offset_fine)
		self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.xlate_offset+s=
elf.xlate_offset_fine-self.fine_click_freq-self.auto_tune_offset_freq)

	def get_xlate_offset(self):
		return self.xlate_offset

	def set_xlate_offset(self, xlate_offset):
		self.xlate_offset =3D xlate_offset
		self._config_xlate_offset_config =3D ConfigParser.ConfigParser()
		self._config_xlate_offset_config.read(".grc_op25")
		if not self._config_xlate_offset_config.has_section("main"):
			self._config_xlate_offset_config.add_section("main")
		self._config_xlate_offset_config.set("main", "xlate_offset", str(self.xla=
te_offset+self.xlate_offset_fine))
		self._config_xlate_offset_config.write(open(".grc_op25", 'w'))
		self.set_variable_static_text_0(self.freq+self.xlate_offset+self.xlate_of=
fset_fine+self.auto_tune_offset)
		self._xlate_offset_text_box.set_value(self.xlate_offset)
		self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.xlate_offset+s=
elf.xlate_offset_fine-self.fine_click_freq-self.auto_tune_offset_freq)

	def get_samp_rate(self):
		return self.samp_rate

	def set_samp_rate(self, samp_rate):
		self.samp_rate =3D samp_rate
		self.set_pre_channel_rate(self.samp_rate/self.decim)
		self.gr_freq_xlating_fir_filter_xxx_0.set_taps((firdes.low_pass(1, self.s=
amp_rate, self.xlate_bandwidth/2, 1000)))

	def get_samp_per_sym(self):
		return self.samp_per_sym

	def set_samp_per_sym(self, samp_per_sym):
		self.samp_per_sym =3D samp_per_sym
		self.set_channel_rate(op25.SYMBOL_RATE*self.samp_per_sym)
		self.gr_fir_filter_xxx_0.set_taps(((1.0/self.samp_per_sym,)*self.samp_per=
_sym))

	def get_decim(self):
		return self.decim

	def set_decim(self, decim):
		self.decim =3D decim
		self.set_pre_channel_rate(self.samp_rate/self.decim)

	def get_config_xlate_bandwidth(self):
		return self.config_xlate_bandwidth

	def set_config_xlate_bandwidth(self, config_xlate_bandwidth):
		self.config_xlate_bandwidth =3D config_xlate_bandwidth
		self.set_xlate_bandwidth(self.config_xlate_bandwidth)

	def get_auto_tune_offset(self):
		return self.auto_tune_offset

	def set_auto_tune_offset(self, auto_tune_offset):
		self.auto_tune_offset =3D auto_tune_offset
		self.set_variable_static_text_0(self.freq+self.xlate_offset+self.xlate_of=
fset_fine+self.auto_tune_offset)
		self.set_auto_tune_offset_freq(self.auto_tune_offset*op25.SYMBOL_DEVIATIO=
N)

	def get_xlate_bandwidth(self):
		return self.xlate_bandwidth

	def set_xlate_bandwidth(self, xlate_bandwidth):
		self.xlate_bandwidth =3D xlate_bandwidth
		self._config_xlate_bandwidth_config =3D ConfigParser.ConfigParser()
		self._config_xlate_bandwidth_config.read(".grc_rtl")
		if not self._config_xlate_bandwidth_config.has_section("main"):
			self._config_xlate_bandwidth_config.add_section("main")
		self._config_xlate_bandwidth_config.set("main", "xlate_bandwidth", str(se=
lf.xlate_bandwidth))
		self._config_xlate_bandwidth_config.write(open(".grc_rtl", 'w'))
		self._xlate_bandwidth_slider.set_value(self.xlate_bandwidth)
		self._xlate_bandwidth_text_box.set_value(self.xlate_bandwidth)
		self.gr_freq_xlating_fir_filter_xxx_0.set_taps((firdes.low_pass(1, self.s=
amp_rate, self.xlate_bandwidth/2, 1000)))

	def get_variable_static_text_0(self):
		return self.variable_static_text_0

	def set_variable_static_text_0(self, variable_static_text_0):
		self.variable_static_text_0 =3D variable_static_text_0
		self._variable_static_text_0_static_text.set_value(self.variable_static_t=
ext_0)

	def get_pre_channel_rate(self):
		return self.pre_channel_rate

	def set_pre_channel_rate(self, pre_channel_rate):
		self.pre_channel_rate =3D pre_channel_rate

	def get_gain(self):
		return self.gain

	def set_gain(self, gain):
		self.gain =3D gain
		self._gain_slider.set_value(self.gain)
		self._gain_text_box.set_value(self.gain)

	def get_fine_click_freq(self):
		return self.fine_click_freq

	def set_fine_click_freq(self, fine_click_freq):
		self.fine_click_freq =3D fine_click_freq
		self.wxgui_fftsink2_0_0.set_baseband_freq(self.fine_click_freq)
		self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.xlate_offset+s=
elf.xlate_offset_fine-self.fine_click_freq-self.auto_tune_offset_freq)

	def get_channel_rate(self):
		return self.channel_rate

	def set_channel_rate(self, channel_rate):
		self.channel_rate =3D channel_rate
		self.wxgui_scopesink2_1.set_sample_rate(self.channel_rate)
		self.gr_quadrature_demod_cf_0.set_gain((self.channel_rate/(2.0 * math.pi =
* op25.SYMBOL_DEVIATION)))
		self.wxgui_fftsink2_0_0.set_sample_rate(self.channel_rate)
		self.wxgui_waterfallsink2_0_0.set_sample_rate(self.channel_rate)

	def get_auto_tune_offset_freq(self):
		return self.auto_tune_offset_freq

	def set_auto_tune_offset_freq(self, auto_tune_offset_freq):
		self.auto_tune_offset_freq =3D auto_tune_offset_freq
		self._auto_tune_offset_freq_static_text.set_value(self.auto_tune_offset_f=
req)
		self.gr_freq_xlating_fir_filter_xxx_0.set_center_freq(self.xlate_offset+s=
elf.xlate_offset_fine-self.fine_click_freq-self.auto_tune_offset_freq)

	def get_audio_mul(self):
		return self.audio_mul

	def set_audio_mul(self, audio_mul):
		self.audio_mul =3D audio_mul
		self._audio_mul_slider.set_value(self.audio_mul)
		self._audio_mul_text_box.set_value(self.audio_mul)
		self.gr_multiply_const_vxx_0.set_k((self.audio_mul, ))

if __name__ =3D=3D '__main__':
	parser =3D OptionParser(option_class=3Deng_option, usage=3D"%prog: [option=
s]")
	(options, args) =3D parser.parse_args()
	tb =3D op25_grc()
	tb.Run(True)


and the code from "hier_block2_.py":

#
# Copyright 2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#

from gnuradio_core import hier_block2_swig
try:
    import pmt
except ImportError:
    from gruel import pmt

#
# This hack forces a 'has-a' relationship to look like an 'is-a' one.
#
# It allows Python classes to subclass this one, while passing through
# method calls to the C++ class shared pointer from SWIG.
#
# It also allows us to intercept method calls if needed
#
class hier_block2(object):
    """
    Python wrapper around the C++ hierarchical block implementation.
    Provides convenience functions and allows proper Python subclassing.
    """

    def __init__(self, name, input_signature, output_signature):
        """
        Create a hierarchical block with a given name and I/O signatures.
        """
	self._hb =3D hier_block2_swig(name, input_signature, output_signature)

    def __getattr__(self, name):
        """
        Pass-through member requests to the C++ object.
        """
        if not hasattr(self, "_hb"):
            raise RuntimeError("hier_block2: invalid state--did you forget =
to call gr.hier_block2.__init__ in a derived class?")
	return getattr(self._hb, name)

    def connect(self, *points):
        """
        Connect two or more block endpoints.  An endpoint is either a (bloc=
k, port)
        tuple or a block instance.  In the latter case, the port number is =
assumed
        to be zero.

        To connect the hierarchical block external inputs or outputs to int=
ernal block
        inputs or outputs, use 'self' in the connect call.

        If multiple arguments are provided, connect will attempt to wire th=
em in series,
        interpreting the endpoints as inputs or outputs as appropriate.
        """

        if len (points) < 1:
            raise ValueError, ("connect requires at least one endpoint; %d =
provided." % (len (points),))
	else:
	    if len(points) =3D=3D 1:
		self._hb.primitive_connect(points[0].to_basic_block())
	    else:
		for i in range (1, len (points)):
        	    self._connect(points[i-1], points[i])

    def _connect(self, src, dst):
        (src_block, src_port) =3D self._coerce_endpoint(src)
        (dst_block, dst_port) =3D self._coerce_endpoint(dst)
        self._hb.primitive_connect(src_block.to_basic_block(), src_port,
                                   dst_block.to_basic_block(), dst_port)

    def _coerce_endpoint(self, endp):
        if hasattr(endp, 'to_basic_block'):
            return (endp, 0)
        else:
            if hasattr(endp, "__getitem__") and len(endp) =3D=3D 2:
                return endp # Assume user put (block, port)
            else:
                raise ValueError("unable to coerce endpoint")

    def disconnect(self, *points):
        """
        Disconnect two endpoints in the flowgraph.

        To disconnect the hierarchical block external inputs or outputs to =
internal block
        inputs or outputs, use 'self' in the connect call.

        If more than two arguments are provided, they are disconnected succ=
essively.
        """

        if len (points) < 1:
            raise ValueError, ("disconnect requires at least one endpoint; =
%d provided." % (len (points),))
        else:
            if len (points) =3D=3D 1:
                self._hb.primitive_disconnect(points[0].to_basic_block())
            else:
                for i in range (1, len (points)):
                    self._disconnect(points[i-1], points[i])

    def _disconnect(self, src, dst):
        (src_block, src_port) =3D self._coerce_endpoint(src)
        (dst_block, dst_port) =3D self._coerce_endpoint(dst)
        self._hb.primitive_disconnect(src_block.to_basic_block(), src_port,
                                      dst_block.to_basic_block(), dst_port)

    def msg_connect(self, src, srcport, dst, dstport):
        self.primitive_msg_connect(src.to_basic_block(), srcport, dst.to_ba=
sic_block(), dstport);

    def msg_disconnect(self, src, srcport, dst, dstport):
        self.primitive_msg_disconnect(src.to_basic_block(), srcport, dst.to=
_basic_block(), dstport);

    def message_port_register_hier_in(self, portname):
        self.primitive_message_port_register_hier_in(pmt.pmt_intern(portnam=
e));

    def message_port_register_hier_out(self, portname):
        self.primitive_message_port_register_hier_out(pmt.pmt_intern(portna=
me));


My goal is to fix the error: AttributeError: "'gr_hier_block2_sptr' object =
has no attribute 'set_callback'" so that the block "op25_grc.py" will run i=
n GNU radio companion. =20

i have been unable to find any sort of solution to this problem anywhere.  =
some have said its a version problem with GNUradio but as i posted above i =
have the latest version.

Any help will be greatly appreciated.  Thank you very much!
0
2/15/2013 7:00:40 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

3 Replies
1892 Views

Similar Articles

[PageSpeed] 56

On 02/15/2013 02:00 PM, matt.doolittle33@gmail.com wrote:
> I am using using ubuntu 12.10 i am trying to run a python block, namely OP25, in GNU Radio Companion v3.6.3-35-g4435082f, which uses python version 2.7.3 for some reason although python3.2 is in the lib folder. I run the following trace command in terminal:
>
> ~$ python -m trace --count -C . op25_grc.py
>
> Here is the output with an error:
>
> Imported legacy fsk4
>   Using Volk machine: ssse3_32
>   Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main
>   "_main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in run_code
>   exec code in run_globals
>   File "/usr/lib/python2.7/trace.py", line 819, in
>   main()
>   File "/usr/lib/python2.7/trace.py", line 807, in main
>   t.runctx(code, globs, globs)
>   File "/usr/lib/python2.7/trace.py", line 513, in runctx
>   exec cmd in globals, locals
>   File "op25_grc.py", line 493, in
>   tb = op25_grc()
>   File "op25_grc.py", line 231, in __init_
>   self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)
>   File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in getattr
>   return getattr(self._hb, name)
>   AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'
>
> The code for "op25_grc.py":
>
> #!/usr/bin/env python
> ##################################################
> # Gnuradio Python Flow Graph
> # Title: Op25 Grc
> # Generated: Wed Feb 13 19:37:41 2013
> ##################################################
>
>    <snip>
>
> and the code from "hier_block2_.py":
>
> #
> # Copyright 2006,2007 Free Software Foundation, Inc.
> #
> # This file is part of GNU Radio
> #
> # GNU Radio is free software; you can redistribute it and/or modify
>
>    <snip>
>
>
> My goal is to fix the error: AttributeError: "'gr_hier_block2_sptr' object has no attribute 'set_callback'" so that the block "op25_grc.py" will run in GNU radio companion.
>
> i have been unable to find any sort of solution to this problem anywhere.  some have said its a version problem with GNUradio but as i posted above i have the latest version.
>
> Any help will be greatly appreciated.  Thank you very much!
>

I'm rather surprised somebody hasn't jumped in by now.  I thought your 
reworded query was quite well done.  One of the source files is pretty 
large, but it's not your code, so that perhaps cannot be helped.  I'm 
not sure why you included the code from hier_block2_.py, as I cannot see 
any reference to it.

I'm surprised at the comment in the first file that said the code was 
generated.  if it was generated by your efforts, perhaps there was 
something wrong with that.

I know nothing about this gnuradio thingie, and you didn't supply a 
website url.  I was wondering if the module is even intended to be run 
standalone, but I suppose the if __name__ == "__main__"  thing is a clue 
that it's supposed to.

I found the mixture of trace lines to confuse the stack trace immensely, 
since the exception doesn't occur in the last source line quoted. 
Somebody better than I had best jump in and help.

The error message referenced class gr_hier_block2_sptr, but I don't see 
where this is defined.  So I'm not sure how to tell whether it does or 
should have a set_callback method.

If nobody else jumps in, I'd suggest finding a forum that supports 
gnuradio, and ask there.


-- 
DaveA
0
davea9629 (629)
2/16/2013 5:24:45 AM
>
> I know nothing about this gnuradio thingie, and you didn't supply a=20
>=20
> website url.  I was wondering if the module is even intended to be run=20
>=20
> standalone, but I suppose the if __name__ =3D=3D "__main__"  thing is a c=
lue=20
>=20
> that it's supposed to.
>=20
>=20
>=20
> I found the mixture of trace lines to confuse the stack trace immensely,=
=20
>=20
> since the exception doesn't occur in the last source line quoted.=20
>=20
> Somebody better than I had best jump in and help.
>=20
>=20
>=20
>=20
> If nobody else jumps in, I'd suggest finding a forum that supports=20
>=20
> gnuradio, and ask there.
>=20
>=20
>=20
>=20
>=20
> --=20
>=20
> DaveA

Thanks Dave, yes, I too am a little surprised as to why nobody cares to sup=
ply a fix, a workaround, or even a hint as why this is going on.  I put the=
 exact same post in the gnu-radio homebrew forum and the moderated closed t=
he thread; I am not sure why because he wouldn't answer me but he closed it=
.. Ive posted this question in so many places with but no luck so far. =20

As a workaround I removed the block "wxgui_fftsink2", as that block is not =
integral to the signal processing.  And that is the goal of "op25_grc.py", =
to decode digital radio signals.  This code block is run in GNU radio compa=
nion (GRC) along with many others in the signal processing path . GRC is a =
GUI where one can manage the code (ie. use a flow graph instead of coding) =
needed to process radio signals with a personal computer; sort of like the =
IDEs people use to create executables.  One can create there own processing=
 blocks or use blocks that others have created. =20

Thanks for your cooperation and patience!   I am going to keep working on t=
his as time allows.
0
2/16/2013 2:56:30 PM
>
> I know nothing about this gnuradio thingie, and you didn't supply a=20
>=20
> website url.  I was wondering if the module is even intended to be run=20
>=20
> standalone, but I suppose the if __name__ =3D=3D "__main__"  thing is a c=
lue=20
>=20
> that it's supposed to.
>=20
>=20
>=20
> I found the mixture of trace lines to confuse the stack trace immensely,=
=20
>=20
> since the exception doesn't occur in the last source line quoted.=20
>=20
> Somebody better than I had best jump in and help.
>=20
>=20
>=20
>=20
> If nobody else jumps in, I'd suggest finding a forum that supports=20
>=20
> gnuradio, and ask there.
>=20
>=20
>=20
>=20
>=20
> --=20
>=20
> DaveA

Thanks Dave, yes, I too am a little surprised as to why nobody cares to sup=
ply a fix, a workaround, or even a hint as why this is going on.  I put the=
 exact same post in the gnu-radio homebrew forum and the moderated closed t=
he thread; I am not sure why because he wouldn't answer me but he closed it=
.. Ive posted this question in so many places with but no luck so far. =20

As a workaround I removed the block "wxgui_fftsink2", as that block is not =
integral to the signal processing.  And that is the goal of "op25_grc.py", =
to decode digital radio signals.  This code block is run in GNU radio compa=
nion (GRC) along with many others in the signal processing path . GRC is a =
GUI where one can manage the code (ie. use a flow graph instead of coding) =
needed to process radio signals with a personal computer; sort of like the =
IDEs people use to create executables.  One can create there own processing=
 blocks or use blocks that others have created. =20

Thanks for your cooperation and patience!   I am going to keep working on t=
his as time allows.
0
2/16/2013 2:56:30 PM
Reply:

Similar Artilces:

AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'
------=_Part_1122770_31157900.1360876583037 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I am using ubuntu 12.10 and python version 2.7.3. i run the following command in terminal: matt@matt-Inspiron-1525:~$ python -m trace --count -C . op25_grc.py Here is the output with an error: Imported legacy fsk4 Using Volk machine: ssse3_32 Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/trace.py", line 819, in <module> main() File "/usr/lib/python2.7/trace.py", line 807, in main t.runctx(code, globs, globs) File "/usr/lib/python2.7/trace.py", line 513, in runctx exec cmd in globals, locals File "op25_grc.py", line 493, in <module> tb = op25_grc() File "op25_grc.py", line 231, in __init__ self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback) File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__ return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' here is the code for "hier_block2_.py": # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radi...

how to make ["a","b",["c","d"],"e"] into ['a', 'b', 'c', 'd', 'e'] ?
--001a11c34e8edbc7c404f6a94bbe Content-Type: text/plain; charset=ISO-8859-1 >>> x=["a","b",["c","d"],"e"] >>> y=x[2] >>> y ['c', 'd'] >>> x.insert(2,y[0]) >>> x ['a', 'b', 'c', ['c', 'd'], 'e'] >>> x.insert(3,y[1]) >>> x ['a', 'b', 'c', 'd', ['c', 'd'], 'e'] >>> del x[4] >>> x ['a', 'b', 'c', 'd', &#...

PyKota, Python: AttributeError: 'module' object has no attribute '_quote'
Hello everyone, I'm new to linux/suse, but I was given the task to install the print accounting software PyKota. Before that I never even touched a linux system, so I don't have any basic knowlegde at all! Up to now I was able to solve all problems with the help of google, but now I'm stuck. My problem: linux-6n5c:/usr/local/bin # pkusers --add john paul Creation... ERROR: PyKota v1.26_official ERROR: pkusers failed ERROR: Traceback (most recent call last): ERROR: File "/usr/local/bin/pkusers", line 442, in <module> ERROR: retco...

weird exception : AttributeError: 'module' object has no attribute 'logException'
I am running a script (summary.py) which is calling the method logException in another module ( pytool). Yesterday, ard 18:50, all of a sudden summary.py was throwing the exception : AttributeError: 'module' object has no attribute 'logException' What I did to fix it was to delete the compiled version of the pytool and run again. And it worked again. I am now trying to understand what happened, working with the network admin to see who modified the direcory where pytool is stored. But do you have any idea of what could have happened? All the imports are working, but no method could be called on the compiled files. Thanks for your help, N. ...

python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'
Hello. Has anybody already meet the problem like this? - AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run scrapy, I get File "/usr/local/lib/python2.7/site-packages/scrapy/selector/factories.py", line 14, in <module> libxml2.HTML_PARSE_NOERROR + \ AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run python -c 'import libxml2; libxml2.HTML_PARSE_RECOVER' I get Traceback (most recent call last): File "<string>", line 1, in <module...

AttributeError: 'module' object has no attribute 'letters'
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in <module> import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in <module> import dynamic, gencache, pythoncom File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 24, in <module> import build File "C:\Python25\lib\site-packages\win32com\client\build.py", line 507, in <module> valid_identifier_chars = string.le...

AttributeError: 'module' object has no attribute 'HTTPSHandler'
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do? ...

AttributeError: 'module' object has no attribute 'fork'
Hi, Code: import os, time def child(pipeout): zzz = 0 while True: time.sleep(zzz) msg = ('Spam %03d' % zzz).encode() os.write(pipeout, msg) zzz = (zzz+1) % 5 def parent(): pipein, pipeout = os.pipe() if os.fork() == 0: child(pipeout) else: while True: line = os.read(pipein, 32) print('Parent %d got [%s] at %s' % (os.getpid(), line, time.time())) parent() Output: Traceback (most recent call last): File "C:/Python34/pipe1.py", line 17, in <module>...

AttributeError: 'module' object has no attribute '__path__'
I am using Jupyter notebooks, with Python 3.4. The error below references t= he Anaconda distribution package. This error occurred quite precipitously (= only 2 minutes before I was able to import the modules). I am using Windows= 7. My path in the console uses Python27. I also have python 34 as well. I = am not sure where to start modifying the path and fear that I will break my= initial setup. I welcome feedback on next steps. --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ...

AttributeError: 'module' object has no attribute 'setdefaulttimeout'
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ################## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in __init__ self.__start_urlhandler__() File "/usr/local/bin/SquidClamAV_Redirector.py", line 454, in __start_urlhandler__ urllib.socket.setdefaulttimeout(self.timeout) AttributeError: 'module' object has no attribute 'setdefaulttimeout' ################# the line that is the problem looks like this: ############# urllib.socket.setdefaulttimeout(self.timeout) ############# from the global sintax: ############## def __start_urlhandler__(self): """ create the urlhandler object """ # set timeout urllib.socket.setdefaulttimeout(self.timeout) self.urlhandler = urllib.URLopener() if self.proxy != {}: self.urlhandler.proxies = self.proxy self.urlhandler.addheaders = [('User-agent', ModuleName + ' ' + str(version))] ############## can you give me a hint with this matter? adrian wrote: > urllib.socket.setdefaulttimeout(self.timeout) > AttributeError: 'module' object has no attribute 'setdef...

AttributeError: 'module' object has no attribute 'urlopen'
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource I have Python 2.3.3 but when i run the above code I get the following error: raceback (most recent call last): File "urllib.py", line 1, in ? import urllib File "/home/shalen/programming/python/tutorials/py/urllib.py", line 2, in ? sock = urllib.urlopen("http://diveintopython.org/") AttributeError: 'module' object has no attribute 'urlopen' Anyone knows how to fix this and why I am getting this error? Thanks Dont ~ ~ ~ ~ __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools dont bother wrote: > import urllib > sock = urllib.urlopen("http://diveintopython.org/") > htmlSource = sock.read() > sock.close() > print htmlSource > > I have Python 2.3.3 but when i run the above code I > get the following error: > > raceback (most recent call last): > File "urllib.py", line 1, in ? > import urllib > File > "/home/shalen/programming/python/tutorials/py/urllib.py", > line 2, in ? > sock = > urllib.urlopen("http://diveintopython.org/") > AttributeError: 'module' object has no attribute > 'urlopen' > This is a name cl...

AttributeError: 'module' object has no attribute 'pack'
Dear List, I have a freshly installed opensuse 11.2 and I am experiencing the following problem with the module "subprocess": sampsa@linux-912g:~> python Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/subprocess.py", line 404, in <module> import p...

AttributeError: ' ' object has no attribute ' '
I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get the this error in terminal: in __init__ self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback) File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__ return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is this attribute missing from exactly and how do i put it where it should be? On Sun, Feb 24, 2013 at 5:22 AM, <matt.doolittle33@gmail.com> wrote: > I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get the this error in terminal: > > in __init__ > self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback) > File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__ > return getattr(self._hb, name) > AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' > > I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is this attribute missing from exactly and how do i put it where it should be? That's what the trac...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked for...

"Select" & "Order By" OK- ''WHERE'' Does'nt Work !
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've reduced my form request to a simple text string entry, instead of my desired optional parameters. As i have been stuck with a single unfathomable glitch for over a year. Basically, if i enter queries such as ; "select * from table" "select * from table order by artist", it works perfectly. However if i introduce the 'where' option, as in "select * from table where ...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

logging: AttributeError: 'module' object has no attribute 'getLogger'
Hi all: Being completely new to Python still (just about a week into it now) I tried to follow the Python 2.6.5 version documemtation aiming at setting up a logger as follows: <code> import logging global gPIBLogger class PIBLogger(object): ''' TODO: classdocs ''' def __init__(self, logFileName): ''' Constructor ''' self.logFileName = logFileName self.logger = logging.getLogger('PIBLogger') self.logger.setLevel(logging.DEBUG) handler = logging.handlers.RotatingFileHandler(self.logFileName, maxBytes=1000000, backupCount=9) self.logger.addHandler(handler) gPIBLogger = self.logger def main(): mylogger = PIBLogger('/tmp/pib.log') gPIBLogger.debug(' Hi ') if __name__ == "__main__": main() </code> When trying to execute main() I get: Traceback (most recent call last): File "/.../src/pib/logging.py", line 37, in <module> main() File "/.../src/pib/logging.py", line 33, in main mylogger = PIBLogger('/tmp/pib.log') File "/...src/pib/logging.py", line 23, in __init__ self.logger = logging.getLogger('PIBLogger') AttributeError: '...

AttributeError: 'Attributes' object has no attribute 'saveFile'
Not sure how to explain, but I'll try my best. I'm making a GUI with wxGlade. The GUI has windows that open when the "Next Page" button is pushed; the button also pickles the information that is input into the frame at the same time. The saveFile name is autocreated based on the data entered by the user in the first frame. Each frame that is created is a new class, e.g. the first frame that opens is "CharInfo", which opens the frame "Attributes". The pickling works for the first frame but doesn't work for the ones after. Apparently the saveFile at...

mini-tutorial needed: 'target=""' attribute for 'A'
What I knew, from back in the days of tab-less browsers: an anchor "tag" of form <A href="WhatHaveYou" target="_blank"> used to open a fresh browser window to display whatever the URI "WhatHaveYou" had on offer. In these days of tabbed browsers, though, there must be two attribute value candidates, one for spawning a new *window*, one for opening a new *tab*, and I'll be sempiternally grateful to whoever teaches me what they are. Cheers, and TIA, -- tlvp -- Avant de repondre, jeter la poubelle, SVP. In article <1gvfvb0tom0wx....

AttributeError: 'module' object has no attribute 'DatagramHandler' (ubuntu-8.10, python 2.5.2)
$ ~/devel/ice/snoip/freespeech$ python Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import logging >>> logging.DatagramHandler Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'DatagramHandler' >>> That is odd since the documentation says there is DatagramHandler for module logging On Mon, Dec 29, 2008 at 4:08 AM, Tz...

AttributeError: 'Or' object has no attribute 'as_independent'
Traceback (most recent call last): File "testcsv.py", line 17, in <module> print(sy.solve([x^2+x+1-t, x^3+x^2-t], x)) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 902, in so lve solution = _solve_system(f, symbols, **flags) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 1434, in _ solve_system i, d = _invert(g, *symbols) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 2422, in _ invert indep, dep = lhs.as_independent(*symbols) AttributeError: 'Or' object has no attribute 'as_independent' Code: import csv as csv import os import numpy as np import sympy as sy #from sympy import solve, Poly, Eq, Function, exp from sympy import * from numpy import * from numpy.linalg import * from sympy.polys.polyfuncs import interpolate from sympy import Function, dsolve, Eq, Derivative, sin, cos from sympy.abc import x f = sy.Function('f') x = sy.Symbol("x") t = sy.Symbol("t") print(sy.solve([x^2+x+1-t, x^3+x^2-t], x)) print(sy.solve((x^2+x+1-t, x^3+x^2-t), x)) On 2/13/2014 4:03 AM, wilsonmonde@gmail.com wrote: > Traceback (most recent call last): > File "testcsv.py", line 17, in <module> > print(sy.solve([x^2+x+1-t, x^3+x^2-t], x)) > File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 902, in so > lve ...

'module' object has no attribute 'ssl'
Hi, I have Red Hat Linux 3.2.3-54 and Python 2.4.3 (the original version downloaded from python.org) and I'm using httplib to make a request to an external server, this is the code I'm using: import httplib https = httplib.HTTPSConnection('216.220.59.211', 7989) https.debuglevel = 1 body = buildXML(data) try: https.request('POST', '/Messenger/XMLMessenger', body) response = https.getresponse() response = response.read() https.close() except: response = None import traceback traceback.print_exc() return response And I get the following...

When I do from lxml import etree I've this error : AttributeError: 'module' object has no attribute 'BytesIO'
Hi, I'm on Ubuntu 8.04.1 I've installed lxml with easy_install lxml command. Now, when I load etree I've this error : $ python Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, in <module> File "lxml.etree.pyx", line 40, in lxml.etree (src/lxml/ lxml.etree.c:119415) AttributeError: 'module&#...

Web resources about - Exception running GNU module "op25_grc.py" : AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' - comp.lang.python

Resources last updated: 3/10/2016 4:35:46 PM