-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontext.py
More file actions
46 lines (31 loc) · 1.33 KB
/
context.py
File metadata and controls
46 lines (31 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Context for the docbuild CLI commands."""
from dataclasses import dataclass
from pathlib import Path
from typing import Any
from ..models.config.env import EnvConfig
from ..models.doctype import Doctype
@dataclass
class DocBuildContext:
"""The CLI context shared between different subcommands."""
dry_run: bool = False
"""If set, just pretend to run the command without making any changes"""
verbose: int = 0
"""verbosity level"""
appconfigfiles: tuple[str | Path, ...] | None = None
"""The app's config files to load, if any"""
appconfig_from_defaults: bool = False
"""If set, the app's config was loaded from defaults"""
appconfig: dict[str, Any] | None = None
"""The accumulated content of all app config files"""
envconfigfiles: tuple[str | Path, ...] | None = None
"""The env's config files to load, if any"""
envconfig_from_defaults: bool = False
"""Internal flag to indicate if the env's config was loaded from defaults"""
envconfig: EnvConfig | None = None
"""The accumulated content of all env config files"""
doctypes: list[Doctype] | None = None
"""The doctypes to process, if any"""
debug: bool = False
"""If set, enable debug mode"""
validation_method: str = "jing"
"""Method used to validate XML files: 'jing' (default) or 'lxml'"""