diff options
author | Andrej Rode <mail@andrejro.de> | 2018-06-23 23:41:42 +0200 |
---|---|---|
committer | Andrej Rode <mail@andrejro.de> | 2018-06-24 00:03:35 +0200 |
commit | 167a6152bad060fc53dd29e0fa79ef83eff1be5b (patch) | |
tree | a01049672d9d7d1bf3d295ed96698a323941f8e8 /gr-utils/python/modtool/modtool_makexml.py | |
parent | 3c8e6008b092287246234001db7cf1a4038300da (diff) | |
parent | fcd002b6ac82e1e0c1224e24506410ff0833e1aa (diff) |
Merge branch 'python3_fix' into next
Manual merge conflict resolution has been applied to following
conflicts:
* Typos:
* gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
* gr-blocks/python/blocks/qa_wavfile.py
* gr-filter/examples/gr_filtdes_api.py
* grc/blocks/parameter.xml
* gr-uhd/python/uhd/__init__.py
* ValueError -> RuntimeError:
* gr-blocks/python/blocks/qa_hier_block2.py
* relative Imports & other Py3k:
* gr-digital/python/digital/psk_constellations.py
* gr-digital/python/digital/qam_constellations.py
* gr-digital/python/digital/test_soft_decisions.py
* gr-digital/python/digital/gfsk.py
* SequenceCompleter:
* gr-utils/python/modtool/modtool_add.py
* gr-utils/python/modtool/modtool_rename.py
* gr-utils/python/modtool/modtool_rm.py
* Updated API on next:
* gr-blocks/grc/blocks_file_source.xml
* gr-blocks/python/blocks/qa_file_source_sink.py
* gr-qtgui/grc/qtgui_time_sink_x.xml
* GRC Py3k Updates:
* grc/core/Block.py
* grc/core/Constants.py
* grc/core/Platform.py
* grc/core/utils/odict.py
* grc/gui/Actions.py
* grc/gui/Block.py
* grc/gui/Executor.py
* grc/gui/Port.py
Diffstat (limited to 'gr-utils/python/modtool/modtool_makexml.py')
-rw-r--r-- | gr-utils/python/modtool/modtool_makexml.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gr-utils/python/modtool/modtool_makexml.py b/gr-utils/python/modtool/modtool_makexml.py index 311ed96cb4..74fed4b7a1 100644 --- a/gr-utils/python/modtool/modtool_makexml.py +++ b/gr-utils/python/modtool/modtool_makexml.py @@ -20,15 +20,19 @@ # """ Automatically create XML bindings for GRC from block code """ +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import os import re import glob -from modtool_base import ModTool, ModToolException -from parser_cc_block import ParserCCBlock -from grc_xml_generator import GRCXMLGenerator -from cmakefile_editor import CMakeFileEditor -from util_functions import ask_yes_no +from .modtool_base import ModTool, ModToolException +from .parser_cc_block import ParserCCBlock +from .grc_xml_generator import GRCXMLGenerator +from .cmakefile_editor import CMakeFileEditor +from .util_functions import ask_yes_no class ModToolMakeXML(ModTool): @@ -54,13 +58,13 @@ class ModToolMakeXML(ModTool): if options.blockname is not None: self._info['pattern'] = options.blockname else: - self._info['pattern'] = raw_input('Which blocks do you want to parse? (Regex): ') + self._info['pattern'] = input('Which blocks do you want to parse? (Regex): ') if len(self._info['pattern']) == 0: self._info['pattern'] = '.' def run(self, options): """ Go, go, go! """ - print "Warning: This is an experimental feature. Don't expect any magic." + print("Warning: This is an experimental feature. Don't expect any magic.") self.setup(options) # 1) Go through lib/ if not self._skip_subdirs['lib']: @@ -80,12 +84,12 @@ class ModToolMakeXML(ModTool): """ Search for files matching pattern in the given path. """ files = sorted(glob.glob("%s/%s"% (path, path_glob))) files_filt = [] - print "Searching for matching files in %s/:" % path + print("Searching for matching files in %s/:" % path) for f in files: if re.search(self._info['pattern'], os.path.basename(f)) is not None: files_filt.append(f) if len(files_filt) == 0: - print "None found." + print("None found.") return files_filt def _make_grc_xml_from_block_data(self, params, iosig, blockname): @@ -110,7 +114,7 @@ class ModToolMakeXML(ModTool): return else: file_exists = True - print "Warning: Overwriting existing GRC file." + print("Warning: Overwriting existing GRC file.") grc_generator = GRCXMLGenerator( modname=self._info['modname'], blockname=blockname, @@ -125,7 +129,7 @@ class ModToolMakeXML(ModTool): if not self._skip_subdirs['grc']: ed = CMakeFileEditor(self._file['cmgrc']) if re.search(fname_xml, ed.cfile) is None and not ed.check_for_glob('*.xml'): - print "Adding GRC bindings to grc/CMakeLists.txt..." + print("Adding GRC bindings to grc/CMakeLists.txt...") ed.append_value('install', fname_xml, to_ignore_end='DESTINATION[^()]+') ed.write() self.scm.mark_files_updated(self._file['cmgrc']) @@ -158,7 +162,7 @@ class ModToolMakeXML(ModTool): blockname = blockname.replace(self._info['modname']+'_', '', 1) return (blockname, fname_h) # Go, go, go - print "Making GRC bindings for %s..." % fname_cc + print("Making GRC bindings for %s..." % fname_cc) (blockname, fname_h) = _get_blockdata(fname_cc) try: parser = ParserCCBlock(fname_cc, |