From 43cc390cb4bd3b1ae0d6d6ac4f8c23ea3aa119c4 Mon Sep 17 00:00:00 2001 From: Simon O'Dwyer Date: Fri, 23 Mar 2018 18:06:54 +0100 Subject: [PATCH] load build config file from directory where the running python script is located --- gooey/python_bindings/gooey_decorator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gooey/python_bindings/gooey_decorator.py b/gooey/python_bindings/gooey_decorator.py index 275a252..75450e3 100644 --- a/gooey/python_bindings/gooey_decorator.py +++ b/gooey/python_bindings/gooey_decorator.py @@ -58,7 +58,9 @@ def Gooey(f=None, build_spec = None if load_build_config: try: - build_spec = json.load(open(load_build_config, "r")) + exec_dir = os.path.dirname(sys.argv[0]) + open_path = os.path.join(exec_dir,load_build_config) + build_spec = json.load(open(open_path, "r")) except Exception as e: print( 'Exception loading Build Config from {0}: {1}'.format(load_build_config, e)) sys.exit(1)