summaryrefslogtreecommitdiff
path: root/utils/tuning/libtuning/parsers/yaml_parser.py
diff options
context:
space:
mode:
authorStefan Klug <stefan.klug@ideasonboard.com>2024-06-11 09:33:00 +0200
committerStefan Klug <stefan.klug@ideasonboard.com>2024-07-05 22:38:16 +0200
commit6672c49cbfc3de5e59b3176ec4e72df7c843d193 (patch)
tree0cc49fa89f4ddd1380c94ba58536063b5082f295 /utils/tuning/libtuning/parsers/yaml_parser.py
parent797f59850201fcc267814be5c70d4730c4a67702 (diff)
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>
Diffstat (limited to 'utils/tuning/libtuning/parsers/yaml_parser.py')
-rw-r--r--utils/tuning/libtuning/parsers/yaml_parser.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/tuning/libtuning/parsers/yaml_parser.py b/utils/tuning/libtuning/parsers/yaml_parser.py
index 244db24d..1fa6b7a8 100644
--- a/utils/tuning/libtuning/parsers/yaml_parser.py
+++ b/utils/tuning/libtuning/parsers/yaml_parser.py
@@ -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, []