From 0199fc1374b8871b48f93e070a96ad9514a9d299 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 4 May 2015 14:44:30 +0200 Subject: [PATCH] Add error message to only_children_to... --- scripts/module/only_children_to_all_genealogy.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/module/only_children_to_all_genealogy.py b/scripts/module/only_children_to_all_genealogy.py index f330cf97..564bbe4b 100755 --- a/scripts/module/only_children_to_all_genealogy.py +++ b/scripts/module/only_children_to_all_genealogy.py @@ -6,7 +6,8 @@ Create the NEEDED_MODULE aka the genealogy (children module, subchildren module of a NEEDED_CHILDREN_MODULES file Usage: - only_children_to_all_genealogy.py [--create_png] [] + only_children_to_all_genealogy.py [] + [--create_png] Help: If NEEDED_CHILDREN_MODULES is not set, check the current pwd @@ -16,6 +17,7 @@ Help: from docopt import docopt import os +import sys import os.path from functools import wraps @@ -87,7 +89,12 @@ def get_it_and_children(l_module): for module in l_module: if module not in l: l.append(module) - l.extend(get_it_and_children(d_ref[module])) + try: + l.extend(get_it_and_children(d_ref[module])) + except KeyError: + print >> sys.stderr, "`{0}` in not a good submodule name".format(module) + print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES" + sys.exit(1) return list(set(l))