Coverage for fastblocks / adapters / sitemap / _base.py: 95%
22 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-02 20:00 -0800
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-02 20:00 -0800
1import typing as t
2from dataclasses import dataclass
3from datetime import datetime
5# Oneiric imports
6from oneiric.core.config import OneiricSettings
9@dataclass
10class SitemapURL:
11 loc: str
12 lastmod: datetime | None = None
13 changefreq: (
14 t.Literal["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]
15 | None
16 ) = None
17 priority: float | None = None
20class SitemapBaseSettings(OneiricSettings):
21 module: str = "native"
22 domain: str = ""
23 change_freq: t.Literal[
24 "always",
25 "hourly",
26 "daily",
27 "weekly",
28 "monthly",
29 "yearly",
30 "never",
31 ] = "weekly"
32 cache_ttl: int = 3600
34 strategy_options: dict[str, t.Any] = {
35 "include_patterns": [],
36 "exclude_patterns": ["^/admin/.*", "^/api/.*", ".*/__.*"],
37 "static_urls": [],
38 "model_configs": [],
39 "background_refresh": True,
40 "cache_warmup": False,
41 }
43 def __init__(self, **data: dict) -> None:
44 super().__init__(**data)
47class SitemapProtocol(t.Protocol):
48 sitemap: t.Any = None
51class SitemapBase:
52 category = "sitemap"
53 settings_klass = SitemapBaseSettings
54 sitemap: t.Any = None