def main()

in jsonnet/stamper.py [0:0]


def main():
  args = parser.parse_args()

  # Read our stamp variable files.
  format_args = {}
  for infofile in args.stamp_info_file or []:
    with open(infofile) as info:
      for line in info:
        line = line.strip('\n')
        if not line:
          continue
        elts = line.split(' ', 1)
        if len(elts) != 2:
          raise Exception('Malformed line: %s' % line)
        (key, value) = elts
        if key in format_args:
          print ('WARNING: Duplicate value for key "%s": '
                 'using "%s"' % (key, value))
        format_args[key] = value
  with open(args.output, 'w') as f:
    f.write(args.format.format(**format_args))