2014-12-12 09:42:40 -06:00
|
|
|
#!/usr/bin/env python
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2014-12-15 17:22:38 -06:00
|
|
|
import optparse
|
2014-12-12 09:42:40 -06:00
|
|
|
import re
|
|
|
|
|
2023-07-24 18:22:54 -05:00
|
|
|
from utils import read_file, write_file
|
|
|
|
|
2014-12-12 09:42:40 -06:00
|
|
|
|
|
|
|
def main():
|
2014-12-15 17:22:38 -06:00
|
|
|
parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
|
|
|
|
options, args = parser.parse_args()
|
|
|
|
if len(args) != 2:
|
|
|
|
parser.error('Expected an input and an output filename')
|
|
|
|
|
|
|
|
infile, outfile = args
|
|
|
|
|
2023-07-24 18:22:54 -05:00
|
|
|
readme = read_file(infile)
|
2014-12-12 09:42:40 -06:00
|
|
|
|
|
|
|
bug_text = re.search(
|
|
|
|
r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
|
|
|
|
dev_text = re.search(
|
2014-12-12 09:47:22 -06:00
|
|
|
r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL',
|
|
|
|
readme).group(1)
|
2014-12-12 09:42:40 -06:00
|
|
|
|
|
|
|
out = bug_text + dev_text
|
|
|
|
|
2023-07-24 18:22:54 -05:00
|
|
|
write_file(outfile, out)
|
2014-12-12 09:42:40 -06:00
|
|
|
|
2016-11-17 05:42:56 -06:00
|
|
|
|
2014-12-12 09:42:40 -06:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|