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,20 +1,21 @@
import re
from common import dates, http, releasedata
from common import dates, http
from common.releasedata import ProductData, config_from_argv
DATE_PATTERN = re.compile(r"\d{4}-\d{2}-\d{2}")
for config in releasedata.list_configs_from_argv():
with releasedata.ProductData(config.product) as product_data:
wikicode = http.fetch_markdown(config.url)
config = config_from_argv()
with ProductData(config.product) as product_data:
wikicode = http.fetch_markdown(config.url)
for tr in wikicode.ifilter_tags(matches=lambda node: node.tag == "tr"):
items = tr.contents.filter_tags(matches=lambda node: node.tag == "td")
if len(items) < 2:
continue
for tr in wikicode.ifilter_tags(matches=lambda node: node.tag == "tr"):
items = tr.contents.filter_tags(matches=lambda node: node.tag == "td")
if len(items) < 2:
continue
version = items[0].__strip__()
date_str = items[1].__strip__()
if config.first_match(version) and DATE_PATTERN.match(date_str):
date = dates.parse_date(date_str)
product_data.declare_version(version, date)
version = items[0].__strip__()
date_str = items[1].__strip__()
if config.first_match(version) and DATE_PATTERN.match(date_str):
date = dates.parse_date(date_str)
product_data.declare_version(version, date)