yera.ui.updates.state

Persisted state for privacy-preserving UI update checks.

Symbols

def load_update_state — Load previously persisted update-check state.
def save_update_state — Persist update-check state beneath the Yera home directory.
def update_check_due — Determine whether the twenty-four-hour check interval has elapsed.
def update_state_path — Return the default path for persisted UI update-check state.
class UpdateCheckState — Persisted result of the most recent release update check.

load_update_state

load_update_state(
    path: Path | None = None,
) → UpdateCheckState | None

Load previously persisted update-check state.

Parameters

path
type: Path | None = None

Explicit state path, or None to use the standard Yera path.

Returns

type: UpdateCheckState | None

Validated update state, or None when the file is absent, unreadable, or invalid.

save_update_state

save_update_state(
    state: UpdateCheckState,
    path: Path | None = None,
) → None

Persist update-check state beneath the Yera home directory.

Parameters

state
type: UpdateCheckState

Validated state to persist.

path
type: Path | None = None

Explicit state path, or None to use the standard Yera path.

update_check_due

update_check_due(
    state: UpdateCheckState | None,
    now: datetime,
) → bool

Determine whether the twenty-four-hour check interval has elapsed.

Parameters

state
type: UpdateCheckState | None

Previously persisted state, if available.

now
type: datetime

Current timezone-aware time.

Returns

type: bool

Whether another release metadata request should be made.

update_state_path

update_state_path() → Path

Return the default path for persisted UI update-check state.

Returns

type: Path

State-file path beneath Yera's configured home directory.

UpdateCheckState

Inherits: BaseModel

Persisted result of the most recent release update check.

Fields

checked_at
type: pydantic.types.AwareDatetime (required)
metadata
type: yera.ui.updates.metadata.ReleaseMetadata | None = None