about summary refs log tree commit diff
path: root/devscripts/make_readme.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-07-25 00:22:54 +0100
committerdirkf <fieldhouse@gmx.net>2023-07-25 13:19:43 +0100
commitb87018122995acb7e6a1be3f2464605259b93611 (patch)
tree11f47d8a9d8e32e04cf5eca2fa9c82448fff49e9 /devscripts/make_readme.py
parenta25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (diff)
downloadyoutube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.gz
youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.xz
youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.zip
[build] Extend use of `devscripts/utils`
Diffstat (limited to 'devscripts/make_readme.py')
-rwxr-xr-xdevscripts/make_readme.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/devscripts/make_readme.py b/devscripts/make_readme.py
index c5d5dd4f1..7a5b04dcc 100755
--- a/devscripts/make_readme.py
+++ b/devscripts/make_readme.py
@@ -1,9 +1,13 @@
 from __future__ import unicode_literals
 
-import io
-import sys
+import os.path
 import re
+import sys
+dirn = os.path.dirname
+
+sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
 
+from utils import read_file
 from youtube_dl.compat import compat_open as open
 
 README_FILE = 'README.md'
@@ -12,8 +16,7 @@ helptext = sys.stdin.read()
 if isinstance(helptext, bytes):
     helptext = helptext.decode('utf-8')
 
-with io.open(README_FILE, encoding='utf-8') as f:
-    oldreadme = f.read()
+oldreadme = read_file(README_FILE)
 
 header = oldreadme[:oldreadme.index('# OPTIONS')]
 footer = oldreadme[oldreadme.index('# CONFIGURATION'):]