I installed new version of gr_modtool script and it won't work. The error is following:
[savi_ne@ts-070046nl gr-test]$ gr_modtool.py add -N rx_tx_message -t hier -l python Using Python < 2.7 possibly buggy. Ahem. Please send all complaints to /dev/null. Operating in directory . GNU Radio module name identified: test Language: Python Block/code identifier: rx_tx_message Enter valid argument list, including default arguments: Add Python QA code? [Y/n] n Traversing python... Adding file 'rx_tx_message.py'... Traceback (most recent call last): File "/usr/local/bin/gr_modtool.py", line 3369, in <module> main() File "/usr/local/bin/gr_modtool.py", line 3362, in main modtool.run() File "/usr/local/bin/gr_modtool.py", line 1339, in run self._run_python() File "/usr/local/bin/gr_modtool.py", line 1479, in _run_python self._write_tpl('block_python', 'python', fname_py) File "/usr/local/bin/gr_modtool.py", line 1324, in _write_tpl open(os.path.join(path, fname), 'w').write(get_template(tpl, **self._info)) File "/usr/local/bin/gr_modtool.py", line 870, in get_template return str(GRMTemplate(Templates[tpl_id], searchList=kwargs)) File "/usr/local/bin/gr_modtool.py", line 865, in __init__ Cheetah.Template.Template.__init__(self, src, searchList=searchList) File "/usr/lib64/python2.6/site-packages/Cheetah/Template.py", line 1257, in __init__ self._compile(source, file, compilerSettings=compilerSettings) File "/usr/lib64/python2.6/site-packages/Cheetah/Template.py", line 1551, in _compile keepRefToGeneratedCode=True) File "/usr/lib64/python2.6/site-packages/Cheetah/Template.py", line 795, in compile raise parseError Cheetah.Parser.ParseError: Error in the Python code which Cheetah generated for this template: ================================================================================ expected an indented block (DynamicallyCompiledCheetahTemplate.py, line 122) Line|Python Code ----|------------------------------------------------------------- 120 | deciminterp = '' 121 | else: # generated from line 42, col 1 122 | write(u'''from gnuradio import gr ^ 123 |class ''') 124 | _v = VFFSL(SL,"blockname",True) # u'${blockname}' on line 46, col 7 125 | if _v is not None: write(_filter(_v, rawExpr=u'${blockname}')) # from line 46, col 7. ================================================================================ Here is the corresponding Cheetah code. ** I had to guess the line & column numbers, so they are probably incorrect: Line 42, column 1 Line|Cheetah Code ----|------------------------------------------------------------- 39 |#else if $blocktype == 'decimator' 40 |#set $deciminterp = ', <+decimation+>' 41 |#set $deciminterp = '' 42 |#else ^ 43 |#end if 44 |from gnuradio import gr 45 | Any suggestions how to ovecome this except using older version which worked perfectly? On Fri, Jan 25, 2013 at 9:22 PM, Nemanja Savic <vlasi...@gmail.com> wrote: > Thank you Martin, I will try that on Monday. > I suppose that I have older version of gr_modtool, cause there is no > option -l for selecting language. > My weekend would be maybe perfect If you or anybody else can explain to me > why my code won't work, cause I have more or less copied block structure > from grextras. > > Nice weekend > Nemanja > > > On Fri, Jan 25, 2013 at 5:18 PM, Martin Braun (CEL) > <martin.br...@kit.edu>wrote: > >> For a hier block in Python, do >> >> $ gr_modtool.py add -t hier -l python >> >> You need 3.6.3 to do that. >> >> Also, you'll need a new version of modtool (it usually lags a bit behind >> changes in GNU Radio). >> >> MB >> >> >> On Fri, Jan 25, 2013 at 05:05:56PM +0100, Nemanja Savic wrote: >> > Hi all, >> > >> > >> > today i was trying to make hierarchical signal processing block in >> Python. I >> > started with gr_modtool script, and configured it for hierpython block >> type. >> > >> > >> > My idea was to design block similar to packet framer, so inside of the >> new >> > block, I connected binary slicer and Framer sink. I have also declared >> message >> > queue. >> > >> > >> > Outside of main block, I designed another block which should collect >> messages >> > sent by framer from the main block. >> > >> > >> > When I wanted to run this block, I got following error: >> > >> > >> > >> > Traceback (most recent call last): >> > File "/home/savi_ne/work/gnuradio/GRC/top_block.py", line 439, in >> <module> >> > tb = top_block() >> > File "/home/savi_ne/work/gnuradio/GRC/top_block.py", line 183, in >> __init__ >> > self.test_packet_proba_0 = test.packet_proba() >> > AttributeError: 'module' object has no attribute 'packet_proba' >> > >> > >> > >> > Next I found that maybe I have to put following line in __init__.py >> file: >> > >> > from packet_proba import * >> > >> > >> > After that I got similar error: >> > >> > Traceback (most recent call last): >> > File "/home/savi_ne/work/gnuradio/GRC/top_block.py", line 18, in >> <module> >> > import test >> > File "/usr/local/lib64/python2.6/site-packages/test/__init__.py", >> line 49, in >> > <module> >> > from packet_proba import * >> > File "/usr/local/lib64/python2.6/site-packages/test/packet_proba.py", >> line >> > 51, in <module> >> > class proba(gr.basic_block): >> > AttributeError: 'module' object has no attribute 'basic_block' >> > >> > >> > I have also tried with gr.block instead of gr.basic_block, but with >> identical >> > results. >> > >> > >> > Can anybody tell what's missing? >> > >> > >> > Thanks >> > >> > >> > -- >> > Nemanja Savić >> > >> >> > _______________________________________________ >> > Discuss-gnuradio mailing list >> > Discuss-gnuradio@gnu.org >> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio >> >> >> -- >> Karlsruhe Institute of Technology (KIT) >> Communications Engineering Lab (CEL) >> >> Dipl.-Ing. Martin Braun >> Research Associate >> >> Kaiserstraße 12 >> Building 05.01 >> 76131 Karlsruhe >> >> Phone: +49 721 608-43790 >> Fax: +49 721 608-46071 >> www.cel.kit.edu >> >> KIT -- University of the State of Baden-Württemberg and >> National Laboratory of the Helmholtz Association >> >> _______________________________________________ >> Discuss-gnuradio mailing list >> Discuss-gnuradio@gnu.org >> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio >> >> > > > -- > Nemanja Savić > -- Nemanja Savić
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio