diff options
author | Ferenc Gerlits <fgerlits@gmail.com> | 2021-04-29 21:52:38 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-05-03 12:48:08 -0400 |
commit | faf786d57f48bc516c530bfd76e478b3748cd582 (patch) | |
tree | d0547b018122e2f196bdfa412c2ddc27bf23c53a /gr-utils/modtool/core/newmod.py | |
parent | 79d294331ca941cd16c42ddc07278c5ce749b938 (diff) |
modtool: improve the 'invalid name' error message
also fix some validations which checked a prefix instead of the whole name
Signed-off-by: Ferenc Gerlits <fgerlits@gmail.com>
Diffstat (limited to 'gr-utils/modtool/core/newmod.py')
-rw-r--r-- | gr-utils/modtool/core/newmod.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gr-utils/modtool/core/newmod.py b/gr-utils/modtool/core/newmod.py index 24ab7ae070..babebfcde0 100644 --- a/gr-utils/modtool/core/newmod.py +++ b/gr-utils/modtool/core/newmod.py @@ -16,7 +16,7 @@ import logging from gnuradio import gr from ..tools import SCMRepoFactory -from .base import ModTool, ModToolException +from .base import ModTool, ModToolException, validate_name logger = logging.getLogger(__name__) @@ -39,8 +39,7 @@ class ModToolNewModule(ModTool): """ Validates the arguments """ if not self.info['modname']: raise ModToolException('Module name not specified.') - if not re.match('[a-zA-Z0-9_]+$', self.info['modname']): - raise ModToolException('Invalid module name.') + validate_name('module', self.info['modname']) try: os.stat(self.dir) except OSError: |