utils: libtuning: parsers: Add yaml parser

Add a parser to libtuning for parsing configuration files in yaml
format.

At the moment it doesn't parse anything and simply returns an empty
config. This is fine for the time being, as the only user of it is the
rkisp1 tuning script, which only has an LSC module which doesn't consume
anything from the configuration file. When a module comes around that
requires the yaml parser, it can be implemented then.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Paul Elder 2022-10-21 23:48:34 +09:00
parent b44ee5c348
commit 0f89bf3efd
2 changed files with 18 additions and 0 deletions

View file

@ -3,3 +3,4 @@
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com> # Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
from libtuning.parsers.raspberrypi_parser import RaspberryPiParser from libtuning.parsers.raspberrypi_parser import RaspberryPiParser
from libtuning.parsers.yaml_parser import YamlParser

View file

@ -0,0 +1,17 @@
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>
#
# yaml_parser.py - Parser for YAML format config file
from .parser import Parser
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 {}, []