PyLibMS 4.1.1__tar.gz → 4.1.3__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-4.1.1 → pylibms-4.1.3}/PKG-INFO +1 -1
- {pylibms-4.1.1 → pylibms-4.1.3}/PyLibMS.egg-info/PKG-INFO +1 -1
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/definitions/node.py +2 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/config.py +18 -14
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/definitions/nodes.py +2 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Badge Arcade.yaml +1 -1
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Tomodachi Life NA-EU.yaml +0 -1
- {pylibms-4.1.1 → pylibms-4.1.3}/pyproject.toml +1 -1
- {pylibms-4.1.1 → pylibms-4.1.3}/LICENSE +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/MANIFEST.in +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/PyLibMS.egg-info/SOURCES.txt +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/PyLibMS.egg-info/dependency_links.txt +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/PyLibMS.egg-info/requires.txt +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/PyLibMS.egg-info/top_level.txt +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/README.md +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/field/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/field/io.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/field/lms_datatype.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/field/lms_field.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/lms_constants.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/lms_exceptions.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/lms_fileinfo.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/stream/fileinfo.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/stream/hashtable.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/common/stream/section.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/fileio/encoding.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/fileio/io.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/definitions/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/definitions/flowchart.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/definitions/lms_nodeexceptions.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/definitions/node_type.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/flw3.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/msbf.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/flowchart/msbfio.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/definitions/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/definitions/field/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/lms_messagetext.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/msbt.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/msbtentry.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/msbtio.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/section/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/section/atr1.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/section/nli1.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/section/tsy1.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/section/txt2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/tag/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/tag/io/param_io.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/tag/io/tag_io.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/tag/lms_tag.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/message/tag/lms_tagexceptions.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/definitions/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/definitions/attribute.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/definitions/color.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/definitions/style.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/definitions/tag.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/msbp.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/msbpread.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/ali2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/ati2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/clr1.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/string.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/syl3.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/tag2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/tgg2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/project/section/tgp2.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/definitions/__init__.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/definitions/attribute.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/definitions/tags.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/definitions/value.py +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Brain Age Concentration Training.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Kirby Planet Robobot.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Super Mario 3D Land.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Super Mario 3D World + Bowsers Fury.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Super Mario Odyssey.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/The Legend of Zelda a Link Between Worlds.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Tomodachi Life Living The Dream.yaml +0 -0
- {pylibms-4.1.1 → pylibms-4.1.3}/setup.cfg +0 -0
|
@@ -62,7 +62,7 @@ class TitleConfig:
|
|
|
62
62
|
return get_args(cls.GAME_PRESET)
|
|
63
63
|
|
|
64
64
|
@classmethod
|
|
65
|
-
def
|
|
65
|
+
def check_for_preset_updates(cls) -> dict[str, bool]:
|
|
66
66
|
"""
|
|
67
67
|
Checks whether a preset has an available update.
|
|
68
68
|
|
|
@@ -70,18 +70,23 @@ class TitleConfig:
|
|
|
70
70
|
"""
|
|
71
71
|
preset_list = cls._request_preset_list()
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
raise FileNotFoundError(f"Preset '{game}.yaml' was not found!")
|
|
73
|
+
result = {}
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
for preset in preset_list:
|
|
76
|
+
if f"{preset}.yaml" not in os.listdir("presets"):
|
|
77
|
+
continue
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
data = f.read().replace(b"\r\n", b"\n")
|
|
79
|
+
path = os.path.join("presets", f"{preset}.yaml")
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
with open(path, "rb") as f:
|
|
82
|
+
data = f.read().replace(b"\r\n", b"\n")
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
# Blob calculation https://git-scm.com/book/en/v2/Git-Internals-Git-Objects.html
|
|
85
|
+
local_hash = hashlib.sha1(f"blob {len(data)}\0".encode() + data).hexdigest()
|
|
86
|
+
|
|
87
|
+
result[preset] = local_hash != preset_list[preset]["sha"]
|
|
88
|
+
|
|
89
|
+
return result
|
|
85
90
|
|
|
86
91
|
@classmethod
|
|
87
92
|
def download_preset(cls, game: GAME_PRESET):
|
|
@@ -97,13 +102,12 @@ class TitleConfig:
|
|
|
97
102
|
|
|
98
103
|
preset_list = cls._request_preset_list()
|
|
99
104
|
|
|
100
|
-
if game.lower() not in preset_list:
|
|
105
|
+
if game.lower() not in {preset.lower(): data for preset, data in preset_list.items()}:
|
|
101
106
|
raise FileNotFoundError(f"Preset '{game}' not found.")
|
|
102
107
|
|
|
103
108
|
raw = cls._request_preset_file(game, preset_list)
|
|
104
109
|
|
|
105
|
-
|
|
106
|
-
pathlib.Path("presets").mkdir()
|
|
110
|
+
pathlib.Path("presets").mkdir(exist_ok=True)
|
|
107
111
|
|
|
108
112
|
path = os.path.join("presets", f"{game}.yaml")
|
|
109
113
|
with open(path, "wb") as f:
|
|
@@ -120,14 +124,14 @@ class TitleConfig:
|
|
|
120
124
|
raise RuntimeError("An error occurred fetching the preset list!") from e
|
|
121
125
|
|
|
122
126
|
for preset in folder_response.json():
|
|
123
|
-
result[os.path.basename(preset["path"]).
|
|
127
|
+
result[os.path.basename(preset["path"]).removesuffix(".yaml")] = preset
|
|
124
128
|
|
|
125
129
|
return result
|
|
126
130
|
|
|
127
131
|
@classmethod
|
|
128
132
|
def _request_preset_file(cls, game: str, preset_list: dict) -> requests.Response:
|
|
129
133
|
try:
|
|
130
|
-
raw_response = requests.get(preset_list[game
|
|
134
|
+
raw_response = requests.get(preset_list[game]["download_url"], timeout=10)
|
|
131
135
|
raw_response.raise_for_status()
|
|
132
136
|
except requests.exceptions.RequestException as e:
|
|
133
137
|
raise RuntimeError(f"An error occurred fetching the file data for preset '{game}'") from e
|
|
@@ -7,7 +7,7 @@ include = ["lms*"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "PyLibMS"
|
|
10
|
-
version = "4.1.
|
|
10
|
+
version = "4.1.3"
|
|
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
|
|
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
|
|
File without changes
|
{pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Brain Age Concentration Training.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Super Mario 3D World + Bowsers Fury.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/The Legend of Zelda Echos of Wisdom.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{pylibms-4.1.1 → pylibms-4.1.3}/lms/titleconfig/presets/Tomodachi Life Living The Dream.yaml
RENAMED
|
File without changes
|
|
File without changes
|