Refactor product releases writing
Create a common function to write resulting JSON files to the releases directory. It makes this task simpler to read and maintain, while making it modifiable at a central point in the future. One example of such modification could be the sorting of the versions in a uniform way for all the scripts.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import datetime
|
||||
import json
|
||||
import markdown
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
@@ -32,7 +31,5 @@ def parse_platforms_page():
|
||||
return all_versions
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
versions = parse_platforms_page()
|
||||
with open("releases/eks.json", "w") as f:
|
||||
f.write(json.dumps(versions, indent=2))
|
||||
versions = parse_platforms_page()
|
||||
endoflife.write_releases('eks', versions)
|
||||
|
||||
Reference in New Issue
Block a user