- remove the use of environment variables to get directory paths, - make use of arguments / argparse instead of environment variables in `update.py` and `report.py`, - automatically guess the data directory in `latest.py` based on the script's location, - propagate log level to auto scripts, - move `list_configs_from_argv` from `endoflife` module to `releasedata` module, - use `list_products` in `latest.py` to load the product's frontmatters.
20 lines
678 B
Python
20 lines
678 B
Python
import logging
|
|
|
|
from common import dates, http, releasedata
|
|
|
|
for config in releasedata.list_configs_from_argv():
|
|
with releasedata.ProductData(config.product) as product_data:
|
|
html = http.fetch_html(config.url)
|
|
|
|
ul = html.find("h2").find_next("ul")
|
|
for li in ul.find_all("li"):
|
|
text = li.get_text(strip=True)
|
|
match = config.first_match(text)
|
|
if not match:
|
|
logging.info(f"Skipping {text}, does not match any regex")
|
|
continue
|
|
|
|
version = match.group("version")
|
|
date = dates.parse_date(match.group("date"))
|
|
product_data.declare_version(version, date)
|