[CONTRIBUTING.md] Remove the section about embedding; that is not applicable for...
[youtube-dl] / devscripts / make_contributing.py
1 #!/usr/bin/env python
2 from __future__ import unicode_literals
3
4 import argparse
5 import io
6 import re
7
8
9 def main():
10     parser = argparse.ArgumentParser()
11     parser.add_argument(
12         'INFILE', help='README.md file name to read from')
13     parser.add_argument(
14         'OUTFILE', help='CONTRIBUTING.md file name to write to')
15     args = parser.parse_args()
16
17     with io.open(args.INFILE, encoding='utf-8') as inf:
18         readme = inf.read()
19
20     bug_text = re.search(
21         r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
22     dev_text = re.search(
23         r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL',
24         readme).group(1)
25
26     out = bug_text + dev_text
27
28     with io.open(args.OUTFILE, 'w', encoding='utf-8') as outf:
29         outf.write(out)
30
31 if __name__ == '__main__':
32     main()