bacommon.build

Functionality related to game builds.

 1# Released under the MIT License. See LICENSE for details.
 2#
 3"""Functionality related to game builds."""
 4
 5from __future__ import annotations
 6
 7import datetime
 8from dataclasses import dataclass, field
 9from typing import TYPE_CHECKING, Annotated
10
11from efro.dataclassio import ioprepped, IOAttrs
12
13if TYPE_CHECKING:
14    pass
15
16
17@ioprepped
18@dataclass
19class BuildInfoSet:
20    """Set of build infos."""
21
22    @dataclass
23    class Entry:
24        """Info about a particular app build."""
25
26        filename: Annotated[str, IOAttrs('fname')]
27        size: Annotated[int, IOAttrs('size')]
28        version: Annotated[str, IOAttrs('version')]
29        build_number: Annotated[int, IOAttrs('build')]
30        checksum: Annotated[str, IOAttrs('checksum')]
31        createtime: Annotated[datetime.datetime, IOAttrs('createtime')]
32
33    builds: Annotated[list[Entry], IOAttrs('builds')] = field(
34        default_factory=list
35    )
@ioprepped
@dataclass
class BuildInfoSet:
18@ioprepped
19@dataclass
20class BuildInfoSet:
21    """Set of build infos."""
22
23    @dataclass
24    class Entry:
25        """Info about a particular app build."""
26
27        filename: Annotated[str, IOAttrs('fname')]
28        size: Annotated[int, IOAttrs('size')]
29        version: Annotated[str, IOAttrs('version')]
30        build_number: Annotated[int, IOAttrs('build')]
31        checksum: Annotated[str, IOAttrs('checksum')]
32        createtime: Annotated[datetime.datetime, IOAttrs('createtime')]
33
34    builds: Annotated[list[Entry], IOAttrs('builds')] = field(
35        default_factory=list
36    )

Set of build infos.

BuildInfoSet( builds: typing.Annotated[list[BuildInfoSet.Entry], <efro.dataclassio._base.IOAttrs object>] = <factory>)
builds: typing.Annotated[list[BuildInfoSet.Entry], <efro.dataclassio._base.IOAttrs object at 0x103ecab10>]
@dataclass
class BuildInfoSet.Entry:
23    @dataclass
24    class Entry:
25        """Info about a particular app build."""
26
27        filename: Annotated[str, IOAttrs('fname')]
28        size: Annotated[int, IOAttrs('size')]
29        version: Annotated[str, IOAttrs('version')]
30        build_number: Annotated[int, IOAttrs('build')]
31        checksum: Annotated[str, IOAttrs('checksum')]
32        createtime: Annotated[datetime.datetime, IOAttrs('createtime')]

Info about a particular app build.

BuildInfoSet.Entry( filename: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object>], size: typing.Annotated[int, <efro.dataclassio._base.IOAttrs object>], version: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object>], build_number: typing.Annotated[int, <efro.dataclassio._base.IOAttrs object>], checksum: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object>], createtime: typing.Annotated[datetime.datetime, <efro.dataclassio._base.IOAttrs object>])
filename: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object at 0x103e7c550>]
size: typing.Annotated[int, <efro.dataclassio._base.IOAttrs object at 0x1025fa310>]
version: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object at 0x103d48390>]
build_number: typing.Annotated[int, <efro.dataclassio._base.IOAttrs object at 0x1033a2810>]
checksum: typing.Annotated[str, <efro.dataclassio._base.IOAttrs object at 0x103eba450>]
createtime: typing.Annotated[datetime.datetime, <efro.dataclassio._base.IOAttrs object at 0x103ebab50>]