summaryrefslogtreecommitdiff
path: root/gr-utils/src/python/modtool/util_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/src/python/modtool/util_functions.py')
-rw-r--r--gr-utils/src/python/modtool/util_functions.py19
1 files changed, 4 insertions, 15 deletions
diff --git a/gr-utils/src/python/modtool/util_functions.py b/gr-utils/src/python/modtool/util_functions.py
index 33d8ad333..4ca294ac3 100644
--- a/gr-utils/src/python/modtool/util_functions.py
+++ b/gr-utils/src/python/modtool/util_functions.py
@@ -18,11 +18,13 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
-""" Utility functions for gr_modtool.py """
+""" Utility functions for gr_modtool """
import re
import sys
+# None of these must depend on other modtool stuff!
+
def get_command_from_argv(possible_cmds):
""" Read the requested command from argv. This can't be done with optparse,
since the option parser isn't defined before the command is known, and
@@ -38,7 +40,7 @@ def get_command_from_argv(possible_cmds):
return None
def append_re_line_sequence(filename, linepattern, newline):
- """Detects the re 'linepattern' in the file. After its last occurrence,
+ """ Detects the re 'linepattern' in the file. After its last occurrence,
paste 'newline'. If the pattern does not exist, append the new line
to the file. Then, write. """
oldfile = open(filename, 'r').read()
@@ -99,19 +101,6 @@ def get_modname():
except AttributeError:
return None
-def get_class_dict():
- " Return a dictionary of the available commands in the form command->class "
- classdict = {}
- for g in globals().values():
- try:
- if issubclass(g, ModTool):
- classdict[g.name] = g
- for a in g.aliases:
- classdict[a] = g
- except (TypeError, AttributeError):
- pass
- return classdict
-
def is_number(s):
" Return True if the string s contains a number. "
try: