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,40 +1,41 @@
import logging
from common import dates, http, releasedata
from common import dates, http
from common.releasedata import ProductData, config_from_argv
"""Fetches RedHat JBoss EAP version data for JBoss 7"""
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 h4 in html.find_all("h4"):
title = h4.get_text(strip=True)
if not title.startswith("7."):
for h4 in html.find_all("h4"):
title = h4.get_text(strip=True)
if not title.startswith("7."):
continue
release = title[:3]
version_table = h4.find_next("table")
if not version_table:
logging.warning(f"Version table not found for {title}")
continue
for (i, row) in enumerate(version_table.find_all("tr")):
if i == 0: # Skip the first row (header)
continue
release = title[:3]
version_table = h4.find_next("table")
if not version_table:
logging.warning(f"Version table not found for {title}")
columns = row.find_all("td")
# Get the version name without the content of the <sup> tag, if present
name_str = ''.join([content for content in columns[0].contents if isinstance(content, str)]).strip()
date_str = columns[1].text.strip()
if date_str == "TBD" or date_str == "TDB": # Placeholder for a future release
continue
for (i, row) in enumerate(version_table.find_all("tr")):
if i == 0: # Skip the first row (header)
continue
if date_str == "[July 21, 2021][d7400]":
# Temporary fix for a typo in the source page
date_str = "July 21 2021"
columns = row.find_all("td")
# Get the version name without the content of the <sup> tag, if present
name_str = ''.join([content for content in columns[0].contents if isinstance(content, str)]).strip()
date_str = columns[1].text.strip()
if date_str == "TBD" or date_str == "TDB": # Placeholder for a future release
continue
if date_str == "[July 21, 2021][d7400]":
# Temporary fix for a typo in the source page
date_str = "July 21 2021"
name = name_str.replace("GA", "Update 0").replace("Update ", release + ".")
date = dates.parse_date(date_str)
product_data.declare_version(name, date)
name = name_str.replace("GA", "Update 0").replace("Update ", release + ".")
date = dates.parse_date(date_str)
product_data.declare_version(name, date)