Improve HTTP handling in scripts (#449)

Provide some helper methods to hide the complexity of parsing HTML, JSON, YAML, XML or Markdown.
This commit is contained in:
Marc Wrobel
2025-06-28 11:46:04 +02:00
parent fda4967c38
commit 312ce078bb
43 changed files with 103 additions and 137 deletions

View File

@@ -1,6 +1,5 @@
import logging
import yaml
from common import dates, endoflife, http, releasedata
"""Fetch version data for Kuma from https://raw.githubusercontent.com/kumahq/kuma/master/versions.yml.
@@ -12,8 +11,7 @@ EOL_FIELD = 'endOfLifeDate'
for config in endoflife.list_configs_from_argv():
with releasedata.ProductData(config.product) as product_data:
yml_response = http.fetch_url(config.url)
versions_data = yaml.safe_load(yml_response.text)
versions_data = http.fetch_yaml(config.url)
# Iterate through the versions and their associated dates
for version_info in versions_data: