Check iTeh/CEN page for withdrawn status.
(standard: dict)
| 221 | |
| 222 | |
| 223 | def check_iteh(standard: dict) -> dict | None: |
| 224 | """Check iTeh/CEN page for withdrawn status.""" |
| 225 | status, html = fetch_page(standard["url"]) |
| 226 | if status == 404: |
| 227 | return {"type": "error", "detail": "HTTP 404 - page removed or URL changed"} |
| 228 | if status != 200: |
| 229 | return {"type": "error", "detail": f"HTTP {status}"} |
| 230 | |
| 231 | # Signal: Status "Withdrawn" |
| 232 | if re.search(r"Status\s*Withdrawn", html, re.IGNORECASE): |
| 233 | replaced = re.search(r"Replaced by\s*([^<\n]+)", html) |
| 234 | return { |
| 235 | "type": "withdrawn", |
| 236 | "signal": f"Withdrawn. {replaced.group(0) if replaced else ''}".strip(), |
| 237 | "new_version": replaced.group(1).strip() if replaced else "", |
| 238 | } |
| 239 | |
| 240 | return None |
| 241 | |
| 242 | |
| 243 | CHECKERS = { |
nothing calls this directly
no test coverage detected