PyLibMS 4.0.2__tar.gz → 4.0.4__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.
Files changed (84) hide show
  1. {pylibms-4.0.2 → pylibms-4.0.4}/PKG-INFO +6 -4
  2. {pylibms-4.0.2 → pylibms-4.0.4}/PyLibMS.egg-info/PKG-INFO +6 -4
  3. {pylibms-4.0.2 → pylibms-4.0.4}/README.md +5 -3
  4. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/lms_exceptions.py +3 -0
  5. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/stream/fileinfo.py +4 -0
  6. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/definitions/flowchart.py +0 -1
  7. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/flw3.py +1 -1
  8. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/msbf.py +23 -6
  9. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/msbt.py +2 -1
  10. {pylibms-4.0.2 → pylibms-4.0.4}/pyproject.toml +1 -1
  11. {pylibms-4.0.2 → pylibms-4.0.4}/LICENSE +0 -0
  12. {pylibms-4.0.2 → pylibms-4.0.4}/MANIFEST.in +0 -0
  13. {pylibms-4.0.2 → pylibms-4.0.4}/PyLibMS.egg-info/SOURCES.txt +0 -0
  14. {pylibms-4.0.2 → pylibms-4.0.4}/PyLibMS.egg-info/dependency_links.txt +0 -0
  15. {pylibms-4.0.2 → pylibms-4.0.4}/PyLibMS.egg-info/requires.txt +0 -0
  16. {pylibms-4.0.2 → pylibms-4.0.4}/PyLibMS.egg-info/top_level.txt +0 -0
  17. {pylibms-4.0.2 → pylibms-4.0.4}/lms/__init__.py +0 -0
  18. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/__init__.py +0 -0
  19. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/field/__init__.py +0 -0
  20. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/field/io.py +0 -0
  21. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/field/lms_datatype.py +0 -0
  22. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/field/lms_field.py +0 -0
  23. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/lms_constants.py +0 -0
  24. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/lms_fileinfo.py +0 -0
  25. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/stream/hashtable.py +0 -0
  26. {pylibms-4.0.2 → pylibms-4.0.4}/lms/common/stream/section.py +0 -0
  27. {pylibms-4.0.2 → pylibms-4.0.4}/lms/fileio/encoding.py +0 -0
  28. {pylibms-4.0.2 → pylibms-4.0.4}/lms/fileio/io.py +0 -0
  29. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/__init__.py +0 -0
  30. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/definitions/__init__.py +0 -0
  31. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/definitions/lms_nodeexceptions.py +0 -0
  32. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/definitions/node.py +0 -0
  33. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/definitions/node_type.py +0 -0
  34. {pylibms-4.0.2 → pylibms-4.0.4}/lms/flowchart/msbfio.py +0 -0
  35. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/__init__.py +0 -0
  36. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/definitions/__init__.py +0 -0
  37. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/definitions/field/__init__.py +0 -0
  38. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/lms_messagetext.py +0 -0
  39. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/msbtentry.py +0 -0
  40. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/msbtio.py +0 -0
  41. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/section/__init__.py +0 -0
  42. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/section/atr1.py +0 -0
  43. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/section/nli1.py +0 -0
  44. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/section/tsy1.py +0 -0
  45. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/section/txt2.py +0 -0
  46. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/tag/__init__.py +0 -0
  47. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/tag/io/param_io.py +0 -0
  48. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/tag/io/tag_io.py +0 -0
  49. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/tag/lms_tag.py +0 -0
  50. {pylibms-4.0.2 → pylibms-4.0.4}/lms/message/tag/lms_tagexceptions.py +0 -0
  51. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/__init__.py +0 -0
  52. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/definitions/__init__.py +0 -0
  53. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/definitions/attribute.py +0 -0
  54. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/definitions/color.py +0 -0
  55. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/definitions/style.py +0 -0
  56. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/definitions/tag.py +0 -0
  57. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/msbp.py +0 -0
  58. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/msbpread.py +0 -0
  59. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/ali2.py +0 -0
  60. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/ati2.py +0 -0
  61. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/clr1.py +0 -0
  62. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/string.py +0 -0
  63. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/syl3.py +0 -0
  64. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/tag2.py +0 -0
  65. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/tgg2.py +0 -0
  66. {pylibms-4.0.2 → pylibms-4.0.4}/lms/project/section/tgp2.py +0 -0
  67. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/__init__.py +0 -0
  68. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/config.py +0 -0
  69. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/definitions/__init__.py +0 -0
  70. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/definitions/attribute.py +0 -0
  71. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/definitions/nodes.py +0 -0
  72. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/definitions/tags.py +0 -0
  73. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/definitions/value.py +0 -0
  74. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Badge Arcade.yaml +0 -0
  75. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Brain Age Concentration Training.yaml +0 -0
  76. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Kirby Planet Robobot.yaml +0 -0
  77. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Super Mario 3D Land.yaml +0 -0
  78. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Super Mario 3D World + Bowsers Fury.yaml +0 -0
  79. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Super Mario Odyssey.yaml +0 -0
  80. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml +0 -0
  81. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/The Legend of Zelda a Link Between Worlds.yaml +0 -0
  82. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Tomodachi Life Living The Dream.yaml +0 -0
  83. {pylibms-4.0.2 → pylibms-4.0.4}/lms/titleconfig/presets/Tomodachi Life NA-EU.yaml +0 -0
  84. {pylibms-4.0.2 → pylibms-4.0.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyLibMS
3
- Version: 4.0.2
3
+ Version: 4.0.4
4
4
  Summary: Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF.
5
5
  Author: AbdyyEee
6
6
  License-Expression: MIT
@@ -24,7 +24,9 @@ PylibMS is a library built in Python 3.12+ for the libMessageStudio (LMS) propri
24
24
  | MSBF | ✅ | ✅ | Flexible node + parameter decoding through configuration definitions. |
25
25
  | MSBP | ✅ | ❌ | N/A |
26
26
 
27
- This library is designed to support LMS revision 3.0+ from most Nintendo consoles. However, MSBF files that use `FLW1` and `FLW2` are not supported.
27
+ This library is designed to support LMS revision 3.0+ from most Nintendo consoles.
28
+
29
+ **Note**: MSBF files that use `FLW1` and `FLW2` are not supported, and will not be supported as they are revision <3.0 of LMS.
28
30
 
29
31
  # Features and Usage
30
32
 
@@ -37,7 +39,7 @@ MSBT/MSBF
37
39
 
38
40
  ```py
39
41
  from lms.message.msbtio import read_msbt_path
40
- from lms.message.msbfio import read_msbf_path
42
+ from lms.flowchart.msbfio import read_msbf_path
41
43
 
42
44
  msbt = read_msbt_path("Game.msbt")
43
45
  msbf = read_msbf_path("Game_Flowchart.msbf")
@@ -47,7 +49,7 @@ msbf = read_msbf_path("Game_Flowchart.msbf")
47
49
 
48
50
  ```py
49
51
  from lms.message.msbtio import write_msbt_path
50
- from lms.message.msbfio import write_msbf_path
52
+ from lms.flowchart.msbfio import write_msbf_path
51
53
 
52
54
  write_msbt_path("Out_Game.msbt")
53
55
  write_msbf_path("Out_Game_Flowchart.msbt")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyLibMS
3
- Version: 4.0.2
3
+ Version: 4.0.4
4
4
  Summary: Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF.
5
5
  Author: AbdyyEee
6
6
  License-Expression: MIT
@@ -24,7 +24,9 @@ PylibMS is a library built in Python 3.12+ for the libMessageStudio (LMS) propri
24
24
  | MSBF | ✅ | ✅ | Flexible node + parameter decoding through configuration definitions. |
25
25
  | MSBP | ✅ | ❌ | N/A |
26
26
 
27
- This library is designed to support LMS revision 3.0+ from most Nintendo consoles. However, MSBF files that use `FLW1` and `FLW2` are not supported.
27
+ This library is designed to support LMS revision 3.0+ from most Nintendo consoles.
28
+
29
+ **Note**: MSBF files that use `FLW1` and `FLW2` are not supported, and will not be supported as they are revision <3.0 of LMS.
28
30
 
29
31
  # Features and Usage
30
32
 
@@ -37,7 +39,7 @@ MSBT/MSBF
37
39
 
38
40
  ```py
39
41
  from lms.message.msbtio import read_msbt_path
40
- from lms.message.msbfio import read_msbf_path
42
+ from lms.flowchart.msbfio import read_msbf_path
41
43
 
42
44
  msbt = read_msbt_path("Game.msbt")
43
45
  msbf = read_msbf_path("Game_Flowchart.msbf")
@@ -47,7 +49,7 @@ msbf = read_msbf_path("Game_Flowchart.msbf")
47
49
 
48
50
  ```py
49
51
  from lms.message.msbtio import write_msbt_path
50
- from lms.message.msbfio import write_msbf_path
52
+ from lms.flowchart.msbfio import write_msbf_path
51
53
 
52
54
  write_msbt_path("Out_Game.msbt")
53
55
  write_msbf_path("Out_Game_Flowchart.msbt")
@@ -9,7 +9,9 @@ PylibMS is a library built in Python 3.12+ for the libMessageStudio (LMS) propri
9
9
  | MSBF | ✅ | ✅ | Flexible node + parameter decoding through configuration definitions. |
10
10
  | MSBP | ✅ | ❌ | N/A |
11
11
 
12
- This library is designed to support LMS revision 3.0+ from most Nintendo consoles. However, MSBF files that use `FLW1` and `FLW2` are not supported.
12
+ This library is designed to support LMS revision 3.0+ from most Nintendo consoles.
13
+
14
+ **Note**: MSBF files that use `FLW1` and `FLW2` are not supported, and will not be supported as they are revision <3.0 of LMS.
13
15
 
14
16
  # Features and Usage
15
17
 
@@ -22,7 +24,7 @@ MSBT/MSBF
22
24
 
23
25
  ```py
24
26
  from lms.message.msbtio import read_msbt_path
25
- from lms.message.msbfio import read_msbf_path
27
+ from lms.flowchart.msbfio import read_msbf_path
26
28
 
27
29
  msbt = read_msbt_path("Game.msbt")
28
30
  msbf = read_msbf_path("Game_Flowchart.msbf")
@@ -32,7 +34,7 @@ msbf = read_msbf_path("Game_Flowchart.msbf")
32
34
 
33
35
  ```py
34
36
  from lms.message.msbtio import write_msbt_path
35
- from lms.message.msbfio import write_msbf_path
37
+ from lms.flowchart.msbfio import write_msbf_path
36
38
 
37
39
  write_msbt_path("Out_Game.msbt")
38
40
  write_msbf_path("Out_Game_Flowchart.msbt")
@@ -8,3 +8,6 @@ class LMS_MisalignedSizeError(Exception): ...
8
8
 
9
9
 
10
10
  class LMS_UnsupportedSectionError(Exception): ...
11
+
12
+
13
+ class LMS_UnsupportedFileVersionError(Exception): ...
@@ -23,6 +23,10 @@ def read_file_info(reader: FileReader, expected_magic: str) -> LMS_FileInfo:
23
23
  reader.encoding = encoding
24
24
 
25
25
  version = reader.read_uint8()
26
+
27
+ if version < 3:
28
+ raise lms_exceptions.LMS_UnsupportedFileVersionError("Only version 3+ files are supported!")
29
+
26
30
  section_count = reader.read_uint16()
27
31
 
28
32
  reader.skip(2)
@@ -53,7 +53,6 @@ class LMS_Flowchart:
53
53
  if node in self._nodes.values():
54
54
  raise ValueError(f"Node of ID '{node.id}' is already registered to this flowchart!")
55
55
 
56
-
57
56
  node.id = self._id_generator()
58
57
  self._nodes[node.id] = node
59
58
 
@@ -261,7 +261,7 @@ def write_flw3(writer: FileWriter, nodes: list[LMS_BaseNode], stream_ids: dict[L
261
261
  writer.write_bytes(b"\x00" * 2)
262
262
  writer.write_bytes(b"\x00" * 4)
263
263
 
264
- write_next_node_id(writer, node.next_node_id)
264
+ write_next_node_id(writer, None if node.next_node is None else stream_ids[node.next_node])
265
265
  writer.skip(6)
266
266
  case LMS_JumpNode():
267
267
  writer.write_bytes(b"\x00" * 2)
@@ -1,6 +1,7 @@
1
1
  from types import MappingProxyType
2
2
 
3
3
  from lms.common.lms_fileinfo import LMS_FileInfo
4
+ from lms.fileio.encoding import FileEncoding
4
5
  from lms.flowchart.definitions.flowchart import LMS_Flowchart
5
6
  from lms.flowchart.definitions.node import LMS_EntryNode
6
7
 
@@ -24,10 +25,9 @@ class MSBF:
24
25
  DEFAULT_SLOT_COUNT = 59
25
26
 
26
27
  def __init__(self, info: LMS_FileInfo | None = None,
27
- flowcharts: dict[str, LMS_Flowchart] = None):
28
+ flowcharts: list[LMS_Flowchart] = None):
28
29
  self._info = info if info is not None else LMS_FileInfo()
29
- self._flowcharts: dict[str, LMS_Flowchart] = flowcharts or {}
30
-
30
+ self._flowcharts = flowcharts or []
31
31
  self._global_node_id = 0
32
32
 
33
33
  def __iter__(self):
@@ -36,6 +36,23 @@ class MSBF:
36
36
  def __len__(self):
37
37
  return len(self._flowcharts)
38
38
 
39
+ @classmethod
40
+ def new(cls,
41
+ is_big_endian: bool = False,
42
+ encoding: FileEncoding = FileEncoding.UTF16,
43
+ version: int = 3,
44
+ section_count: int = 2):
45
+ """
46
+ Create a new MSBF instance.
47
+
48
+ :param is_big_endian: if the file is big endian.
49
+ :param encoding: the file encoding.
50
+ :param version: the file version.
51
+ :param section_count: the number of sections.
52
+
53
+ """
54
+ return MSBF(LMS_FileInfo(is_big_endian, encoding, version, section_count))
55
+
39
56
  @property
40
57
  def info(self) -> LMS_FileInfo:
41
58
  """The file info for the MSBT instance."""
@@ -44,7 +61,7 @@ class MSBF:
44
61
  @property
45
62
  def flowcharts(self) -> MappingProxyType[str, LMS_Flowchart]:
46
63
  """The flowcharts of the MSBF instance."""
47
- return MappingProxyType(self._flowcharts)
64
+ return MappingProxyType({flowchart.name: flowchart for flowchart in self._flowcharts})
48
65
 
49
66
  @property
50
67
  def global_node_id(self) -> int:
@@ -67,14 +84,14 @@ class MSBF:
67
84
 
68
85
  :param flowchart_name: The name of the new flowchart.
69
86
  """
70
- if flowchart_name in self._flowcharts:
87
+ if flowchart_name in self.flowcharts:
71
88
  raise KeyError(f"Flowchart with name '{flowchart_name}' already exists!")
72
89
 
73
90
  if entry_point is None:
74
91
  entry_point = LMS_EntryNode(self.generate_next_id(), flowchart_name=flowchart_name)
75
92
 
76
93
  flowchart = LMS_Flowchart(entry_point, self.generate_next_id)
77
- self._flowcharts[flowchart_name] = flowchart
94
+ self._flowcharts.append(flowchart)
78
95
  return flowchart
79
96
 
80
97
  def delete_flowchart(self, name: str):
@@ -65,7 +65,8 @@ class MSBT:
65
65
  encoding: FileEncoding = FileEncoding.UTF16,
66
66
  version: int = 3,
67
67
  section_count: int = 2):
68
- """Create a new MSBT instance.
68
+ """
69
+ Create a new MSBT instance.
69
70
 
70
71
  :param uses_nli1: flag to determine if to use nli1 section for labels.
71
72
  :param attribute_config: the attribute config object
@@ -7,7 +7,7 @@ include = ["lms*"]
7
7
 
8
8
  [project]
9
9
  name = "PyLibMS"
10
- version = "4.0.2"
10
+ version = "4.0.4"
11
11
  requires-python = ">=3.12"
12
12
  description = "Python library built for the libMessageStudio (LMS) proprietary file formats from Nintendo. Supports MSBT, MSBP, and MSBF."
13
13
  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