From patchwork Thu Nov 10 17:31:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17780 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 6CC0CBD16B for ; Thu, 10 Nov 2022 17:32:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D2A56307B; Thu, 10 Nov 2022 18:32:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1668101556; 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=dQJ3/UDR5BFa3k1sZgxrvWQYxDP7t0R1hh1eYfwnaynE+a+MweoXNEW42tOueRW7c vJ7liFvJ97hWZXLeACHFiNNExgRgOQBQcKlNayA9e/oOfxKCi83qdl1XpdI+7R0OwO AZIq8uLgY5ToPPKhZl+uYrKlqdXlmaE3Wru1mXN2fcgIovZ2rPA0HEsBrW7qf0wASu PCHgVh+CZdf96iNpSNeL5rzi8yfjitwpfigByPCcPBH5RRyGrS3+BzlmJvgVZSZoAb VbYR/NtCpQr3mrYkbNJ5DeYX6aNpgK4OrDUIT/oBPmWiGu2arFauSP1jdUeYNEkwB7 HpwiitfbhnjKg== 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 DB1A36309A for ; Thu, 10 Nov 2022 18:32:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QdphwgmC"; 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 3ECBC499; Thu, 10 Nov 2022 18:32:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668101554; bh=G750lojvZ6bd8ltrUOeCxvAIGwzQyDxBta4MuReVT6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdphwgmCUu2IgGqaAnVtP9MIkwqKuV/EWSZfet95PtwIfbI9ML1u63KYrUKlTqvI3 K16gcfHNsPnCnPvP3NgZ7kKfKtB5S9LV40xf1Kn8mMnZB6O0kBiUTa4LoUj3ASckz+ uxuXK3SW/CW1vJXI9pzrLbrwNYjRMBGAwV4+y2uc= To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Nov 2022 02:31:51 +0900 Message-Id: <20221110173154.488445-10-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221110173154.488445-1-paul.elder@ideasonboard.com> References: <20221110173154.488445-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 {}, []