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