From fa5480e8bccec39278e9c5f81c09d1e702fd0fd7 Mon Sep 17 00:00:00 2001 From: Sebastian Koslowski <koslowski@kit.edu> Date: Sun, 24 Nov 2013 20:23:39 +0100 Subject: modtool: no more exit() in modtool package Conflicts: gr-utils/python/modtool/modtool_newmod.py --- gr-utils/python/modtool/util_functions.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'gr-utils/python/modtool/util_functions.py') diff --git a/gr-utils/python/modtool/util_functions.py b/gr-utils/python/modtool/util_functions.py index 71a7a7f535..ea7af0cf7c 100644 --- a/gr-utils/python/modtool/util_functions.py +++ b/gr-utils/python/modtool/util_functions.py @@ -29,13 +29,8 @@ 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 optparse throws an error.""" - command = None for arg in sys.argv: - if arg[0] == "-": - continue - else: - command = arg - if command in possible_cmds: + if arg[0] != "-" and arg in possible_cmds: return arg return None @@ -111,7 +106,7 @@ def get_modname(): return None def is_number(s): - " Return True if the string s contains a number. " + """ Return True if the string s contains a number. """ try: float(s) return True -- cgit v1.2.3