diff options
author | dirkf <fieldhouse@gmx.net> | 2023-07-25 00:22:54 +0100 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2023-07-25 13:19:43 +0100 |
commit | b87018122995acb7e6a1be3f2464605259b93611 (patch) | |
tree | 11f47d8a9d8e32e04cf5eca2fa9c82448fff49e9 /devscripts/gh-pages/update-feed.py | |
parent | a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (diff) | |
download | youtube-dl-b87018122995acb7e6a1be3f2464605259b93611.tar.xz |
[build] Extend use of `devscripts/utils`
Diffstat (limited to 'devscripts/gh-pages/update-feed.py')
-rwxr-xr-x | devscripts/gh-pages/update-feed.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/devscripts/gh-pages/update-feed.py b/devscripts/gh-pages/update-feed.py index 506a62377..13a367d34 100755 --- a/devscripts/gh-pages/update-feed.py +++ b/devscripts/gh-pages/update-feed.py @@ -2,10 +2,16 @@ from __future__ import unicode_literals import datetime -import io import json +import os.path import textwrap +import sys +dirn = os.path.dirname + +sys.path.insert(0, dirn(dirn(os.path.abspath(__file__)))) + +from utils import write_file atom_template = textwrap.dedent("""\ <?xml version="1.0" encoding="utf-8"?> @@ -72,5 +78,4 @@ for v in versions: entries_str = textwrap.indent(''.join(entries), '\t') atom_template = atom_template.replace('@ENTRIES@', entries_str) -with io.open('update/releases.atom', 'w', encoding='utf-8') as atom_file: - atom_file.write(atom_template) +write_file('update/releases.atom', atom_template) |