diff options
author | Swapnil Negi <swapnil.negi09@gmail.com> | 2018-03-23 03:37:21 +0530 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-03-22 23:33:27 +0100 |
commit | 0677aba16a58d5a945ebb65fe1bf6ad6f78e6895 (patch) | |
tree | 323c18e3ffc47aaeaf35fd72286987fb456b3596 /gr-utils/python/modtool/modtool_add.py | |
parent | ef728b6a610372b45f32ae119f8e18d1d9d3bd82 (diff) |
modtool: add option for copyrightholder
fixes #1587
Diffstat (limited to 'gr-utils/python/modtool/modtool_add.py')
-rw-r--r-- | gr-utils/python/modtool/modtool_add.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gr-utils/python/modtool/modtool_add.py b/gr-utils/python/modtool/modtool_add.py index cc7e261c05..c21ae3dc2a 100644 --- a/gr-utils/python/modtool/modtool_add.py +++ b/gr-utils/python/modtool/modtool_add.py @@ -24,6 +24,7 @@ import os import re from optparse import OptionGroup import readline +import getpass from util_functions import append_re_line_sequence, ask_yes_no, SequenceCompleter from cmakefile_editor import CMakeFileEditor @@ -113,7 +114,16 @@ class ModToolAdd(ModTool): if not options.license_file: self._info['copyrightholder'] = options.copyright if self._info['copyrightholder'] is None: - self._info['copyrightholder'] = '<+YOU OR YOUR COMPANY+>' + user = getpass.getuser() + git_user = self.scm.get_gituser() + if git_user: + copyright_candidates = (user, git_user, 'GNU Radio') + else: + copyright_candidates = (user, 'GNU Radio') + with SequenceCompleter(copyright_candidates): + self._info['copyrightholder'] = raw_input("Please specify the copyright holder: ") + if not self._info['copyrightholder'] or self._info['copyrightholder'].isspace(): + self._info['copyrightholder'] = "gr-"+self._info['modname']+" author" elif self._info['is_component']: print "For GNU Radio components the FSF is added as copyright holder" self._license_file = options.license_file |