[virtualbox-version] Add method (#480)
Track versions using https://download.virtualbox.org/virtualbox/. Also rename virtualbox to virtualbox-releases. --------- Co-authored-by: Marc Wrobel <marc.wrobel@gmail.com>
This commit is contained in:
@@ -12,7 +12,6 @@ config = config_from_argv()
|
||||
with ProductData(config.product) as product_data:
|
||||
html = http.fetch_html(config.url)
|
||||
|
||||
|
||||
for li in html.select_one("#DownloadVirtualBoxOldBuilds + ul").find_all("li"):
|
||||
li_text = li.find("a").text.strip()
|
||||
|
||||
18
src/virtualbox-versions.py
Normal file
18
src/virtualbox-versions.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from common import dates, http
|
||||
from common.releasedata import ProductData, config_from_argv
|
||||
|
||||
"""Fetches versions from download.virtualbox.org."""
|
||||
|
||||
config = config_from_argv()
|
||||
with ProductData(config.product) as product_data:
|
||||
html = http.fetch_html(config.url)
|
||||
|
||||
for a in html.select("a"):
|
||||
href = a["href"]
|
||||
|
||||
version_match = config.first_match(href)
|
||||
if version_match:
|
||||
version = config.render(version_match)
|
||||
date_str = a.next_sibling.strip().split(" ")[0]
|
||||
date = dates.parse_date(date_str)
|
||||
product_data.declare_version(version, date)
|
||||
Reference in New Issue
Block a user