summaryrefslogtreecommitdiff
path: root/gr-utils/modtool/cli/add.py
diff options
context:
space:
mode:
authoralekhgupta1441 <alekhgupta1441@gmail.com>2020-03-14 07:04:54 +0530
committerMichael Dickens <michael.dickens@ettus.com>2020-04-19 15:33:41 -0400
commitcb4f4648815c005788a1879bdb10c58228736808 (patch)
tree1b2a7b3acfc4dab769897934da3f86d72a3af079 /gr-utils/modtool/cli/add.py
parentb28220713221c811fc31662472976e0d8a3dc959 (diff)
modtool: Replaced str.format() by Python f'strings in all codes
Diffstat (limited to 'gr-utils/modtool/cli/add.py')
-rw-r--r--gr-utils/modtool/cli/add.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gr-utils/modtool/cli/add.py b/gr-utils/modtool/cli/add.py
index e174fcde43..9439c38dc9 100644
--- a/gr-utils/modtool/cli/add.py
+++ b/gr-utils/modtool/cli/add.py
@@ -25,7 +25,7 @@ from .base import common_params, block_name, run, cli_input, ModToolException
@click.command('add')
@click.option('-t', '--block-type', type=click.Choice(ModToolAdd.block_types),
- help="One of {}.".format(', '.join(ModToolAdd.block_types)))
+ help=f"One of {', '.join(ModToolAdd.block_types)}.")
@click.option('--license-file',
help="File containing the license header for every source code file.")
@click.option('--copyright',
@@ -49,7 +49,8 @@ def cli(**kwargs):
click.secho("GNU Radio module name identified: " + self.info['modname'], fg='green')
get_blocktype(self)
get_lang(self)
- click.secho("Language: {}".format({'cpp': 'C++', 'python': 'Python'}[self.info['lang']]), fg='green')
+ info_lang = {'cpp': 'C++', 'python': 'Python'}[self.info['lang']]
+ click.secho(f"Language: {info_lang}", fg='green')
if ((self.skip_subdirs['lib'] and self.info['lang'] == 'cpp')
or (self.skip_subdirs['python'] and self.info['lang'] == 'python')):
raise ModToolException('Missing or skipping relevant subdir.')
@@ -114,7 +115,8 @@ def get_copyrightholder(self):
with SequenceCompleter(copyright_candidates):
self.info['copyrightholder'] = cli_input("Please specify the copyright holder: ")
if not self.info['copyrightholder'] or self.info['copyrightholder'].isspace():
- self.info['copyrightholder'] = "gr-{} author".format(self.info['modname'])
+ inf_=self.info['modname']
+ self.info['copyrightholder'] = f"gr-{inf_} author"
elif self.info['is_component']:
click.secho("For GNU Radio components the FSF is added as copyright holder",
fg='cyan')