-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathconversionState.py
More file actions
27 lines (21 loc) · 1.07 KB
/
Copy pathconversionState.py
File metadata and controls
27 lines (21 loc) · 1.07 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
"""Mutable state belonging to one CEWE-to-PDF conversion.
Rendering resources and settings live in :mod:`renderContext`. This separate
object owns information which is discovered or created while a conversion is
under way, so it cannot accidentally leak into a later conversion in the same
Python process.
"""
from dataclasses import dataclass, field
from typing import Any
@dataclass
class ConversionState:
"""Mutable per-conversion caches, diagnostics, and temporary files.
Font substitutions and message counters are deliberately here rather than
at module scope: an album's configuration and its diagnostics must not
affect the next album when a caller invokes :func:`convertMcf` twice.
"""
temporary_files: list[str] = field(default_factory=list)
background_not_found_paths: set[str] = field(default_factory=set)
passepartout_files: dict[int, str] | None = None
missing_font_substitutions: dict[str, str] = field(default_factory=dict)
noted_font_substitutions: set[str] = field(default_factory=set)
message_counters: Any | None = None