Fix a few Intellij IDEA warnings
This commit is contained in:
@@ -36,16 +36,16 @@ VERSION_PATTERNS = {
|
|||||||
],
|
],
|
||||||
"ios": [
|
"ios": [
|
||||||
re.compile(r"iOS\s+(?P<version>\d+)", re.MULTILINE),
|
re.compile(r"iOS\s+(?P<version>\d+)", re.MULTILINE),
|
||||||
re.compile(r"iOS\s+(?P<version>\d+(?:)(?:\.\d+)+)", re.MULTILINE),
|
re.compile(r"iOS\s+(?P<version>\d+(?:\.\d+)+)", re.MULTILINE),
|
||||||
re.compile(r"iPhone\s+v?(?P<version>\d+(?:)(?:\.\d+)+)", re.MULTILINE),
|
re.compile(r"iPhone\s+v?(?P<version>\d+(?:\.\d+)+)", re.MULTILINE),
|
||||||
],
|
],
|
||||||
"ipados": [
|
"ipados": [
|
||||||
re.compile(r"iPadOS\s+(?P<version>\d+)", re.MULTILINE),
|
re.compile(r"iPadOS\s+(?P<version>\d+)", re.MULTILINE),
|
||||||
re.compile(r"iPadOS\s+(?P<version>\d+(?:)(?:\.\d+)+)", re.MULTILINE),
|
re.compile(r"iPadOS\s+(?P<version>\d+(?:\.\d+)+)", re.MULTILINE),
|
||||||
],
|
],
|
||||||
"watchos": [
|
"watchos": [
|
||||||
re.compile(r"watchOS\s+(?P<version>\d+)", re.MULTILINE),
|
re.compile(r"watchOS\s+(?P<version>\d+)", re.MULTILINE),
|
||||||
re.compile(r"watchOS\s+(?P<version>\d+(?:)(?:\.\d+)+)", re.MULTILINE),
|
re.compile(r"watchOS\s+(?P<version>\d+(?:\.\d+)+)", re.MULTILINE),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class Product:
|
|||||||
if self.versions[version] != date:
|
if self.versions[version] != date:
|
||||||
logging.warning(f"overwriting version {version} ({self.versions[version]} -> {date}) for {self.name}")
|
logging.warning(f"overwriting version {version} ({self.versions[version]} -> {date}) for {self.name}")
|
||||||
else:
|
else:
|
||||||
return # already declared
|
return # already declared
|
||||||
|
|
||||||
logging.info(f"adding version {version} ({date}) to {self.name}")
|
logging.info(f"adding version {version} ({date}) to {self.name}")
|
||||||
self.versions[version] = date
|
self.versions[version] = date
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from common.git import Git
|
|||||||
"""Fetch Debian versions by parsing news in www.debian.org source repository."""
|
"""Fetch Debian versions by parsing news in www.debian.org source repository."""
|
||||||
|
|
||||||
|
|
||||||
def extract_major_versions(product: endoflife.Product, repo_dir: Path) -> None:
|
def extract_major_versions(p: endoflife.Product, repo_dir: Path) -> None:
|
||||||
child = run(
|
child = run(
|
||||||
f"grep -RhE -A 1 '<define-tag pagetitle>Debian [0-9]+.+</q> released' {repo_dir}/english/News "
|
f"grep -RhE -A 1 '<define-tag pagetitle>Debian [0-9]+.+</q> released' {repo_dir}/english/News "
|
||||||
f"| cut -d '<' -f 2 "
|
f"| cut -d '<' -f 2 "
|
||||||
@@ -22,11 +22,11 @@ def extract_major_versions(product: endoflife.Product, repo_dir: Path) -> None:
|
|||||||
version = line.split(" ")[1]
|
version = line.split(" ")[1]
|
||||||
is_release_line = False
|
is_release_line = False
|
||||||
else:
|
else:
|
||||||
product.declare_version(version, dates.parse_date(line))
|
p.declare_version(version, dates.parse_date(line))
|
||||||
is_release_line = True
|
is_release_line = True
|
||||||
|
|
||||||
|
|
||||||
def extract_point_versions(product: endoflife.Product, repo_dir: Path) -> None:
|
def extract_point_versions(p: endoflife.Product, repo_dir: Path) -> None:
|
||||||
child = run(
|
child = run(
|
||||||
f"grep -Rh -B 10 '<define-tag revision>' {repo_dir}/english/News "
|
f"grep -Rh -B 10 '<define-tag revision>' {repo_dir}/english/News "
|
||||||
"| grep -Eo '(release_date>(.*)<|revision>(.*)<)' "
|
"| grep -Eo '(release_date>(.*)<|revision>(.*)<)' "
|
||||||
@@ -38,7 +38,7 @@ def extract_point_versions(product: endoflife.Product, repo_dir: Path) -> None:
|
|||||||
|
|
||||||
for line in child.stdout.decode("utf-8").strip().split("\n"):
|
for line in child.stdout.decode("utf-8").strip().split("\n"):
|
||||||
(date, version) = line.split(' ')
|
(date, version) = line.split(' ')
|
||||||
product.declare_version(version, dates.parse_date(date))
|
p.declare_version(version, dates.parse_date(date))
|
||||||
|
|
||||||
|
|
||||||
product = endoflife.Product("debian")
|
product = endoflife.Product("debian")
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ Unfortunately images creation date cannot be retrieved, so we had to use the tag
|
|||||||
METHOD = "docker_hub"
|
METHOD = "docker_hub"
|
||||||
|
|
||||||
|
|
||||||
def fetch_releases(product: endoflife.Product, config: endoflife.AutoConfig, url: str) -> None:
|
def fetch_releases(p: endoflife.Product, c: endoflife.AutoConfig, url: str) -> None:
|
||||||
data = http.fetch_url(url).json()
|
data = http.fetch_url(url).json()
|
||||||
|
|
||||||
for result in data["results"]:
|
for result in data["results"]:
|
||||||
version_str = result["name"]
|
version_str = result["name"]
|
||||||
if config.first_match(version_str):
|
if c.first_match(version_str):
|
||||||
date = dates.parse_datetime(result["tag_last_pushed"])
|
date = dates.parse_datetime(result["tag_last_pushed"])
|
||||||
product.declare_version(version_str, date)
|
p.declare_version(version_str, date)
|
||||||
|
|
||||||
if data["next"]:
|
if data["next"]:
|
||||||
fetch_releases(product, config, data["next"])
|
fetch_releases(p, c, data["next"])
|
||||||
|
|
||||||
|
|
||||||
p_filter = sys.argv[1] if len(sys.argv) > 1 else None
|
p_filter = sys.argv[1] if len(sys.argv) > 1 else None
|
||||||
@@ -29,8 +29,7 @@ for product_name in endoflife.list_products(METHOD, p_filter):
|
|||||||
|
|
||||||
product_frontmatter = endoflife.ProductFrontmatter(product.name)
|
product_frontmatter = endoflife.ProductFrontmatter(product.name)
|
||||||
for config in product_frontmatter.get_auto_configs(METHOD):
|
for config in product_frontmatter.get_auto_configs(METHOD):
|
||||||
url = f"https://hub.docker.com/v2/repositories/{config.url}/tags?page_size=100&page=1"
|
fetch_releases(product, config, f"https://hub.docker.com/v2/repositories/{config.url}/tags?page_size=100&page=1")
|
||||||
fetch_releases(product, config, url)
|
|
||||||
|
|
||||||
product.write()
|
product.write()
|
||||||
print("::endgroup::")
|
print("::endgroup::")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ there is no entry for GA of version 18.0.18 and older."""
|
|||||||
product = endoflife.Product("plesk")
|
product = endoflife.Product("plesk")
|
||||||
print(f"::group::{product.name}")
|
print(f"::group::{product.name}")
|
||||||
response = http.fetch_url("https://docs.plesk.com/release-notes/obsidian/change-log")
|
response = http.fetch_url("https://docs.plesk.com/release-notes/obsidian/change-log")
|
||||||
soup = BeautifulSoup(response.text, features="html5lib")
|
soup = BeautifulSoup(response.text, features="html5lib")
|
||||||
|
|
||||||
for release in soup.find_all("div", class_="changelog-entry--obsidian"):
|
for release in soup.find_all("div", class_="changelog-entry--obsidian"):
|
||||||
version = release.h2.text.strip()
|
version = release.h2.text.strip()
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ all_versions = list(map(lambda option: option.attrs['value'], soup.select("selec
|
|||||||
latest_minor_versions = get_latest_minor_versions(all_versions)
|
latest_minor_versions = get_latest_minor_versions(all_versions)
|
||||||
latest_minor_versions_urls = [f"https://docs.splunk.com/Documentation/Splunk/{v}/ReleaseNotes/MeetSplunk" for v in latest_minor_versions]
|
latest_minor_versions_urls = [f"https://docs.splunk.com/Documentation/Splunk/{v}/ReleaseNotes/MeetSplunk" for v in latest_minor_versions]
|
||||||
for response in http.fetch_urls(latest_minor_versions_urls):
|
for response in http.fetch_urls(latest_minor_versions_urls):
|
||||||
for (version, date_str) in VERSION_DATE_PATTERN.findall(response.text):
|
for (version_str, date_str) in VERSION_DATE_PATTERN.findall(response.text):
|
||||||
version = f"{version}.0" if len(version.split(".")) == 2 else version # convert x.y to x.y.0
|
version_str = f"{version_str}.0" if len(version_str.split(".")) == 2 else version_str # convert x.y to x.y.0
|
||||||
date = dates.parse_date(date_str)
|
date = dates.parse_date(date_str)
|
||||||
product.declare_version(version, date)
|
product.declare_version(version_str, date)
|
||||||
|
|
||||||
product.write()
|
product.write()
|
||||||
print("::endgroup::")
|
print("::endgroup::")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ for v in data:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
version = v["version"]
|
version = v["version"]
|
||||||
date = dates.parse_datetime(v["date"], to_utc=False) # utc kept for now for backwards compatibility
|
date = dates.parse_datetime(v["date"], to_utc=False) # utc kept for now for backwards compatibility
|
||||||
product.declare_version(version, date)
|
product.declare_version(version, date)
|
||||||
|
|
||||||
product.write()
|
product.write()
|
||||||
|
|||||||
Reference in New Issue
Block a user