From patchwork Wed May 18 09:08:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 15943 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 3D54CC0F2A for ; Wed, 18 May 2022 09:08:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8376365657; Wed, 18 May 2022 11:08:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652864891; bh=PhexJFiWuw5ZGQx9zCaaqI2nqBvg4K/aj9pmERVdexQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IAWmxnlmNSDeFVnkNdxhODDgMYx824QIoZvucxwj8NwLCgSomR4V9StKomz+v3ZPZ hvWIhyDbpQBatbwJ0iKNmFfV0laDvG0KD3JR5K9e4xT+xR1GzBLnNcIoVAFcbMm8SY AJa4TBtCh6ZgR8Dg8gik4eAKC16mYo2IzvkVgBzGhjlB86DEMd4Sc79Imd7ar77gp5 fYcnQyn4xFOqE3mMrigKxLbnpMET8h1M9wSeuB7trIlpmRw1gcz6aWoHAWVHm8WzHE ighqfVW0TWE7AMSYzC2yPTqS+gjKkdJmycayq46zt7JvSSVTIYrTAU7Mw2PlirLNZs m9CSj4QAZSIwQ== Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24C2861FB9 for ; Wed, 18 May 2022 11:08:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Ocf9hqMl"; dkim-atps=neutral Received: by mail-wm1-x336.google.com with SMTP id m62so735730wme.5 for ; Wed, 18 May 2022 02:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U0Hr826nZlpRlI7INshlIsHMOTtiH1LfV3SV9HL5AMc=; b=Ocf9hqMlDv+5X1tQjeqZng+rHwUQhZXDjaq2sd4ltY1cjczwnnmyB8EFvQ7h9cd98F UMlruh25x1CE3s/uNCO770v8fsjX2VdFt8S3KEdxKqBlskWJKQziRx4yuVzXMVrluSN1 kHku8jZfuIyxKAwXi1KZoIFbfCYtZuz77hO/nKpxF9kqc9chdw8fnjxlWXV+MIl/qXt6 4Tbls8bOhiR8COx5UUBiuQF6npic6xBnV/XA5CMuIzgi717bPLuyHNoW6ZfsCEOVRPFq d9eCbB5KeWRK8cOk+RpX0P7ntQc3bRCaOH7NYFtDf8WwBa1XU2VLeeCUU0KxzxUZSBuK sfSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U0Hr826nZlpRlI7INshlIsHMOTtiH1LfV3SV9HL5AMc=; b=RnKdS6YfwTW37OkV6D1vVWg4DwmQNOhetXG7KtwsGqmiRRmb8bBhI5FchPlB5zyUnj CGXYNAhp++wuY/B0o3cMYibg8QKuha3XEnkJay5qqvKxt+jirqb9p+zKS1YuZch+ujsP 54AezJJ1XkqQGHpiJ10PbGWOQEjxwv3XgEVQMlw3ih+fr7S2oNqV1K+acpUt2FO94biL buEkRtwBZ8O0vcQOzAOVuEVxMOIJi9/G4zM8qQeUQqj0QFwau/lgAPgH2jAA6IgPfAJc y7/+v0UkXOHNJx0r4B1YLFfcnSJlIwlkMkDf0PgvfRNMT04rrl8jIhs9YdUkMROoeeuE h4jA== X-Gm-Message-State: AOAM530DW+CrPSa183YlnzuT2IfBfNV1wW81TpmMaeB/LtwNxTimjX/5 C3yYHruReSWG7IwERwpWH81RhLnQn1ZKAEX9 X-Google-Smtp-Source: ABdhPJzAwwrFPGBSJE0/JA23oQFeyJUop/5KmND/ZPmSIvdbgxlGqhQCvWTSaVx1i1CYzx7YdrqVjg== X-Received: by 2002:a05:600c:4f0f:b0:394:54c1:f5b3 with SMTP id l15-20020a05600c4f0f00b0039454c1f5b3mr36099068wmq.33.1652864889525; Wed, 18 May 2022 02:08:09 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id h20-20020adfaa94000000b0020e617ccd10sm1153095wrc.59.2022.05.18.02.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:08:09 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 18 May 2022 10:08:01 +0100 Message-Id: <20220518090801.7229-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] py: Improve print methods for Transform and ColorSpace objects 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: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" They should now print out their meaningful string representations instead of "object at
". Signed-off-by: David Plowman --- src/py/libcamera/pymain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/py/libcamera/pymain.cpp b/src/py/libcamera/pymain.cpp index fb89975c..2ba5fcbb 100644 --- a/src/py/libcamera/pymain.cpp +++ b/src/py/libcamera/pymain.cpp @@ -567,6 +567,9 @@ PYBIND11_MODULE(_libcamera, m) .def("__str__", [](Transform &self) { return ""; }) + .def("__repr__", [](Transform &self) { + return ""; + }) .def_property("hflip", [](Transform &self) { return !!(self & Transform::HFlip); @@ -617,6 +620,9 @@ PYBIND11_MODULE(_libcamera, m) .def("__str__", [](ColorSpace &self) { return ""; }) + .def("__repr__", [](ColorSpace &self) { + return ""; + }) .def_readwrite("primaries", &ColorSpace::primaries) .def_readwrite("transferFunction", &ColorSpace::transferFunction) .def_readwrite("ycbcrEncoding", &ColorSpace::ycbcrEncoding)