<html>
<head>
<style type="text/css">
<!--
nobr { white-space: nowrap }
ol { margin-right-rtl: 50; list-style-type: decimal; margin-bottom: 10; margin-left-ltr: 50; margin-top: 10 }
u { text-decoration: underline }
s { text-decoration: line-through }
p { margin-top: 15 }
dd p { margin-left: 0; margin-bottom: 0; margin-top: 0 }
ol li p { margin-bottom: 0; margin-top: 0 }
address { color: blue; font-style: italic }
i { font-style: italic }
h6 { font-size: xx-small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
h5 { font-size: x-small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
h4 { font-size: small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
h3 { font-size: medium; margin-bottom: 10; font-weight: bold; margin-top: 10 }
dir li p { margin-bottom: 0; margin-top: 0 }
h2 { font-size: large; margin-bottom: 10; font-weight: bold; margin-top: 10 }
b { font-weight: bold }
h1 { font-size: x-large; margin-bottom: 10; font-weight: bold; margin-top: 10 }
caption { caption-side: top; text-align: center }
a { text-decoration: underline; color: blue }
ul li ul li ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
menu { margin-right-rtl: 40; margin-bottom: 10; margin-left-ltr: 40; margin-top: 10 }
menu li p { margin-bottom: 0; margin-top: 0 }
sup { vertical-align: sup }
body { font-family: Serif; font-size: 14pt; margin-left: 0; margin-right: 0; font-weight: normal; color: black }
ul li ul li ul { margin-right-rtl: 25; list-style-type: square; margin-left-ltr: 25 }
blockquote { margin-left: 35; margin-right: 35; margin-bottom: 5; margin-top: 5 }
samp { font-family: Monospaced; font-size: small }
cite { font-style: italic }
sub { vertical-align: sub }
em { font-style: italic }
ul li p { margin-bottom: 0; margin-top: 0 }
ul li ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
var { font-weight: bold; font-style: italic }
table { border-color: Gray; border-style: outset }
dfn { font-style: italic }
menu li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
strong { font-weight: bold }
ul { margin-right-rtl: 50; list-style-type: disc; margin-bottom: 10; margin-left-ltr: 50; margin-top: 10 }
center { text-align: center }
ul li ul { margin-right-rtl: 25; list-style-type: circle; margin-left-ltr: 25 }
kbd { font-family: Monospaced; font-size: small }
dir li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
ul li menu { margin-right-rtl: 25; list-style-type: circle; margin-left-ltr: 25 }
dt { margin-bottom: 0; margin-top: 0 }
ol li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
li p { margin-bottom: 0; margin-top: 0 }
strike { text-decoration: line-through }
dl { margin-left: 0; margin-bottom: 10; margin-top: 10 }
tt { font-family: Monospaced }
ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
dir { margin-right-rtl: 40; margin-bottom: 10; margin-left-ltr: 40; margin-top: 10 }
tr { text-align: left }
pre p { margin-top: 0 }
dd { margin-right-rtl: 40; margin-bottom: 0; margin-left-ltr: 40; margin-top: 0 }
th { border-color: Gray; padding-bottom: 3; font-weight: bold; padding-left: 3; border-style: inset; padding-right: 3; text-align: center; padding-top: 3 }
pre { font-family: Monospaced; margin-bottom: 5; margin-top: 5 }
td { border-color: Gray; padding-bottom: 3; padding-left: 3; border-style: inset; padding-right: 3; padding-top: 3 }
td p { margin-top: 0 }
code { font-family: Monospaced; font-size: small }
small { font-size: x-small }
big { font-size: x-large }
-->
</style>
</head>
<body>
<div>
<p>
I am using ubuntu 12.10 and python version 2.7.3. i run the following
command in terminal:<br><br><b>matt@matt-Inspiron-1525:~$ python -m
trace --count -C . op25_grc.py</b><br><br>Here is the output with an
error:<br><br><b>Imported legacy fsk4<br>Using Volk machine: ssse3_32<br>Traceback
(most recent call last):<br>File "/usr/lib/python2.7/runpy.py", line
162, in _run_module_as_main<br>"__main__", fname, loader, pkg_name)<br>File
"/usr/lib/python2.7/runpy.py", line 72, in _run_code<br>exec
code in run_globals<br>File "/usr/lib/python2.7/trace.py", line 819,
in <module><br>main()<br>File "/usr/lib/python2.7/trace.py",
line 807, in main<br>t.runctx(code, globs, globs)<br>File
"/usr/lib/python2.7/trace.py", line 513, in runctx<br>exec
cmd in globals, locals<br>File "op25_grc.py", line 493, in <module><br>tb
= op25_grc()<br>File "op25_grc.py", line 231, in __init__<br>self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)<br>File
"/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py",
line 54, in __getattr__<br>return getattr(self._hb, name)<br>AttributeError:
'gr_hier_block2_sptr' object has no attribute 'set_callback'</b><br>
</p>
<p>
here is the code for "hier_block2_.py":<br><br><b>#
Copyright 2006,2007 Free Software Foundation, Inc.<br>#<br># This file
is part of GNU Radio<br>#<br># GNU Radio is free software; you can
redistribute it and/or modify<br># it under the terms of the GNU
General Public License as published by<br># the Free Software
Foundation; either version 3, or (at your option)<br># any later
version.<br>#<br># GNU Radio is distributed in the hope that it will
be useful,<br># but WITHOUT ANY WARRANTY; without even the implied
warranty of<br># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the<br># GNU General Public License for more details.<br>#<br>#
You should have received a copy of the GNU General Public License<br>#
along with GNU Radio; see the file COPYING. If not, write to<br># the
Free Software Foundation, Inc., 51 Franklin Street,<br># Boston, MA
02110-1301, USA.<br>#<br><br>from gnuradio_core import hier_block2_swig<br>try:<br>import
pmt<br>except ImportError:<br>from gruel import pmt<br><br>#<br># This
hack forces a 'has-a' relationship to look like an 'is-a' one.<br>#<br>#
It allows Python classes to subclass this one, while passing through<br>#
method calls to the C++ class shared pointer from SWIG.<br>#<br># It
also allows us to intercept method calls if needed<br>#<br>class
hier_block2(object):<br>"""<br>Python wrapper around
the C++ hierarchical block implementation.<br>Provides convenience
functions and allows proper Python subclassing.<br>"""<br><br>def
__init__(self, name, input_signature, output_signature):<br>"""<br>Create
a hierarchical block with a given name and I/O signatures.<br>"""<br>self._hb
= hier_block2_swig(name, input_signature, output_signature)<br><br>def
__getattr__(self, name):<br>"""<br>Pass-through member
requests to the C++ object.<br>"""<br>if not
hasattr(self, "_hb"):<br>raise RuntimeError("hier_block2:
invalid state--did you forget to<br>call gr.hier_block2.__init__ in a
derived class?")<br>return getattr(self._hb, name)<br><br>def
connect(self, *points):<br>"""<br>Connect two or more
block endpoints. An endpoint is either a (block,<br>port)<br>tuple or
a block instance. In the latter case, the port number is<br>assumed<br>to
be zero.<br><br>To connect the hierarchical block external inputs or
outputs to internal<br>block<br>inputs or outputs, use 'self' in the
connect call.<br><br>If multiple arguments are provided, connect will
attempt to wire them in<br>series,<br>interpreting the endpoints as
inputs or outputs as appropriate.<br>"""<br><br>if len
(points) < 1:<br>raise ValueError, ("connect requires at least one
endpoint; %d<br>provided." % (len (points),))<br>else:<br>if
len(points) == 1:<br>self._hb.primitive_connect(points[0].to_basic_block())<br>else:<br>for
i in range (1, len (points)):<br>self._connect(points[i-1], points[i])<br><br>def
_connect(self, src, dst):<br>(src_block, src_port) =
self._coerce_endpoint(src)<br>(dst_block, dst_port) =
self._coerce_endpoint(dst)<br>self._hb.primitive_connect(src_block.to_basic_block(),
src_port,<br>dst_block.to_basic_block(), dst_port)<br><br>def
_coerce_endpoint(self, endp):<br>if hasattr(endp, 'to_basic_block'):<br>return
(endp, 0)<br>else:<br>if hasattr(endp, "__getitem__") and len(endp) ==
2:<br>return endp # Assume user put (block, port)<br>else:<br>raise
ValueError("unable to coerce endpoint")<br><br>def
disconnect(self, *points):<br>"""<br>Disconnect two
endpoints in the flowgraph.<br><br>To disconnect the hierarchical
block external inputs or outputs to<br>internal block<br>inputs or
outputs, use 'self' in the connect call.<br><br>If more than two
arguments are provided, they are disconnected<br>successively.<br>"""<br><br>if
len (points) < 1:<br>raise ValueError, ("disconnect requires at
least one endpoint; %d<br>provided." % (len (points),))<br>else:<br>if
len (points) == 1:<br>self._hb.primitive_disconnect(points[0].to_basic_block())<br>else:<br>for
i in range (1, len (points)):<br>self._disconnect(points[i-1],
points[i])<br><br>def _disconnect(self, src, dst):<br>(src_block,
src_port) = self._coerce_endpoint(src)<br>(dst_block, dst_port) =
self._coerce_endpoint(dst)<br>self._hb.primitive_disconnect(src_block.to_basic_block(),
src_port,<br>dst_block.to_basic_block(), dst_port)<br><br>def
msg_connect(self, src, srcport, dst, dstport):<br>self.primitive_msg_connect(src.to_basic_block(),
srcport,<br>dst.to_basic_block(), dstport);<br><br>def
msg_disconnect(self, src, srcport, dst, dstport):<br>self.primitive_msg_disconnect(src.to_basic_block(),
srcport,<br>dst.to_basic_block(), dstport);<br><br>def
message_port_register_hier_in(self, portname):<br>self.primitive_message_port_register_hier_in(pmt.pmt_intern(portname));<br><br>def
message_port_register_hier_out(self, portname):<br>self.primitive_message_port_register_hier_out(pmt.pmt_intern(portname));<br></b><br>i
have been unable to find any sort of solution to this problem
anywhere. Any help will be greatly appreciated.<br>Thank you very much!<br>--------------------------------------------------------------------------------
</p>
</div>
</body>
</html>