summaryrefslogtreecommitdiff
path: root/gr-utils/modtool/core/add.py
diff options
context:
space:
mode:
authorFerenc Gerlits <fgerlits@gmail.com>2021-04-29 21:52:38 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-05-03 12:48:08 -0400
commitfaf786d57f48bc516c530bfd76e478b3748cd582 (patch)
treed0547b018122e2f196bdfa412c2ddc27bf23c53a /gr-utils/modtool/core/add.py
parent79d294331ca941cd16c42ddc07278c5ce749b938 (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/add.py')
-rw-r--r--gr-utils/modtool/core/add.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gr-utils/modtool/core/add.py b/gr-utils/modtool/core/add.py
index c141023789..35988b959c 100644
--- a/gr-utils/modtool/core/add.py
+++ b/gr-utils/modtool/core/add.py
@@ -16,7 +16,7 @@ import subprocess
from ..tools import render_template, append_re_line_sequence, CMakeFileEditor, CPPFileEditor, code_generator
from ..templates import Templates
-from .base import ModTool, ModToolException
+from .base import ModTool, ModToolException, validate_name
from gnuradio.bindtool import BindingGenerator
from gnuradio import gr
@@ -72,8 +72,7 @@ class ModToolAdd(ModTool):
raise ModToolException('Tagged Stream Blocks for Python currently unsupported')
if self.info['blockname'] is None:
raise ModToolException('Blockname not specified.')
- if not re.match('^[a-zA-Z0-9_]+$', self.info['blockname']):
- raise ModToolException('Invalid block name.')
+ validate_name('block', self.info['blockname'])
if not isinstance(self.add_py_qa, bool):
raise ModToolException('Expected a boolean value for add_python_qa.')
if not isinstance(self.add_cc_qa, bool):