summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_disable.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-08-01 14:51:05 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-08-01 14:51:05 -0700
commitcfda705a5e07f9611f5b8d0e3425fe58a851b61b (patch)
treec6f1e05f38c3641af2941b0273f6b81f072408f2 /gr-utils/python/modtool/modtool_disable.py
parent1cdda44be516afd4197e1adda72bf2b2391a1955 (diff)
parent9f62aa85ee15b6a7dd7283d834abc192c437ea13 (diff)
Merge remote-tracking branch 'pinkavaj/argparse-modtool-02' into next
Diffstat (limited to 'gr-utils/python/modtool/modtool_disable.py')
-rw-r--r--gr-utils/python/modtool/modtool_disable.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/gr-utils/python/modtool/modtool_disable.py b/gr-utils/python/modtool/modtool_disable.py
index 4ae2242f99..1772a740f3 100644
--- a/gr-utils/python/modtool/modtool_disable.py
+++ b/gr-utils/python/modtool/modtool_disable.py
@@ -31,24 +31,26 @@ from cmakefile_editor import CMakeFileEditor
class ModToolDisable(ModTool):
""" Disable block (comments out CMake entries for files) """
name = 'disable'
- aliases = ('dis',)
+ description = 'Disable selected block in module.'
def __init__(self):
ModTool.__init__(self)
- def setup(self, options, args):
- ModTool.setup(self, options, args)
+ @staticmethod
+ def setup_parser(parser):
+ ModTool.setup_parser_block(parser)
- if options.block_name is not None:
- self._info['pattern'] = options.block_name
- elif len(args) >= 2:
- self._info['pattern'] = args[1]
+ def setup(self, options):
+ ModTool.setup(self, options)
+
+ if options.blockname is not None:
+ self._info['pattern'] = options.blockname
else:
self._info['pattern'] = raw_input('Which blocks do you want to disable? (Regex): ')
if len(self._info['pattern']) == 0:
self._info['pattern'] = '.'
- def run(self):
+ def run(self, options):
""" Go, go, go! """
def _handle_py_qa(cmake, fname):
""" Do stuff for py qa """
@@ -115,6 +117,7 @@ class ModToolDisable(ModTool):
open(self._file['swig'], 'w').write(swigfile)
self.scm.mark_file_updated(self._file['swig'])
return False
+ self.setup(options)
# List of special rules: 0: subdir, 1: filename re match, 2: callback
special_treatments = (
('python', 'qa.+py$', _handle_py_qa),