logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

make_issue_template.py (795B)


  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()