You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
795 B

  1. #!/usr/bin/env python
  2. from __future__ import unicode_literals
  3. import io
  4. import optparse
  5. def main():
  6. parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
  7. options, args = parser.parse_args()
  8. if len(args) != 2:
  9. parser.error('Expected an input and an output filename')
  10. infile, outfile = args
  11. with io.open(infile, encoding='utf-8') as inf:
  12. issue_template_tmpl = inf.read()
  13. # Get the version from youtube_dl/version.py without importing the package
  14. exec(compile(open('youtube_dl/version.py').read(),
  15. 'youtube_dl/version.py', 'exec'))
  16. out = issue_template_tmpl % {'version': locals()['__version__']}
  17. with io.open(outfile, 'w', encoding='utf-8') as outf:
  18. outf.write(out)
  19. if __name__ == '__main__':
  20. main()