From patchwork Thu Nov 24 11:35:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17875 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 68957BDE6B for ; Thu, 24 Nov 2022 11:36:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3749D6331C; Thu, 24 Nov 2022 12:36:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669289780; bh=G750lojvZ6bd8ltrUOeCxvAIGwzQyDxBta4MuReVT6w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=cH0eMQtG0o9jlp3/tSiDWrs/wwwFpkuIhKFN4mIG5reHtOQTu8Q3p6h+BIJT1UFKs 3/7LSx8Ai4SgI1Fr8kvsdTnodIMpkoGsmcmJLfcvdOFVowibMaqi3HOZ0UJW3WQj4j JgP5cBfNjUcBIrFVDsCpmuNLTYS6bdhlNdSPXA3XnvKg/DA/EFpuPgj2u7iBOm/v4b BqN1jAuTfLy62WxmGfcrgnwkDkzF9HO0IV4oyNySynijN0kxXpBjfHAXWprBSKYxyA w/+XLQCFxlVlijiyFHLvEDvFLRLzpo7iToPe0Lqp/KnxzHGGJsGoCbs2lOF6/usbG8 G3V8tXEJporZw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B61D6331B for ; Thu, 24 Nov 2022 12:36:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KXUIfB53"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1765D496; Thu, 24 Nov 2022 12:36:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669289778; bh=G750lojvZ6bd8ltrUOeCxvAIGwzQyDxBta4MuReVT6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXUIfB53RfrsLWgkFKpFZEohaZEyfICK1s4MitgCoI3cXyqL7bumRbHnpoMLTcSRr AzgsnLOOgl6Mervo9N4yH1FwMWFqxsibYDak0JhM0hD3IdbiIWRSaHFppvRHCyw7j7 mI0wfMKddJBs8Wlw2dnNf/XPpmQWBg0j/RiImVuU= To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 20:35:47 +0900 Message-Id: <20221124113550.2182342-10-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221124113550.2182342-1-paul.elder@ideasonboard.com> References: <20221124113550.2182342-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 09/12] utils: libtuning: parsers: Add yaml parser X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart --- Changes in v3: - add file description - remove indirection from fake polymorphism - update commit message to reflect the fact that it doesn't actually do anything at the moment --- utils/tuning/libtuning/parsers/__init__.py | 1 + utils/tuning/libtuning/parsers/yaml_parser.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 utils/tuning/libtuning/parsers/yaml_parser.py diff --git a/utils/tuning/libtuning/parsers/__init__.py b/utils/tuning/libtuning/parsers/__init__.py index 9d20d2fc..022c1e5d 100644 --- a/utils/tuning/libtuning/parsers/__init__.py +++ b/utils/tuning/libtuning/parsers/__init__.py @@ -3,3 +3,4 @@ # Copyright (C) 2022, Paul Elder from libtuning.parsers.raspberrypi_parser import RaspberryPiParser +from libtuning.parsers.yaml_parser import YamlParser diff --git a/utils/tuning/libtuning/parsers/yaml_parser.py b/utils/tuning/libtuning/parsers/yaml_parser.py new file mode 100644 index 00000000..5c1673a5 --- /dev/null +++ b/utils/tuning/libtuning/parsers/yaml_parser.py @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2022, Paul Elder +# +# 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 {}, []