koro 1.1.3__py3-none-any.whl → 1.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
koro/file/bin.py CHANGED
@@ -32,10 +32,11 @@ class BinLevel(Location, Level):
32
32
  test_reference_indicies: list[int]
33
33
  while data_index < len(data):
34
34
  chunk = bytearray(b"\x00")
35
- for _ in range(8):
35
+ for bit in range(8):
36
36
  if data_index >= len(data):
37
+ chunk[0] >>= 8 - bit
37
38
  output.extend(chunk)
38
- return output
39
+ return output + b"\x00" * (len(output) & 1)
39
40
  if len(data) - data_index <= 2:
40
41
  buffer[buffer_index] = data[data_index]
41
42
  buffer_index = buffer_index + 1 & 1023
@@ -80,8 +81,8 @@ class BinLevel(Location, Level):
80
81
  test_length = 4
81
82
  test_reference_indicies = reference_indices.copy()
82
83
  while test_length <= min(66, len(data) - data_index):
83
- test_buffer[buffer_index + test_length - 1025] = data[
84
- data_index + test_length - 1
84
+ test_buffer[buffer_index + test_length - 1026] = data[
85
+ data_index + test_length - 2
85
86
  ]
86
87
  for i in test_reference_indicies.copy():
87
88
  if (
@@ -116,7 +117,7 @@ class BinLevel(Location, Level):
116
117
  )
117
118
  data_index += test_length
118
119
  output.extend(chunk)
119
- return output + b"\x00"
120
+ return output + b"\x00" * (len(output) & 1)
120
121
 
121
122
  @staticmethod
122
123
  def decompress(data: bytes, /) -> bytes:
koro/item/group.py CHANGED
@@ -1,5 +1,6 @@
1
1
  from abc import ABC
2
2
  from collections.abc import Iterable, Sequence
3
+ from itertools import chain, repeat
3
4
  from typing import Final, Generic, Optional, TypeVar
4
5
 
5
6
  from .level import Level, LevelNotFoundError
@@ -37,7 +38,7 @@ class Group(ABC, Generic[_L], Sequence[_L]):
37
38
 
38
39
  def write(self, new_content: Iterable[Optional[bytes]], /) -> None:
39
40
  """Replace the contents of this Group with the specified new content. None values will empty the slot they correspond to."""
40
- for src, dest in zip(new_content, self, strict=True):
41
+ for src, dest in zip(chain(new_content, repeat(None)), self):
41
42
  if src is None:
42
43
  try:
43
44
  dest.delete()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: koro
3
- Version: 1.1.3
3
+ Version: 1.1.5
4
4
  Summary: Tools for manipulating levels made in Marble Saga: Kororinpa
5
5
  Home-page: https://github.com/DigitalDetective47/koro
6
6
  Author: DigitalDetective47
@@ -1,15 +1,15 @@
1
1
  koro/__init__.py,sha256=5K5KQt899Y9FEEce0zLbKgi7lMlUIVR5tNN5xkgM-DE,201
2
2
  koro/file/__init__.py,sha256=1uei7uDZD9P05n-HC5SKVSNlvKHXjYqV1GRAjt1lG_w,974
3
- koro/file/bin.py,sha256=2rV6BQN-6HH-ilV8WpInI5xWjds9Mo3_4kzQLEDPmqU,7482
3
+ koro/file/bin.py,sha256=CPSU6hrdeop3gP5LlW2VTO_0RsQQj-4p68UhOsGqz1I,7576
4
4
  koro/file/dir.py,sha256=pnMQJAQRlzcm_MC14goDeKlQ3llKhywM1FdADHM8xds,6632
5
5
  koro/file/lvl.py,sha256=lrVpQyZFj1JlVPYx-OkcCne8VdjHCWQIuOX0pls1Dto,1130
6
6
  koro/file/zip.py,sha256=qqyr-FmrgEj4xHuvhpCw_QMcieqIXrKn4xCYpITNAvQ,7435
7
7
  koro/item/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- koro/item/group.py,sha256=lwmx_1FMD4LdOxxuqPDN2Dl_8MZD9OJcy259SS8Apzk,1538
8
+ koro/item/group.py,sha256=bvKnQzXULy3dw-YA5Hn7E9ErbgZlMGxR-K2ucjYNnaw,1583
9
9
  koro/item/level.py,sha256=KXiOK3RGC72WK4lduf3RO9Cs1zXaJRk0EfJCDndA4bs,3068
10
10
  koro/item/save.py,sha256=LUV79vW3gY__jVVVG1kcYW-wzsGCRlYq126nulbT37Y,607
11
- koro-1.1.3.dist-info/LICENSE,sha256=Q2ptU2E48gOsMzhYz_kqVovmJ5d1KzrblLyqD2_-fvY,1235
12
- koro-1.1.3.dist-info/METADATA,sha256=04KSJ-crJBXCGIybeJdgNiuC4QpFTI3kLoiZ4znIq9E,628
13
- koro-1.1.3.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
14
- koro-1.1.3.dist-info/top_level.txt,sha256=Msq6ssMwv56hnBQqwaTdJJkxM7x7BZ-3JfQbkepQAEY,5
15
- koro-1.1.3.dist-info/RECORD,,
11
+ koro-1.1.5.dist-info/LICENSE,sha256=Q2ptU2E48gOsMzhYz_kqVovmJ5d1KzrblLyqD2_-fvY,1235
12
+ koro-1.1.5.dist-info/METADATA,sha256=6qUWxHzoxcxQAWKsNY1f6fIqNpBXC1aEIruwuivfmGs,628
13
+ koro-1.1.5.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
14
+ koro-1.1.5.dist-info/top_level.txt,sha256=Msq6ssMwv56hnBQqwaTdJJkxM7x7BZ-3JfQbkepQAEY,5
15
+ koro-1.1.5.dist-info/RECORD,,
File without changes
File without changes