Check ASTM page for withdrawal/historical status.
(standard: dict)
| 198 | |
| 199 | |
| 200 | def check_astm(standard: dict) -> dict | None: |
| 201 | """Check ASTM page for withdrawal/historical status.""" |
| 202 | status, html = fetch_page(standard["url"]) |
| 203 | if status == 404: |
| 204 | return {"type": "error", "detail": "HTTP 404 - page not found"} |
| 205 | if status != 200: |
| 206 | return {"type": "error", "detail": f"HTTP {status}"} |
| 207 | |
| 208 | # Signal: "Historical" or "Withdrawn" in status |
| 209 | if re.search(r"\bHistorical\b", html): |
| 210 | superseded = re.search(r"Superseded\s*(?:by)?\s*([A-Z]\d[\w\-]+)", html) |
| 211 | return { |
| 212 | "type": "withdrawn", |
| 213 | "signal": f"Historical/Withdrawn. {superseded.group(0) if superseded else ''}".strip(), |
| 214 | "new_version": superseded.group(1) if superseded else "", |
| 215 | } |
| 216 | |
| 217 | if re.search(r"\bWithdrawn\b", html, re.IGNORECASE): |
| 218 | return {"type": "withdrawn", "signal": "Withdrawn"} |
| 219 | |
| 220 | return None |
| 221 | |
| 222 | |
| 223 | def check_iteh(standard: dict) -> dict | None: |
nothing calls this directly
no test coverage detected