From 82d74710bdc1c511f6209ee7276e7a4f8667826c Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Tue, 23 Jun 2015 18:46:09 +0200 Subject: [PATCH] Cleaning module_handler --- scripts/module/module_handler.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 0af71bc3..2d314d67 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -29,7 +29,9 @@ except ImportError: # Canot cache for namedtuple are not hashable def is_module(path_module): - return os.path.isfile(os.path.join(path_module, "NEEDED_CHILDREN_MODULES")) + return os.path.isfile(os.path.join(QP_SRC, + path_module, + "NEEDED_CHILDREN_MODULES")) def get_dict_child(l_root_abs=None): @@ -208,6 +210,12 @@ if __name__ == '__main__': l_module = [os.path.basename(dir_)] else: l_module = arguments[''] + + for module in l_module: + if not is_module(module): + print "{0} is not a module. Abort".format(module) + sys.exit(1) + # else: # path_file = os.path.abspath(arguments['']) # dir_ = os.path.dirname(path_file)