]> jfr.im git - yt-dlp.git/blame - devscripts/make_issue_template.py
[lazy_extractors] Fix for search IEs
[yt-dlp.git] / devscripts / make_issue_template.py
CommitLineData
cc52de43 1#!/usr/bin/env python3
7710bdf4
SO
2from __future__ import unicode_literals
3
4import io
5import optparse
7710bdf4
SO
6
7
8def main():
3bf1df51 9 parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
7710bdf4 10 options, args = parser.parse_args()
3bf1df51
S
11 if len(args) != 2:
12 parser.error('Expected an input and an output filename')
7710bdf4 13
3bf1df51
S
14 infile, outfile = args
15
16 with io.open(infile, encoding='utf-8') as inf:
17 issue_template_tmpl = inf.read()
7710bdf4 18
7a5c1cfe
P
19 # Get the version from yt_dlp/version.py without importing the package
20 exec(compile(open('yt_dlp/version.py').read(),
21 'yt_dlp/version.py', 'exec'))
7710bdf4 22
7168a6c8 23 out = issue_template_tmpl % {'version': locals()['__version__']}
7710bdf4 24
3bf1df51
S
25 with io.open(outfile, 'w', encoding='utf-8') as outf:
26 outf.write(out)
7710bdf4
SO
27
28if __name__ == '__main__':
29 main()