diff options
author | Marcus Müller <marcus@hostalia.de> | 2017-11-20 11:10:07 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-03 14:10:51 +0100 |
commit | 27de5bf4a4493e74b7b052104a1ed6b4494065b5 (patch) | |
tree | 80e9316ff9c6ab7f40f89706a0e81c5e930c1094 /gr-utils | |
parent | ebb1fa9229f1d518085545b84b922662fff560c7 (diff) |
Making gr_modtool start faster by avoiding to iterate over all globals
All subclasses of object have a __subclasses__ method, which gives the
subclasses. That's a lot fewer objects than what's in globals().
Diffstat (limited to 'gr-utils')
-rwxr-xr-x | gr-utils/python/utils/gr_modtool | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-utils/python/utils/gr_modtool b/gr-utils/python/utils/gr_modtool index e714cf48e5..1690be207f 100755 --- a/gr-utils/python/utils/gr_modtool +++ b/gr-utils/python/utils/gr_modtool @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012, 2017 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,7 +26,7 @@ from gnuradio.modtool import * def main(): """ Here we go. Parse command, choose class and run. """ - cmd_dict = get_class_dict(globals().values()) + cmd_dict = get_class_dict(ModTool.__subclasses__()) command = get_command_from_argv(cmd_dict.keys()) if command is None: print 'Usage:' + Templates['usage'] |