16 lines
304 B
Python
16 lines
304 B
Python
from pathlib import Path
|
|
|
|
import tomli
|
|
|
|
from .model import Preset
|
|
|
|
__all__ = ("PresetUtil",)
|
|
|
|
|
|
class PresetUtil:
|
|
@classmethod
|
|
def resolve_preset(cls, filename: Path) -> Preset:
|
|
with open(filename, "rb") as fd:
|
|
preset_data = tomli.load(fd)
|
|
return Preset(**preset_data)
|