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:
@@ -1,19 +1,20 @@
|
||||
import logging
|
||||
|
||||
from common import dates, http, releasedata
|
||||
from common import dates, http
|
||||
from common.releasedata import ProductData, config_from_argv
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
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)
|
||||
version = match.group("version")
|
||||
date = dates.parse_date(match.group("date"))
|
||||
product_data.declare_version(version, date)
|
||||
|
||||
Reference in New Issue
Block a user