Settings Model#

PatcherSettings is the single home for Patcher’s on-disk configuration: UI branding (UIDefaults), the matching toggle, Integrations, ignored titles, and the recorded interpreter path. It reads and writes com.liquidzoo.patcher.plist via load() / save(), folding older plist formats forward on read.

Pydantic models for Patcher’s on-disk configuration.

PatcherSettings is the single source of truth for everything in the property list; it owns plist read/write (load() / save()) and migrating older on-disk formats forward.

class UIConfigKeys(*values)[source]#

Plist keys for the user-interface settings block.

class UIDefaults(*, header_text: Annotated[str, MinLen(min_length=1)] = 'Default header text', footer_text: Annotated[str, MinLen(min_length=1)] = 'Default footer text', font_name: Annotated[str, MinLen(min_length=1)] = 'Assistant', reg_font_path: str = '', bold_font_path: str = '', header_color: Annotated[str, MinLen(min_length=1)] = '#6432bdff', logo_path: str = '')[source]#

Default branding values for PDF and HTML reports (header/footer text, fonts, logo, color).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
class Integrations(*, installomator: bool = True, homebrew: bool = True, autopkg: bool = True, jai: bool = True)[source]#

Per-source matching toggles, all enabled by default (opt-out model).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
enabled_tokens() → set[str][source]#

Catalog source tokens for the currently-enabled integrations.

Return type:

set[str]

class PatcherSettings(*, setup_completed: bool = False, enable_matching: bool = True, enable_caching: bool = True, interpreter_path: str = <factory>, UserInterfaceSettings: UIDefaults = <factory>, integrations: Integrations = <factory>, ignored_titles: list[str] = <factory>)[source]#

Patcher’s complete on-disk configuration, backed by the property list.

The single home for everything persisted between runs: setup completion, the matching and caching toggles, the interpreter path recorded for the #68 preflight, UI branding, integration flags, and the user’s ignored-title patterns. load() reads and migrates the plist; save() writes the whole model back; the _migrate validator folds every older format forward in one place.

Added in version 3.3.0: Replaces the former PropertyListManager and UIConfigManager, consolidating plist I/O and format migration into one model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
classmethod load(path: Path = PosixPath('/home/docs/Library/Application Support/Patcher/com.liquidzoo.patcher.plist')) → PatcherSettings[source]#

Read settings from path, migrating older plist formats forward.

A missing file yields a defaults-only instance. When a pre-v2 (nested) plist is detected, a .bak copy is written before migrating so the original is never lost.

Parameters:

path (Path)

Return type:

PatcherSettings

save(path: Path = PosixPath('/home/docs/Library/Application Support/Patcher/com.liquidzoo.patcher.plist')) → None[source]#

Write the full settings model to path as a property list.

Parameters:

path (Path)

Return type:

None