repoman.models#

Data models: Repository, WizardState, FileFormat, and AvailabilityStatus.

class FileFormat(*values)[source]#

Bases: Enum

On-disk format of an APT source file.

ONE_LINE repos are automatically converted to DEB822 on the first save that sets a description, because the one-line format has no description field.

DEB822 = 1#
ONE_LINE = 2#
class AvailabilityStatus(*values)[source]#

Bases: Enum

Availability of a repository for a target Ubuntu codename.

CHECKING is an in-progress sentinel used only by the wizard UI — it is never written back to the Repository object. The background thread transitions directly from UNKNOWN to AVAILABLE, UNAVAILABLE, or (on network failure) UNKNOWN.

UNKNOWN = 1#
CHECKING = 2#
AVAILABLE = 3#
UNAVAILABLE = 4#
SUITE_AGNOSTIC = 5#
class Repository(source_file, file_format, types, uris, suites, components, enabled, description, signed_by, architectures=<factory>, availability=AvailabilityStatus.UNKNOWN)[source]#

Bases: object

APT source entry parsed from a .sources or .list file.

Parameters:
source_file: Path#
file_format: FileFormat#
types: list[str]#
uris: list[str]#
suites: list[str]#
components: list[str]#
enabled: bool#
description: str | None#
signed_by: str | None#
architectures: list[str]#
is_ppa: bool#
ppa_owner: str | None#
ppa_name: str | None#
availability: AvailabilityStatus = 1#
property display_name: str#

Human-readable label: description if set, otherwise the primary URI.

Returns:

Description string, or first URI, or the literal (unknown) if the repo has no URIs.

Return type:

str

class WizardState(candidate_repos, target_codename, selected=<factory>, on_complete=None)[source]#

Bases: object

Shared state threaded through all upgrade wizard pages.

Parameters:
candidate_repos: list[Repository]#
target_codename: str#
selected: list[Repository]#
on_complete: Callable[[], None] | None = None#