libcamera/utils/tuning/libtuning/parsers/yaml_parser.py
Stefan Klug 6672c49cbf 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>
2024-07-05 22:38:16 +02:00

20 lines
502 B
Python

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
#
# Parser for YAML format config file
from .parser import Parser
import yaml
class YamlParser(Parser):
def __init__(self):
super().__init__()
def parse(self, config_file: str, modules: list) -> (dict, list):
# Dummy implementation that just reads the file
with open(config_file, 'r') as f:
config = yaml.safe_load(f)
return config, []