Skip to content

Commit

Permalink
release full version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalDetective47 committed Jul 14, 2024
1 parent 4c1bf51 commit 721d68d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package allows you to extract the saved stages from your save file and stor

To install this package, simply run
```
pip install koro==2.0.0rc3
pip install koro
```
in a command prompt. For detailed documentation of the contents of the package, please view the wiki. For basic users, simple command‐line tools are available in the `scripts` folder of this repository. **Use of these tools requires installing the package from PyPI.**

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = koro
version = 2.0.0rc3
version = 2.0.0
author = DigitalDetective47
author_email = [email protected]
description = Tools for manipulating levels made in Marble Saga: Kororinpa
Expand Down
7 changes: 5 additions & 2 deletions src/koro/slot/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from .xml import XmlSlot


__all__ = ["BinSlot"]


class BinSlot(FileSlot):
__slots__ = ()

Expand Down Expand Up @@ -151,5 +154,5 @@ def deserialize(data: bytes, /) -> Stage:
return XmlSlot.deserialize(BinSlot.decompress(data))

@staticmethod
def serialize(level: Stage, /) -> bytes:
return BinSlot.compress(XmlSlot.serialize(level))
def serialize(stage: Stage, /) -> bytes:
return BinSlot.compress(XmlSlot.serialize(stage))
3 changes: 3 additions & 0 deletions src/koro/slot/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
StrOrBytesPath = Any


__all__ = ["FileSlot"]


class FileSlot(Slot, ABC):
__match_args__ = ("path",)
__slots__ = ("_path",)
Expand Down
2 changes: 1 addition & 1 deletion src/koro/slot/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __repr__(self) -> str:
def save(self, data: Stage | None) -> None:
binary: bytes = b"" if data is None else XmlSlot.serialize(data)
if len(binary) > 156864:
raise ValueError("serialized level data is too large to save")
raise ValueError("serialized stage data is too large to save")
try:
with open(self._path, "xb") as f:
f.write(bytes(638976))
Expand Down
5 changes: 3 additions & 2 deletions src/koro/stage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EditUser(Enum):
INTERMEDIATE = 1
EXPERT = 2
PROTECTED = 3
"""A level with this edit user can only be opened in expert, and will open a blank level when doing so."""
"""A stage with this edit user can only be opened in expert, and will open a blank stage when doing so."""


@unique
Expand All @@ -31,6 +31,7 @@ class Theme(Enum):
HAUNTED_HOUSE = 8
CITY = 9

@property
def decorations_available(self) -> int:
return {
Theme.HAUNTED_HOUSE_DARKNESS: 8,
Expand Down Expand Up @@ -62,7 +63,7 @@ def __init__(
/,
*,
edit_user: EditUser = EditUser.EXPERT,
theme: Theme,
theme: Theme = Theme.THE_EMPTY_LOT,
tilt_lock: bool = False,
) -> None:
super().__init__(iterable)
Expand Down
2 changes: 1 addition & 1 deletion src/koro/stage/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


class BasePart(ABC):
"""Base class for all level elements"""
"""Base class for all stage elements"""

__match_args__ = ("x_pos", "y_pos", "z_pos", "x_rot", "y_rot", "z_rot")
__slots__ = ("_x_pos", "_x_rot", "_y_pos", "_y_rot", "_z_pos", "_z_rot")
Expand Down

0 comments on commit 721d68d

Please sign in to comment.