Simplify argument parsing (#459)

With the current state of automation scripts, this is not possible anymore to launch script with multiple auto configs.
This commit is contained in:
Marc Wrobel
2025-07-06 22:42:01 +02:00
committed by GitHub
parent b105939f93
commit 391d65ad8a
61 changed files with 1091 additions and 1032 deletions

View File

@@ -1,6 +1,7 @@
import logging
from common import dates, http, releasedata
from common import dates, http
from common.releasedata import ProductData, config_from_argv
"""Fetches Amazon RDS versions from the version management pages on AWS docs.
@@ -8,22 +9,22 @@ Pages parsed by this script are expected to have version tables with a version i
in the third column (usually named 'RDS release date').
"""
for config in releasedata.list_configs_from_argv():
with releasedata.ProductData(config.product) as product_data:
html = http.fetch_html(config.url)
config = config_from_argv()
with ProductData(config.product) as product_data:
html = http.fetch_html(config.url)
for table in html.find_all("table"):
for row in table.find_all("tr"):
columns = row.find_all("td")
if len(columns) <= 3:
continue
for table in html.find_all("table"):
for row in table.find_all("tr"):
columns = row.find_all("td")
if len(columns) <= 3:
continue
version_text = columns[0].text.strip()
version_match = config.first_match(version_text)
if not version_match:
logging.warning(f"Skipping {version_text}: does not match any version pattern")
continue
version_text = columns[0].text.strip()
version_match = config.first_match(version_text)
if not version_match:
logging.warning(f"Skipping {version_text}: does not match any version pattern")
continue
version = config.render(version_match)
date = dates.parse_date(columns[2].text)
product_data.declare_version(version, date)
version = config.render(version_match)
date = dates.parse_date(columns[2].text)
product_data.declare_version(version, date)