diff --git a/gooey/python_bindings/gooey_decorator.py b/gooey/python_bindings/gooey_decorator.py index 4850fbd..f4b7122 100644 --- a/gooey/python_bindings/gooey_decorator.py +++ b/gooey/python_bindings/gooey_decorator.py @@ -32,6 +32,7 @@ def Gooey(f=None, required_cols=2, optional_cols=2, dump_build_config=False, + load_build_config=None, monospace_display=False): ''' Decorator for client code's main function. @@ -43,7 +44,16 @@ def Gooey(f=None, def build(payload): def run_gooey(self, args=None, namespace=None): source_path = sys.argv[0] - build_spec = config_generator.create_from_parser(self, source_path, payload_name=payload.__name__, **params) + + build_spec = None + if load_build_config: + try: + build_spec = json.load(open(load_build_config, "r")) + except Exception, e: + print( 'Exception loading Build Config from {0}: {1}'.format(load_build_config, e)) + + if not build_spec: + build_spec = config_generator.create_from_parser(self, source_path, payload_name=payload.__name__, **params) if dump_build_config: config_path = os.path.join(os.getcwd(), 'gooey_config.json')