summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_add.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-02-21 07:33:02 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2016-02-21 07:33:02 -0800
commite34866dad21a98e901c188df7e87f37ae5502a88 (patch)
treefb5dd0f2c395b31c70e65f127ce0190ec2b90a56 /gr-utils/python/modtool/modtool_add.py
parent4aabba72f0d268174855fce97a80bd55acb1358c (diff)
parent762a08915c252e0604b466dc97d5e51b0a86562d (diff)
Merge branch 'master' into next
Conflicts: gr-utils/python/modtool/templates.py
Diffstat (limited to 'gr-utils/python/modtool/modtool_add.py')
-rw-r--r--gr-utils/python/modtool/modtool_add.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gr-utils/python/modtool/modtool_add.py b/gr-utils/python/modtool/modtool_add.py
index 75d4d6d2e4..eb269080b4 100644
--- a/gr-utils/python/modtool/modtool_add.py
+++ b/gr-utils/python/modtool/modtool_add.py
@@ -51,6 +51,8 @@ class ModToolAdd(ModTool):
choices=self._block_types, default=None, help="One of %s." % ', '.join(self._block_types))
ogroup.add_option("--license-file", type="string", default=None,
help="File containing the license header for every source code file.")
+ ogroup.add_option("--copyright", type="string", default=None,
+ help="Name of the copyright holder (you or your company) MUST be a quoted string.")
ogroup.add_option("--argument-list", type="string", default=None,
help="The argument list for the constructor and make functions.")
ogroup.add_option("--add-python-qa", action="store_true", default=None,
@@ -75,7 +77,6 @@ class ModToolAdd(ModTool):
self._info['blocktype'] = raw_input("Enter block type: ")
if self._info['blocktype'] not in self._block_types:
print 'Must be one of ' + str(self._block_types)
-
# Allow user to specify language interactively if not set
self._info['lang'] = options.lang
if self._info['lang'] is None:
@@ -100,8 +101,14 @@ class ModToolAdd(ModTool):
raise ModToolException('Invalid block name.')
print "Block/code identifier: " + self._info['blockname']
self._info['fullblockname'] = self._info['modname'] + '_' + self._info['blockname']
+ if not options.license_file:
+ self._info['copyrightholder'] = options.copyright
+ if self._info['copyrightholder'] is None:
+ self._info['copyrightholder'] = '<+YOU OR YOUR COMPANY+>'
+ elif self._info['is_component']:
+ print "For GNU Radio components the FSF is added as copyright holder"
+ self._license_file = options.license_file
self._info['license'] = self.setup_choose_license()
-
if options.argument_list is not None:
self._info['arglist'] = options.argument_list
else:
@@ -120,7 +127,6 @@ class ModToolAdd(ModTool):
print "Warning: Autotools modules are not supported. ",
print "Files will be created, but Makefiles will not be edited."
self._skip_cmakefiles = True
- self._license_file = options.license_file
def setup_choose_license(self):
""" Select a license by the following rules, in this order:
@@ -138,7 +144,7 @@ class ModToolAdd(ModTool):
elif self._info['is_component']:
return Templates['grlicense']
else:
- return Templates['defaultlicense']
+ return get_template('defaultlicense', **self._info)
def _write_tpl(self, tpl, path, fname):
""" Shorthand for writing a substituted template to a file"""