[typo3] Refactor script (#250)
Make the script more readable, mostly by: - using the Product class, - a little bit of renaming and documentation.
This commit is contained in:
27
src/typo3.py
27
src/typo3.py
@@ -1,20 +1,17 @@
|
|||||||
import json
|
from common import dates
|
||||||
from common import http
|
|
||||||
from common import endoflife
|
from common import endoflife
|
||||||
|
from common import http
|
||||||
|
|
||||||
PRODUCT = "typo3"
|
product = endoflife.Product("typo3")
|
||||||
URL = "https://get.typo3.org/api/v1/release/"
|
print(f"::group::{product.name}")
|
||||||
|
data = http.fetch_url("https://get.typo3.org/api/v1/release/").json()
|
||||||
print(f"::group::{PRODUCT}")
|
|
||||||
versions = {}
|
|
||||||
|
|
||||||
response = http.fetch_url(URL)
|
|
||||||
data = json.loads(response.text)
|
|
||||||
for v in data:
|
for v in data:
|
||||||
if v['type'] != 'development':
|
if v['type'] == 'development':
|
||||||
date = v["date"][0:10]
|
continue
|
||||||
versions[v["version"]] = date
|
|
||||||
print(f"{v['version']}: {date}")
|
|
||||||
|
|
||||||
endoflife.write_releases(PRODUCT, versions)
|
version = v["version"]
|
||||||
|
date = dates.parse_datetime(v["date"], to_utc=False) # utc kept for now for backwards compatibility
|
||||||
|
product.declare_version(version, date)
|
||||||
|
|
||||||
|
product.write()
|
||||||
print("::endgroup::")
|
print("::endgroup::")
|
||||||
|
|||||||
Reference in New Issue
Block a user