Skip to content

comicbox.doctor.context ¶

State the doctor’s checks share, and the shape of a check.

DoctorContext dataclass ¶

What the checks run against.

args is the same Namespace(comicbox=...) a run would get, so the doctor diagnoses the config that run would see. The Config section’s validation check fills in settings; it stays None when the config doesn’t load, and the checks after it say so.

Source code in comicbox/doctor/context.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@dataclass
class DoctorContext:
    """
    What the checks run against.

    ``args`` is the same ``Namespace(comicbox=...)`` a run would get, so
    the doctor diagnoses the config that run would see. The Config
    section's validation check fills in ``settings``; it stays None when
    the config doesn't load, and the checks after it say so.
    """

    args: Namespace = field(default_factory=lambda: Namespace(comicbox=Namespace()))
    #: Sources to verify with one live request each; "all" means every
    #: configured one. Empty keeps the doctor offline.
    online_sources: tuple[str, ...] = ()
    settings: ComicboxSettings | None = None

    @property
    def cns(self) -> Any:
        """The inner comicbox namespace the CLI parsed."""
        return getattr(self.args, "comicbox", self.args)

cns property ¶

The inner comicbox namespace the CLI parsed.