14 lines
344 B
Python
14 lines
344 B
Python
from diceplayer.config import PlayerConfig
|
|
from diceplayer.logger import logger
|
|
|
|
import yaml
|
|
|
|
|
|
def read_input(infile) -> PlayerConfig:
|
|
try:
|
|
with open(infile, "r") as f:
|
|
return PlayerConfig.model_validate(yaml.safe_load(f))
|
|
except Exception as e:
|
|
logger.exception("Failed to read input file")
|
|
raise e
|