diff --git a/plugins/Full_CI/tree_dependency.png b/plugins/Full_CI/tree_dependency.png index 7696fea7..90005d70 100644 Binary files a/plugins/Full_CI/tree_dependency.png and b/plugins/Full_CI/tree_dependency.png differ diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 21f133e5..0af71bc3 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -1,13 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Create the NEEDED_MODULE - aka the genealogy (children module, subchildren module and so on), -of a NEEDED_CHILDREN_MODULES file +Module utilitary Usage: - module_handler.py print_descendant [] - module_handler.py create_png [] + module_handler.py print_descendant [...] + module_handler.py create_png [...] + module_handler.py clean [...] Options: print_descendant Print the genealogy of the NEEDED_CHILDREN_MODULES @@ -29,6 +28,10 @@ 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")) + + def get_dict_child(l_root_abs=None): """Loop over MODULE in QP_ROOT/src, open all the NEEDED_CHILDREN_MODULES and create a dict[MODULE] = [sub module needed, ...] @@ -200,19 +203,26 @@ if __name__ == '__main__': arguments = docopt(__doc__) - if not arguments['']: + if not arguments['']: dir_ = os.getcwd() + l_module = [os.path.basename(dir_)] else: - path_file = os.path.abspath(arguments['']) - path_file = os.path.expanduser(path_file) - path_file = os.path.expandvars(path_file) - dir_ = os.path.dirname(path_file) + l_module = arguments[''] +# else: +# path_file = os.path.abspath(arguments['']) +# dir_ = os.path.dirname(path_file) +# - path_file = os.path.basename(dir_) m = ModuleHandler() if arguments['print_descendant']: - print " ".join(sorted(m.l_module)) + + for module in l_module: + print " ".join(sorted(m.l_descendant_unique([module]))) if arguments["create_png"]: - m.create_png([path_file]) + m.create_png(l_module) + + if arguments["clean"]: + for i in arguments['']: + print i.is_module()