classPackEntry#

class PackEntry(
path: str | None = None,
urls: tuple[str, ...] = (),
hashes: Mapping[str, str] = {},
size: int | None = None,
client: Literal['required', 'optional', 'unsupported'] = 'required',
server: Literal['required', 'optional', 'unsupported'] = 'required',
ref: FileRef | None = None,
manual_url: str | None = None,
)#

A file a pack needs. It is resolved once path and urls are known.

path#

Where the file goes in the instance, or None if not yet known.

Type:

str | None

urls#

Download locations, tried in order.

Type:

tuple[str, …]

hashes#

Expected digests keyed by algorithm name.

Type:

Mapping[str, str]

size#

The expected size in bytes, or None if unknown.

Type:

int | None

client#

Whether the client needs it.

Type:

Literal[‘required’, ‘optional’, ‘unsupported’]

server#

Whether the server needs it.

Type:

Literal[‘required’, ‘optional’, ‘unsupported’]

ref#

The platform file it refers to, or None.

Type:

FileRef | None

manual_url#

The page where a player can download it by hand, or None.

Type:

str | None

property is_resolved: bool#

Whether the entry has a path and a download.

support(
side: Literal['client', 'server'],
) → Literal['required', 'optional', 'unsupported']#

Return how side treats this entry.

wanted(
side: Literal['client', 'server'],
include_optional: bool = False,
) → bool#

Return whether side should install this entry.

Parameters:
  • side (Literal['client', 'server']) – The side.

  • include_optional (bool) – Also accept optional entries.

Returns:

True if the entry should be installed.

Return type:

bool

resource(
root: Path,
) → Resource#

Describe this entry’s download.

Parameters:

root (Path) – The instance directory.

Returns:

The resource.

Raises:

PackError – The entry has no path yet.

Return type:

Resource