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_newmod.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_newmod.py')
-rw-r--r-- | gr-utils/python/modtool/modtool_newmod.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gr-utils/python/modtool/modtool_newmod.py b/gr-utils/python/modtool/modtool_newmod.py index 4382d9be7d..c283204ee2 100644 --- a/gr-utils/python/modtool/modtool_newmod.py +++ b/gr-utils/python/modtool/modtool_newmod.py @@ -20,12 +20,16 @@ # """ Create a whole new out-of-tree module """ +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + import shutil import os import re from gnuradio import gr -from modtool_base import ModTool, ModToolException -from scm import SCMRepoFactory +from .modtool_base import ModTool, ModToolException +from .scm import SCMRepoFactory class ModToolNewModule(ModTool): """ Create a new out-of-tree module """ @@ -49,7 +53,7 @@ class ModToolNewModule(ModTool): if options.module_name: self._info['modname'] = options.module_name else: - self._info['modname'] = raw_input('Name of the new module: ') + self._info['modname'] = input('Name of the new module: ') if not re.match('[a-zA-Z0-9_]+$', self._info['modname']): raise ModToolException('Invalid module name.') self._dir = options.directory @@ -76,7 +80,7 @@ class ModToolNewModule(ModTool): * Rename files and directories that contain the word howto """ self.setup(options) - print "Creating out-of-tree module in %s..." % self._dir, + print("Creating out-of-tree module in %s..." % (self._dir,)) try: shutil.copytree(self._srcdir, self._dir) os.chdir(self._dir) @@ -93,8 +97,8 @@ class ModToolNewModule(ModTool): os.rename(f, os.path.join(root, filename.replace('howto', self._info['modname']))) if os.path.basename(root) == 'howto': os.rename(root, os.path.join(os.path.dirname(root), self._info['modname'])) - print "Done." + print("Done.") if self.scm.init_repo(path_to_repo="."): - print "Created repository... you might want to commit before continuing." - print "Use 'gr_modtool add' to add a new block to this currently empty module." + print("Created repository... you might want to commit before continuing.") + print("Use 'gr_modtool add' to add a new block to this currently empty module.") |