From fdc415b4a2245c0218fa54c0ef27f24f529af9c2 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 4 May 2015 15:03:53 +0200 Subject: [PATCH] Rename only_children... into module_handler.py --- scripts/check_dependencies.sh | 5 +++-- scripts/clean_modules.sh | 3 ++- ..._to_all_genealogy.py => module_handler.py} | 22 +++++++++++-------- scripts/qp_include.sh | 3 ++- src/Makefile.common | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) rename scripts/module/{only_children_to_all_genealogy.py => module_handler.py} (86%) diff --git a/scripts/check_dependencies.sh b/scripts/check_dependencies.sh index e1149d2d..37e9ba00 100755 --- a/scripts/check_dependencies.sh +++ b/scripts/check_dependencies.sh @@ -25,7 +25,8 @@ fi if [[ $1 == "-" ]] then - COMMAND_LINE=$(only_children_to_all_genealogy.py NEEDED_MODULES) + + COMMAND_LINE=$(module_handler.py print_genealogy NEEDED_MODULES) else COMMAND_LINE=$(unique_list $@) fi @@ -44,7 +45,7 @@ DEPS_LONG="" for i in $COMMAND_LINE do DEPS_LONG+=" $i " - DEPS_LONG+=$(only_children_to_all_genealogy.py "${QPACKAGE_ROOT}/src/${i}/NEEDED_MODULES") + DEPS_LONG+=$(module_handler.py print_genealogy "${QPACKAGE_ROOT}/src/${i}/NEEDED_MODULES") done DEPS=$(unique_list $DEPS_LONG) diff --git a/scripts/clean_modules.sh b/scripts/clean_modules.sh index e51bbede..608e0161 100755 --- a/scripts/clean_modules.sh +++ b/scripts/clean_modules.sh @@ -13,7 +13,8 @@ source ${QPACKAGE_ROOT}/scripts/qp_include.sh function do_clean() { rm -rf -- \ - IRPF90_temp IRPF90_man Makefile.depend $(only_children_to_all_genealogy.py) include \ + IRPF90_temp IRPF90_man Makefile.depend \ + $(module_handler.py print_genealogy) include \ ezfio_interface.irp.f irpf90.make irpf90_entities tags $(ls_exe) *.mod } diff --git a/scripts/module/only_children_to_all_genealogy.py b/scripts/module/module_handler.py similarity index 86% rename from scripts/module/only_children_to_all_genealogy.py rename to scripts/module/module_handler.py index 564bbe4b..1bb91253 100755 --- a/scripts/module/only_children_to_all_genealogy.py +++ b/scripts/module/module_handler.py @@ -2,16 +2,19 @@ # -*- coding: utf-8 -*- """ -Create the NEEDED_MODULE aka the genealogy (children module, subchildren module and so on), +Create the NEEDED_MODULE + aka the genealogy (children module, subchildren module and so on), of a NEEDED_CHILDREN_MODULES file Usage: - only_children_to_all_genealogy.py [] - [--create_png] + module_handler.py print_genealogy [] + module_handler.py create_png [] -Help: - If NEEDED_CHILDREN_MODULES is not set, check the current pwd - Same for create_png. +Options: + print_genealogy Print the genealogy of the NEEDED_CHILDREN_MODULES + aka (children, subchildren, etc) + if NEEDED_CHILDREN_MODULES + try to open it in the current path """ from docopt import docopt @@ -180,8 +183,9 @@ if __name__ == '__main__': path = os.path.expanduser(path) path = os.path.expandvars(path) - l_all_needed_molule = module_genealogy(path) - print " ".join(sorted(l_all_needed_molule)) + if arguments['print_genealogy']: + l_all_needed_molule = module_genealogy(path) + print " ".join(sorted(l_all_needed_molule)) - if arguments["--create_png"]: + if arguments["create_png"]: create_png_from_path(path) diff --git a/scripts/qp_include.sh b/scripts/qp_include.sh index 04cc6a17..8e2d4f9f 100644 --- a/scripts/qp_include.sh +++ b/scripts/qp_include.sh @@ -35,9 +35,10 @@ function check_current_dir_is_module() exit -1 fi } + if [[ -f NEEDED_CHILDREN_MODULES ]] then - NEEDED_MODULES=$(only_children_to_all_genealogy.py) + NEEDED_MODULES=$(module_handler.py print_genealogy NEEDED_CHILDREN_MODULES) fi # List of executables in the current directory diff --git a/src/Makefile.common b/src/Makefile.common index cd98329e..606e6f7c 100644 --- a/src/Makefile.common +++ b/src/Makefile.common @@ -19,7 +19,7 @@ default: all .gitignore include $(QPACKAGE_ROOT)/src/Makefile.config # Create the NEEDED_CHILDREN_MODULES variable, needed for IRPF90 -NEEDED_CHILDREN_MODULES=$(shell only_children_to_all_genealogy.py) +NEEDED_CHILDREN_MODULES=$(shell module_handler.py print_genealogy) # Check and update dependencies include Makefile.depend