diff --git a/gooey/python_bindings/config_generator.py b/gooey/python_bindings/config_generator.py index f422e36..036467b 100644 --- a/gooey/python_bindings/config_generator.py +++ b/gooey/python_bindings/config_generator.py @@ -1,4 +1,5 @@ import os +import sys import argparse_to_json from gooey.gui.windows import layouts from gooey.python_bindings import source_parser @@ -12,7 +13,7 @@ def create_from_parser(parser, source_path, **kwargs): build_spec = { 'language': kwargs.get('language', 'english'), 'target': run_cmd, - 'program_name': kwargs.get('program_name') or os.path.basename(source_path).replace('.py', ''), + 'program_name': kwargs.get('program_name') or os.path.basename(sys.argv[0]).replace('.py', ''), 'program_description': kwargs.get('program_description', ''), 'show_config': show_config, 'show_advanced': kwargs.get('show_advanced', True), diff --git a/gooey/python_bindings/gooey_decorator.py b/gooey/python_bindings/gooey_decorator.py index 424aebe..bbb8364 100644 --- a/gooey/python_bindings/gooey_decorator.py +++ b/gooey/python_bindings/gooey_decorator.py @@ -120,7 +120,7 @@ def Gooey(f=None, def inner2(*args, **kwargs): ArgumentParser.original_parse_args = ArgumentParser.parse_args ArgumentParser.parse_args = run_gooey - return f(*args, **kwargs) + return payload(*args, **kwargs) inner2.__name__ = payload.__name__ return inner2