From b87018122995acb7e6a1be3f2464605259b93611 Mon Sep 17 00:00:00 2001 From: dirkf Date: Tue, 25 Jul 2023 00:22:54 +0100 Subject: [build] Extend use of `devscripts/utils` --- devscripts/make_supportedsites.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'devscripts/make_supportedsites.py') diff --git a/devscripts/make_supportedsites.py b/devscripts/make_supportedsites.py index 764795bc5..c424d18d7 100644 --- a/devscripts/make_supportedsites.py +++ b/devscripts/make_supportedsites.py @@ -1,17 +1,19 @@ #!/usr/bin/env python from __future__ import unicode_literals -import io import optparse -import os +import os.path import sys - # Import youtube_dl -ROOT_DIR = os.path.join(os.path.dirname(__file__), '..') -sys.path.insert(0, ROOT_DIR) +dirn = os.path.dirname + +sys.path.insert(0, dirn(dirn(os.path.abspath(__file__)))) + import youtube_dl +from utils import write_file + def main(): parser = optparse.OptionParser(usage='%prog OUTFILE.md') @@ -38,8 +40,7 @@ def main(): ' - ' + md + '\n' for md in gen_ies_md(ies)) - with io.open(outfile, 'w', encoding='utf-8') as outf: - outf.write(out) + write_file(outfile, out) if __name__ == '__main__': -- cgit v1.2.3