]> Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/prepare_manpage.py
Merge tag 'upstream/2014.07.15'
[youtubedl] / devscripts / prepare_manpage.py
1
2 import io
3 import os.path
4 import sys
5 import re
6
7 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8 README_FILE = os.path.join(ROOT_DIR, 'README.md')
9
10 with io.open(README_FILE, encoding='utf-8') as f:
11 readme = f.read()
12
13 PREFIX = '%YOUTUBE-DL(1)\n\n# NAME\n'
14 readme = re.sub(r'(?s)# INSTALLATION.*?(?=# DESCRIPTION)', '', readme)
15 readme = PREFIX + readme
16
17 if sys.version_info < (3, 0):
18 print(readme.encode('utf-8'))
19 else:
20 print(readme)