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_base.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_base.py')
-rw-r--r-- | gr-utils/python/modtool/modtool_base.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gr-utils/python/modtool/modtool_base.py b/gr-utils/python/modtool/modtool_base.py index 990e63af14..e0ae963f20 100644 --- a/gr-utils/python/modtool/modtool_base.py +++ b/gr-utils/python/modtool/modtool_base.py @@ -20,13 +20,17 @@ # """ Base class for the modules """ +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import os import re from argparse import ArgumentParser, RawDescriptionHelpFormatter from gnuradio import gr -from util_functions import get_modname -from scm import SCMRepoFactory +from .util_functions import get_modname +from .scm import SCMRepoFactory class ModToolException(BaseException): """ Standard exception for modtool classes. """ @@ -94,7 +98,7 @@ class ModTool(object): self._info['modname'] = get_modname() if self._info['modname'] is None: raise ModToolException('No GNU Radio module found in the given directory.') - print "GNU Radio module name identified: " + self._info['modname'] + print("GNU Radio module name identified: " + self._info['modname']) if self._info['version'] == '36' and ( os.path.isdir(os.path.join('include', self._info['modname'])) or os.path.isdir(os.path.join('include', 'gnuradio', self._info['modname'])) @@ -144,7 +148,7 @@ class ModTool(object): else: self.scm = SCMRepoFactory(self.options, '.').make_empty_scm_manager() if self.scm is None: - print "Error: Can't set up SCM." + print("Error: Can't set up SCM.") exit(1) def _check_directory(self, directory): @@ -156,7 +160,7 @@ class ModTool(object): files = os.listdir(directory) os.chdir(directory) except OSError: - print "Can't read or chdir to directory %s." % directory + print("Can't read or chdir to directory %s." % directory) return False self._info['is_component'] = False for f in files: @@ -170,11 +174,11 @@ class ModTool(object): has_makefile = True # TODO search for autofoo elif os.path.isdir(f): - if (f in self._has_subdirs.keys()): + if (f in list(self._has_subdirs.keys())): self._has_subdirs[f] = True else: self._skip_subdirs[f] = True - return bool(has_makefile and (self._has_subdirs.values())) + return bool(has_makefile and (list(self._has_subdirs.values()))) def _get_mainswigfile(self): """ Find out which name the main SWIG file has. In particular, is it |