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 re
|
||||
from bs4 import BeautifulSoup
|
||||
from common import endoflife
|
||||
@@ -97,8 +96,7 @@ for url in URLS:
|
||||
|
||||
|
||||
for k in CONFIG.keys():
|
||||
with open("releases/%s.json" % k, "w") as f:
|
||||
data = {v: d.strftime("%Y-%m-%d") for v, d in release_lists[k].items()}
|
||||
f.write(json.dumps(data, indent=2))
|
||||
releases = {v: d.strftime("%Y-%m-%d") for v, d in release_lists[k].items()}
|
||||
endoflife.write_releases(k, releases)
|
||||
|
||||
print("::endgroup::")
|
||||
|
||||
Reference in New Issue
Block a user