[update-product-data] Allow disabling auto configuration (#482)

This commit is contained in:
Marc Wrobel
2025-08-02 15:01:47 +02:00
committed by GitHub
parent b2f4028314
commit 3f65ff9d9e
5 changed files with 44 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import re
from bs4 import BeautifulSoup
from common import dates, http
from common.releasedata import ProductData, config_from_argv
@@ -10,7 +11,7 @@ VERSION_AND_DATE_PATTERN = re.compile(r"Release Date[,|:]? (.*?)\).*?Build Numbe
config = config_from_argv()
with ProductData(config.product) as product_data:
html = http.fetch_html(config.url)
html = BeautifulSoup(http.fetch_javascript_url(config.url), "html5lib")
for p in html.findAll("div", class_="text"):
version_and_date_str = p.get_text().strip().replace('\xa0', ' ')

View File

@@ -71,6 +71,9 @@ class ProductFrontmatter:
def has_auto_configs(self) -> bool:
return self.data and "methods" in self.data.get("auto", {})
def is_auto_update_disabled(self) -> bool:
return self.data.get("auto", {}).get("disabled", False)
def is_auto_update_cumulative(self) -> bool:
return self.data.get("auto", {}).get("cumulative", False)