diff options
author | Josh Morman <jmorman@gnuradio.org> | 2021-11-24 12:43:14 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-11-24 14:41:53 -0500 |
commit | e6f61fba108fb40ad8103ef4fadbe507932695ab (patch) | |
tree | 354a7a48dc48f06f448ff842329074a50b3fca5c /gr-utils/modtool/cli/rename.py | |
parent | 1bfc6b439dbcdc467bbbed43a9fd71b49524c348 (diff) |
utils: pep8 formatting
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
Diffstat (limited to 'gr-utils/modtool/cli/rename.py')
-rw-r--r-- | gr-utils/modtool/cli/rename.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gr-utils/modtool/cli/rename.py b/gr-utils/modtool/cli/rename.py index 0e70867f39..0909e8b644 100644 --- a/gr-utils/modtool/cli/rename.py +++ b/gr-utils/modtool/cli/rename.py @@ -31,36 +31,42 @@ def cli(**kwargs): """ kwargs['cli'] = True self = ModToolRename(**kwargs) - click.secho("GNU Radio module name identified: " + self.info['modname'], fg='green') + click.secho("GNU Radio module name identified: " + + self.info['modname'], fg='green') # first make sure the old block name is provided get_oldname(self) - click.secho("Block/code to rename identifier: " + self.info['oldname'], fg='green') - self.info['fulloldname'] = self.info['modname'] + '_' + self.info['oldname'] + click.secho("Block/code to rename identifier: " + + self.info['oldname'], fg='green') + self.info['fulloldname'] = self.info['modname'] + \ + '_' + self.info['oldname'] # now get the new block name get_newname(self) click.secho("Block/code identifier: " + self.info['newname'], fg='green') - self.info['fullnewname'] = self.info['modname'] + '_' + self.info['newname'] + self.info['fullnewname'] = self.info['modname'] + \ + '_' + self.info['newname'] run(self) + def get_oldname(self): """ Get the old block name to be replaced """ block_candidates = get_block_candidates() if self.info['oldname'] is None: with SequenceCompleter(block_candidates): while not self.info['oldname'] or self.info['oldname'].isspace(): - self.info['oldname'] = cli_input("Enter name of block/code to rename "+ + self.info['oldname'] = cli_input("Enter name of block/code to rename " + "(without module name prefix): ") if self.info['oldname'] not in block_candidates: choices = [x for x in block_candidates if self.info['oldname'] in x] if len(choices) > 0: - click.secho("Suggested alternatives: "+str(choices), fg='yellow') + click.secho("Suggested alternatives: " + str(choices), fg='yellow') raise ModToolException("Blockname for renaming does not exists!") validate_name('block', self.info['oldname']) + def get_newname(self): """ Get the new block name """ if self.info['newname'] is None: while not self.info['newname'] or self.info['newname'].isspace(): - self.info['newname'] = cli_input("Enter name of block/code "+ + self.info['newname'] = cli_input("Enter name of block/code " + "(without module name prefix): ") validate_name('block', self.info['newname']) |