feat: Qualification Matrix + QuickSpecs bundles (#5)
This commit was merged in pull request #5.
This commit is contained in:
+29
-2
@@ -39,9 +39,10 @@ class BundleSpec:
|
||||
title: str
|
||||
version: str | None
|
||||
product: str # e.g. "User Manual", "Release Notes", "Deployment Guide"
|
||||
mode: str # "toc" or "single"
|
||||
mode: str # "toc", "single", or "html-file" (committed fixture under scrape/quickspecs/)
|
||||
platform: str | None = None
|
||||
language: str = "en-US"
|
||||
source_url: str | None = None # overrides the default support.hpe.com URL
|
||||
|
||||
|
||||
# Declared bundles. Versions confirmed 2026-05-22 by probing the docId
|
||||
@@ -54,6 +55,14 @@ BUNDLES: list[BundleSpec] = [
|
||||
BundleSpec("hvm_release_notes_8_1_1", "sd00007609en_us", "HPE Morpheus VM Essentials Software Release Notes", "8.1.1", "Release Notes", "single"),
|
||||
BundleSpec("hvm_release_notes_8_1_2", "sd00007734en_us", "HPE Morpheus VM Essentials Software Release Notes", "8.1.2", "Release Notes", "single"),
|
||||
BundleSpec("hvm_deployment_guide", "sd00007332en_us", "HPE Morpheus VM Essentials Deployment Guide", None, "Deployment Guide","toc"),
|
||||
BundleSpec("hvm_qualification_matrix","sd00006551en_us", "Qualification Matrix for HVM Clusters Managed by HPE Morpheus Software", None, "Qualification Matrix", "toc"),
|
||||
# QuickSpecs is a static-HTML fixture (www.hpe.com edge drops automated
|
||||
# connections — see scrape/quickspecs/README.md). doc_id = the QuickSpecs
|
||||
# PSNow ref (a50004260enw). page_count is 1; source_url points at the
|
||||
# public PSNow URL.
|
||||
BundleSpec("hvm_quickspecs", "a50004260enw", "HPE Morpheus VM Essentials Software QuickSpecs",
|
||||
"v4-2026-02-02", "QuickSpecs", "html-file",
|
||||
source_url="https://www.hpe.com/psnow/doc/a50004260enw"),
|
||||
]
|
||||
|
||||
|
||||
@@ -118,6 +127,24 @@ def _parse_abstract(html: str) -> dict[str, str]:
|
||||
|
||||
|
||||
def discover_bundle(s: requests.Session, spec: BundleSpec) -> dict[str, Any]:
|
||||
# html-file bundles are static fixtures — no upstream fetch.
|
||||
if spec.mode == "html-file":
|
||||
return {
|
||||
"slug": spec.slug,
|
||||
"doc_id": spec.doc_id,
|
||||
"title": spec.title,
|
||||
"version": spec.version,
|
||||
"platform": spec.platform,
|
||||
"product": spec.product,
|
||||
"language": spec.language,
|
||||
"page_count": 1,
|
||||
"mode": "html-file",
|
||||
"abstract": "",
|
||||
"dates": {},
|
||||
"landing_page": spec.doc_id,
|
||||
"source_url": spec.source_url or f"https://www.hpe.com/psnow/doc/{spec.doc_id}",
|
||||
}
|
||||
|
||||
abstract_html = _get(s, f"{API}/{spec.doc_id}", expect_json=False)
|
||||
meta = _parse_abstract(abstract_html or "")
|
||||
|
||||
@@ -146,7 +173,7 @@ def discover_bundle(s: requests.Session, spec: BundleSpec) -> dict[str, Any]:
|
||||
"abstract": meta.get("abstract", ""),
|
||||
"dates": {"Published": meta.get("published", "")},
|
||||
"landing_page": landing,
|
||||
"source_url": DOC_URL.format(doc_id=spec.doc_id),
|
||||
"source_url": spec.source_url or DOC_URL.format(doc_id=spec.doc_id),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user