[update-product-data] Allow disabling auto configuration (#482)
This commit is contained in:
@@ -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', ' ')
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user