From patchwork Thu Mar 30 17:39:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 18495 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 60282C0F2A for ; Thu, 30 Mar 2023 17:41:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B7EC361EC7; Thu, 30 Mar 2023 19:41:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1680198081; bh=CujWuRgvypGCrHrnfGRtkdyPYPHMbCLBek9PHHn2QrA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XeZKhVut1bvpmEiUp1uV1djyPRLpDRC868G/+xkrn43J6hWlZr2olxR8T6hnaOeJl UUnL/uokxT2hTQFImYbqm04AtogLD9g/0BNkJMEkNUJzLTzJxMna75SZy/KtppdQEr I2+8Y1PBByVhDTYDGOzcjB8RRvym0KT9QEHNTGolG4lQ2PN7ltFCx9QU4CqMq7QMYO GL9MstBZezRJufmiUqvgGS9V1PFqm+pITIkBsS1e/fN6Fv7wdRv8gw2PYwmD5fMWWy HYR7g1WFKJ9B/PjVLpFX08viJQQc7aWkU6skHsaVsrDOfmXaz4FF7mmplaifzFU67M J+CNtYCucRPdA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 13AAC603A6 for ; Thu, 30 Mar 2023 19:41:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="X2mJOhjx"; dkim-atps=neutral Received: from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 51E4A6E1; Thu, 30 Mar 2023 19:41:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1680198079; bh=CujWuRgvypGCrHrnfGRtkdyPYPHMbCLBek9PHHn2QrA=; h=From:To:Cc:Subject:Date:From; b=X2mJOhjxdYZb9FHmL909rxTHINfvMMZVnitvSAjpOkdVQkvYlWyhCQ70yDE2e3a71 zDrV8UNAwXgs/weKVQO6/VtuX4/NFNqKKsX5mXWWmIh+0nRn8Jr7KN/08ZP7D3vQop iUC77qSzER9y9Pv80YYaUrav2FLt3fD5yhbs+BZo= To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Mar 2023 20:39:56 +0300 Message-Id: <20230330173956.417714-1-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] py: Fix CameraManager.version property 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: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The current CameraManager.version doesn't work at all (raises a TypeError), as that's not how you use expose C++ static methods as Python class methods. Fix it. Signed-off-by: Tomi Valkeinen Reported-by: @meawoppl:matrix.org Reviewed-by: Laurent Pinchart --- src/py/libcamera/py_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index d14e18e2..c55495cc 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -105,7 +105,7 @@ PYBIND11_MODULE(_libcamera, m) return cm; }) - .def_property_readonly("version", &PyCameraManager::version) + .def_property_readonly_static("version", [](py::object /* self */) { return PyCameraManager::version(); }) .def("get", &PyCameraManager::get, py::keep_alive<0, 1>()) .def_property_readonly("cameras", &PyCameraManager::cameras)