diff options
author | Martin Braun | 2013-01-25 17:52:46 +0100 |
---|---|---|
committer | Martin Braun | 2013-01-25 17:52:46 +0100 |
commit | c4971ab2cb4bdbb9abc5d5320bd16b45cf263cf8 (patch) | |
tree | c4415e4cedddd204dc186d0858f25e1a2c654827 | |
parent | f24128ea9036f68e61ff9350ce86ec619f9ae286 (diff) | |
download | gnuradio-c4971ab2cb4bdbb9abc5d5320bd16b45cf263cf8.tar.gz gnuradio-c4971ab2cb4bdbb9abc5d5320bd16b45cf263cf8.tar.bz2 gnuradio-c4971ab2cb4bdbb9abc5d5320bd16b45cf263cf8.zip |
utils: modtool minor updates
-rw-r--r-- | gr-utils/src/python/modtool/cmakefile_editor.py | 2 | ||||
-rw-r--r-- | gr-utils/src/python/modtool/modtool_add.py | 2 | ||||
-rw-r--r-- | gr-utils/src/python/modtool/modtool_newmod.py | 2 | ||||
-rw-r--r-- | gr-utils/src/python/modtool/templates.py | 6 |
4 files changed, 5 insertions, 7 deletions
diff --git a/gr-utils/src/python/modtool/cmakefile_editor.py b/gr-utils/src/python/modtool/cmakefile_editor.py index fe50373bb..b18275707 100644 --- a/gr-utils/src/python/modtool/cmakefile_editor.py +++ b/gr-utils/src/python/modtool/cmakefile_editor.py @@ -5,7 +5,7 @@ import re ### CMakeFile.txt editor class ############################################### class CMakeFileEditor(object): """A tool for editing CMakeLists.txt files. """ - def __init__(self, filename, separator=' ', indent=' '): + def __init__(self, filename, separator='\n ', indent=' '): self.filename = filename self.cfile = open(filename, 'r').read() self.separator = separator diff --git a/gr-utils/src/python/modtool/modtool_add.py b/gr-utils/src/python/modtool/modtool_add.py index c664d7c1a..581f3b0aa 100644 --- a/gr-utils/src/python/modtool/modtool_add.py +++ b/gr-utils/src/python/modtool/modtool_add.py @@ -272,7 +272,7 @@ class ModToolAdd(ModTool): self._write_tpl('block_python', 'python', fname_py) append_re_line_sequence(self._file['pyinit'], '(^from.*import.*\n|# import any pure.*\n)', - 'from %s import *' % self._info['blockname']) + 'from %s import %s' % (self._info['blockname'], self._info['blockname'])) if self.options.skip_cmakefiles: return ed = CMakeFileEditor(self._file['cmpython']) diff --git a/gr-utils/src/python/modtool/modtool_newmod.py b/gr-utils/src/python/modtool/modtool_newmod.py index 9b2dc6e30..0c69cb69e 100644 --- a/gr-utils/src/python/modtool/modtool_newmod.py +++ b/gr-utils/src/python/modtool/modtool_newmod.py @@ -51,7 +51,7 @@ class ModToolNewModule(ModTool): * Open all files, rename howto and HOWTO to the module name * Rename files and directories that contain the word howto """ - print "Creating out-of-tree module in %s..." % self._dir + print "Creating out-of-tree module in %s..." % self._dir, try: shutil.copytree('/home/braun/.usrlocal/share/gnuradio/modtool/gr-newmod', self._dir) os.chdir(self._dir) diff --git a/gr-utils/src/python/modtool/templates.py b/gr-utils/src/python/modtool/templates.py index e3019bb70..f41049c5a 100644 --- a/gr-utils/src/python/modtool/templates.py +++ b/gr-utils/src/python/modtool/templates.py @@ -287,8 +287,8 @@ import numpy #set $deciminterp = ', <+interpolation+>' #else if $blocktype == 'decimator' #set $deciminterp = ', <+decimation+>' -#set $deciminterp = '' #else +#set $deciminterp = '' #end if from gnuradio import gr @@ -297,7 +297,7 @@ class ${blockname}(${parenttype}): docstring for block ${blockname} """ def __init__(self#if $arglist == '' then '' else ', '#$arglist): - gr.${parenttype}.__init__(self, + ${parenttype}.__init__(self, #if $blocktype == 'hier' "$blockname", gr.io_signature(${inputsig}), # Input signature @@ -324,8 +324,6 @@ class ${blockname}(${parenttype}): \#self.consume_each(len(input_items[0])) return len(output_items[0]) #stop -#else - def work(self, input_items, output_items): #end if def work(self, input_items, output_items): |