Ejemplo n.º 1
0
def do_build_script(module_path):
  with open(module_path, 'r') as f:
    if not source_parser.has_argparse(f.read()):
      raise AssertionError('Argparse not found in module. Unable to continue')

  gooey_config = config_generator.create_from_parser(module_path, show_config=True)
  outfile = os.path.join(os.getcwd(), 'gooey_config.json')

  print 'Writing config file to: {}'.format(outfile)

  with open(outfile, 'w') as f:
    f.write(json.dumps(gooey_config, indent=2))
Ejemplo n.º 2
0
def build_spec_subparser(subparser):
  return config_generator.create_from_parser(subparser, sys.argv[0])
Ejemplo n.º 3
0
def build_spec(complete_parser):
  return config_generator.create_from_parser(complete_parser, sys.argv[0])