PyLibMS 3.2.0__tar.gz → 3.2.1__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.
- {pylibms-3.2.0 → pylibms-3.2.1}/PKG-INFO +1 -1
- {pylibms-3.2.0 → pylibms-3.2.1}/PyLibMS.egg-info/PKG-INFO +1 -1
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/definitions/lms_messagetext.py +12 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/section/atr1.py +2 -5
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/tag/io/param_io.py +3 -6
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/tag/lms_tag.py +14 -7
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/msbpread.py +0 -1
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/config.py +1 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/pyproject.toml +1 -1
- {pylibms-3.2.0 → pylibms-3.2.1}/LICENSE +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/MANIFEST.in +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/PyLibMS.egg-info/SOURCES.txt +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/PyLibMS.egg-info/dependency_links.txt +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/PyLibMS.egg-info/requires.txt +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/PyLibMS.egg-info/top_level.txt +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/README.md +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/lms_datatype.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/lms_exceptions.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/lms_fileinfo.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/stream/fileinfo.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/stream/hashtable.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/common/stream/section.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/fileio/encoding.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/fileio/io.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/definitions/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/definitions/field/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/definitions/field/io.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/definitions/field/lms_field.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/msbt.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/msbtentry.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/msbtio.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/section/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/section/tsy1.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/section/txt2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/tag/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/tag/io/tag_io.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/message/tag/lms_tagexceptions.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/definitions/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/definitions/attribute.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/definitions/color.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/definitions/style.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/definitions/tag.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/msbp.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/ali2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/ati2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/clr1.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/string.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/syl3.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/tag2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/tgg2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/project/section/tgp2.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/definitions/__init__.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/definitions/attribute.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/definitions/tags.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/definitions/value.py +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Badge Arcade.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Brain Age Concentration Training.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Kirby Planet Robobot.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Super Mario 3D Land.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Super Mario 3D World + Bowsers Fury.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Super Mario Odyssey.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/The Legend of Zelda a Link Between Worlds.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Tomodachi Life.yaml +0 -0
- {pylibms-3.2.0 → pylibms-3.2.1}/setup.cfg +0 -0
|
@@ -46,6 +46,18 @@ class LMS_MessageText:
|
|
|
46
46
|
"""The list of control tags in the message."""
|
|
47
47
|
return [part for part in self._parts if is_tag(part)]
|
|
48
48
|
|
|
49
|
+
@property
|
|
50
|
+
def tag_positions(self) -> dict[LMS_ControlTag, tuple[int, int]]:
|
|
51
|
+
"""Dict of tag objects to their start and end positions in text."""
|
|
52
|
+
positions = {}
|
|
53
|
+
pos = 0
|
|
54
|
+
for part in self._parts:
|
|
55
|
+
text_len = len(part)
|
|
56
|
+
if is_tag(part):
|
|
57
|
+
positions[part] = (pos, pos + text_len)
|
|
58
|
+
pos += text_len
|
|
59
|
+
return positions
|
|
60
|
+
|
|
49
61
|
def append_encoded_tag(
|
|
50
62
|
self, group_id: int, tag_index: int, *parameters: str, is_closing: bool = False
|
|
51
63
|
) -> LMS_EncodedTag:
|
|
@@ -3,11 +3,8 @@ from dataclasses import dataclass
|
|
|
3
3
|
from lms.common.lms_datatype import LMS_DataType
|
|
4
4
|
from lms.fileio.io import FileReader, FileWriter
|
|
5
5
|
from lms.message.definitions.field.io import read_field, write_field
|
|
6
|
-
from lms.message.definitions.field.lms_field import (
|
|
7
|
-
|
|
8
|
-
LMS_Field,
|
|
9
|
-
LMS_FieldMap,
|
|
10
|
-
)
|
|
6
|
+
from lms.message.definitions.field.lms_field import (LMS_DataType, LMS_Field,
|
|
7
|
+
LMS_FieldMap)
|
|
11
8
|
from lms.titleconfig.definitions.attribute import AttributeConfig
|
|
12
9
|
|
|
13
10
|
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
from typing import cast
|
|
2
2
|
|
|
3
|
-
from lms.common.lms_datatype import is_string_datatype
|
|
4
|
-
from lms.common.lms_datatype import LMS_DataType
|
|
3
|
+
from lms.common.lms_datatype import LMS_DataType, is_string_datatype
|
|
5
4
|
from lms.fileio.io import FileReader, FileWriter
|
|
6
5
|
from lms.message.definitions.field.io import read_field, write_field
|
|
7
6
|
from lms.message.definitions.field.lms_field import LMS_Field, LMS_FieldMap
|
|
8
|
-
from lms.message.tag.lms_tagexceptions import (
|
|
9
|
-
|
|
10
|
-
LMS_TagWritingException,
|
|
11
|
-
)
|
|
7
|
+
from lms.message.tag.lms_tagexceptions import (LMS_TagReadingError,
|
|
8
|
+
LMS_TagWritingException)
|
|
12
9
|
from lms.titleconfig.definitions.tags import TagDefinition
|
|
13
10
|
|
|
14
11
|
TAG_PADDING_BYTE = b"\xcd"
|
|
@@ -7,13 +7,6 @@ from lms.titleconfig.definitions.tags import TagConfig, TagDefinition
|
|
|
7
7
|
|
|
8
8
|
TAG_PADDING_CHAR = "CD"
|
|
9
9
|
|
|
10
|
-
type LMS_ControlTag = LMS_EncodedTag | LMS_DecodedTag
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def is_tag(obj: object) -> TypeGuard[LMS_ControlTag]:
|
|
14
|
-
"""Typeguard to narrow tag objects."""
|
|
15
|
-
return isinstance(obj, (LMS_EncodedTag, LMS_DecodedTag))
|
|
16
|
-
|
|
17
10
|
|
|
18
11
|
class LMS_EncodedTag:
|
|
19
12
|
"""
|
|
@@ -43,6 +36,9 @@ class LMS_EncodedTag:
|
|
|
43
36
|
self._is_fallback = is_fallback
|
|
44
37
|
self._is_closing = is_closing
|
|
45
38
|
|
|
39
|
+
def __len__(self) -> int:
|
|
40
|
+
return len(self.to_text())
|
|
41
|
+
|
|
46
42
|
@property
|
|
47
43
|
def group_id(self) -> int:
|
|
48
44
|
"""The group id for the tag."""
|
|
@@ -145,6 +141,9 @@ class LMS_DecodedTag:
|
|
|
145
141
|
|
|
146
142
|
self._is_closing = is_closing
|
|
147
143
|
|
|
144
|
+
def __len__(self) -> int:
|
|
145
|
+
return len(self.to_text())
|
|
146
|
+
|
|
148
147
|
@property
|
|
149
148
|
def group_id(self) -> int:
|
|
150
149
|
"""The group id for the tag."""
|
|
@@ -218,3 +217,11 @@ class LMS_DecodedTag:
|
|
|
218
217
|
parameters, tag_definition.parameters
|
|
219
218
|
)
|
|
220
219
|
return cls(tag_definition, parameter_map)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
type LMS_ControlTag = LMS_EncodedTag | LMS_DecodedTag
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def is_tag(obj: object) -> TypeGuard[LMS_ControlTag]:
|
|
226
|
+
"""Typeguard to narrow tag objects."""
|
|
227
|
+
return isinstance(obj, (LMS_EncodedTag, LMS_DecodedTag))
|
|
@@ -15,7 +15,6 @@ from lms.project.section.syl3 import read_styles
|
|
|
15
15
|
from lms.project.section.tag2 import read_tag2
|
|
16
16
|
from lms.project.section.tgg2 import read_tgg2
|
|
17
17
|
from lms.project.section.tgp2 import read_tgp2
|
|
18
|
-
|
|
19
18
|
from PylibMS.lms.project.definitions.color import LMS_Color
|
|
20
19
|
|
|
21
20
|
__all__ = ["read_msbp", "read_msbp_path"]
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyLibMS"
|
|
7
|
-
version = "3.2.
|
|
7
|
+
version = "3.2.1"
|
|
8
8
|
requires-python = ">=3.12"
|
|
9
9
|
description = "Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF."
|
|
10
10
|
readme = "README.md"
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Brain Age Concentration Training.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/Super Mario 3D World + Bowsers Fury.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{pylibms-3.2.0 → pylibms-3.2.1}/lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|