Merge pull request #80 from Yusarina/tollib-update

tolm to tomllib
This commit is contained in:
Yusarina
2024-12-01 15:34:26 +00:00
committed by GitHub
+3 -3
View File
@@ -1,6 +1,6 @@
import bpy import bpy
import os import os
import toml import tomllib
import json import json
from bpy.types import AddonPreferences from bpy.types import AddonPreferences
from typing import Any, Dict from typing import Any, Dict
@@ -12,8 +12,8 @@ PREFERENCES_FILE = os.path.join(PREFERENCES_DIR, "preferences.json")
def get_current_version(): def get_current_version():
main_dir = os.path.dirname(os.path.dirname(__file__)) main_dir = os.path.dirname(os.path.dirname(__file__))
manifest_path = os.path.join(main_dir, "blender_manifest.toml") manifest_path = os.path.join(main_dir, "blender_manifest.toml")
with open(manifest_path, 'r') as f: with open(manifest_path, 'rb') as f:
manifest_data = toml.load(f) manifest_data = tomllib.load(f)
return manifest_data.get('version', 'Unknown') return manifest_data.get('version', 'Unknown')
def save_preference(key: str, value: Any) -> None: def save_preference(key: str, value: Any) -> None: