You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
506 B

  1. from __future__ import unicode_literals
  2. import io
  3. import os.path
  4. import sys
  5. import re
  6. ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  7. README_FILE = os.path.join(ROOT_DIR, 'README.md')
  8. with io.open(README_FILE, encoding='utf-8') as f:
  9. readme = f.read()
  10. PREFIX = '%YOUTUBE-DL(1)\n\n# NAME\n'
  11. readme = re.sub(r'(?s)# INSTALLATION.*?(?=# DESCRIPTION)', '', readme)
  12. readme = PREFIX + readme
  13. if sys.version_info < (3, 0):
  14. print(readme.encode('utf-8'))
  15. else:
  16. print(readme)