koro 1.0.5__tar.gz → 1.0.7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: koro
3
- Version: 1.0.5
3
+ Version: 1.0.7
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,6 +1,6 @@
1
1
  [metadata]
2
2
  name = koro
3
- version = 1.0.5
3
+ version = 1.0.7
4
4
  author = DigitalDetective47
5
5
  author_email = ninji2701@gmail.com
6
6
  description = Tools for manipulating levels made in Marble Saga: Kororinpa
@@ -95,7 +95,7 @@ class ZipLevel(Level):
95
95
 
96
96
  def write(self, new_content: bytes, /) -> None:
97
97
  contents: Final[dict[ZipInfo, bytes]] = {}
98
- with ZipFile(self.path) as a:
98
+ with ZipFile(self.path, "a") as a:
99
99
  for info in filterfalse(
100
100
  lambda info: info.filename == self.fn, a.infolist()
101
101
  ):
@@ -1,6 +1,5 @@
1
1
  from abc import ABC
2
2
  from collections.abc import Iterable, Sequence
3
- from itertools import filterfalse
4
3
  from typing import Final, Generic, Optional, TypeVar
5
4
 
6
5
  from .level import Level, LevelNotFoundError
@@ -38,6 +37,9 @@ class Group(ABC, Generic[_L], Sequence[_L]):
38
37
  """Replace the contents of this Group with the specified new content. None values will empty the slot they correspond to."""
39
38
  for src, dest in zip(new_content, self, strict=True):
40
39
  if src is None:
41
- dest.delete()
40
+ try:
41
+ dest.delete()
42
+ except LevelNotFoundError:
43
+ pass
42
44
  else:
43
45
  dest.write(src)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: koro
3
- Version: 1.0.5
3
+ Version: 1.0.7
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
@@ -10,7 +10,6 @@ src/koro/file/__init__.py
10
10
  src/koro/file/dir.py
11
11
  src/koro/file/lvl.py
12
12
  src/koro/file/zip.py
13
- src/koro/item/__init__.py
14
13
  src/koro/item/group.py
15
14
  src/koro/item/level.py
16
15
  src/koro/item/save.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes