import argparse
from gooey import Gooey

@Gooey(poll_external_updates=True, dump_build_config=True)
def main():

    parser = argparse.ArgumentParser(description='Process some integers.')
    parser.add_argument('integers', metavar='N', type=int, nargs='+',
                       help='an integer for the accumulator',
                        default='')
    parser.add_argument('-foo', type=int, nargs='+',
                        help='fooobie',
                        default='')
    parser.add_argument('--sum', dest='accumulate', action='store_const',
                       const=sum, default=max,
                       help='sum the integers (default: find the max)')

    args = parser.parse_args()
    print( args.accumulate(args.integers))

if __name__=="__main__":
    import sys
    import json
    if 'gooey-seed-ui' in sys.argv:
        print(json.dumps({'integers': '666'}))
    else:
        main()
