From aa2166bf1efdd95b6784d46b4bd0c3a0e0993092 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Thu, 16 Jul 2015 12:15:07 +0200 Subject: [PATCH] Beter error handler --- scripts/compilation/qp_create_ninja.py | 19 ++++--------------- scripts/module/module_handler.py | 7 ++++--- scripts/module/qp_install_module.py | 3 +-- src/.gitignore | 4 +++- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index fd4d6a10..1a7a5c16 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -669,25 +669,14 @@ def ninja_binaries_build(path_module, l_children, d_binaries): " module_abs = {0}".format(path_module.abs), " module_rel = {0}".format(path_module.rel), ""] - l_string += ["build module_{0}: phony {1}".format(path_module.rel, - " ".join(l_abs_bin)), ""] + l_string += ["build module_{0}: phony {1} {2}".format(path_module.rel, + " ".join(l_abs_bin), + os.path.join(path_module.abs,"README.rst")), + ""] return l_string -# -# |\/| _ _| | _ -# | | (_) (_| |_| | (/_ -# -def create_module_ninja(): - """ - In a module create a build.ninja - """ - - l_string = ["rule all:"] - return l_string - - # ___ # | ._ _ _ _| _ ._ _ ._ _| _ ._ _ o _ _ # | | (/_ (/_ (_| (/_ |_) (/_ | | (_| (/_ | | (_ | (/_ _> diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 389d8c47..ee7f068c 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -82,9 +82,10 @@ def get_l_module_descendant(d_child, l_module): try: l.extend(get_l_module_descendant(d_child, d_child[module])) except KeyError: - print >> sys.stderr, "`{0}` not submodule".format(module) - print >> sys.stderr, "Check the corresponding NEEDED_CHILDREN_MODULES" - raise + print >> sys.stderr, "Error: " + print >> sys.stderr, "`{0}` is not a submodule".format(module) + print >> sys.stderr, "Check the typo (orthograph, case, '/', etc.) " + sys.exit(1) return list(set(l)) diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index 235f9db6..2f6d8305 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -25,7 +25,7 @@ try: from update_README import Doc_key, Needed_key from qp_path import QP_SRC, QP_PLUGINS except ImportError: - print "Please check if you have source the .quantum_package.rc" + print "Please check if you have sourced the .quantum_package.rc" print "(`source .quantum_package.rc`)" print sys.exit(1) @@ -160,7 +160,6 @@ if __name__ == '__main__': print "Your src directory is broken. Please remove %s" % des raise try: - import subprocess subprocess.check_call(["qp_create_ninja.py", "update"]) except: raise diff --git a/src/.gitignore b/src/.gitignore index 1e9f0bc4..535e4bd5 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -23,4 +23,6 @@ QmcChem Selectors_full Selectors_no_sorted SingleRefMethod -Casino \ No newline at end of file +Casino +loc_cele +Alavi \ No newline at end of file