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.

20 lines
466 B

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