make_issue_template.py 570 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. from __future__ import unicode_literals
  3. import optparse
  4. import os.path
  5. import sys
  6. from utils import read_file, read_version, write_file
  7. def main():
  8. parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
  9. options, args = parser.parse_args()
  10. if len(args) != 2:
  11. parser.error('Expected an input and an output filename')
  12. infile, outfile = args
  13. issue_template_tmpl = read_file(infile)
  14. out = issue_template_tmpl % {'version': read_version()}
  15. write_file(outfile, out)
  16. if __name__ == '__main__':
  17. main()