libtuning: Implement a minimal yaml parser

At the moment this just reads the yaml file and returns it verbatim.
This needs to evolve further in the near future.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Stefan Klug 2024-06-11 09:33:00 +02:00
parent 797f598502
commit 6672c49cbf
2 changed files with 18 additions and 3 deletions

View file

@ -5,13 +5,16 @@
# Parser for YAML format config file
from .parser import Parser
import yaml
class YamlParser(Parser):
def __init__(self):
super().__init__()
# \todo Implement this (it's fine for now as we don't need a config for
# rkisp1 LSC, which is the only user of this so far)
def parse(self, config_file: str, modules: list) -> (dict, list):
return {}, []
# Dummy implementation that just reads the file
with open(config_file, 'r') as f:
config = yaml.safe_load(f)
return config, []