{"id":15943,"url":"https://patchwork.libcamera.org/api/patches/15943/?format=json","web_url":"https://patchwork.libcamera.org/patch/15943/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220518090801.7229-1-david.plowman@raspberrypi.com>","date":"2022-05-18T09:08:01","name":"[libcamera-devel] py: Improve print methods for Transform and ColorSpace objects","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"126ee79cf5cc6455a0202ed00867850784aff277","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15943/mbox/","series":[{"id":3119,"url":"https://patchwork.libcamera.org/api/series/3119/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3119","date":"2022-05-18T09:08:01","name":"[libcamera-devel] py: Improve print methods for Transform and ColorSpace objects","version":1,"mbox":"https://patchwork.libcamera.org/series/3119/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15943/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15943/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3D54CC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 09:08:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8376365657;\n\tWed, 18 May 2022 11:08:11 +0200 (CEST)","from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24C2861FB9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 11:08:10 +0200 (CEST)","by mail-wm1-x336.google.com with SMTP id m62so735730wme.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 02:08:10 -0700 (PDT)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\th20-20020adfaa94000000b0020e617ccd10sm1153095wrc.59.2022.05.18.02.08.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 May 2022 02:08:09 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652864891;\n\tbh=PhexJFiWuw5ZGQx9zCaaqI2nqBvg4K/aj9pmERVdexQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=IAWmxnlmNSDeFVnkNdxhODDgMYx824QIoZvucxwj8NwLCgSomR4V9StKomz+v3ZPZ\n\thvWIhyDbpQBatbwJ0iKNmFfV0laDvG0KD3JR5K9e4xT+xR1GzBLnNcIoVAFcbMm8SY\n\tAJa4TBtCh6ZgR8Dg8gik4eAKC16mYo2IzvkVgBzGhjlB86DEMd4Sc79Imd7ar77gp5\n\tfYcnQyn4xFOqE3mMrigKxLbnpMET8h1M9wSeuB7trIlpmRw1gcz6aWoHAWVHm8WzHE\n\tighqfVW0TWE7AMSYzC2yPTqS+gjKkdJmycayq46zt7JvSSVTIYrTAU7Mw2PlirLNZs\n\tm9CSj4QAZSIwQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=U0Hr826nZlpRlI7INshlIsHMOTtiH1LfV3SV9HL5AMc=;\n\tb=Ocf9hqMlDv+5X1tQjeqZng+rHwUQhZXDjaq2sd4ltY1cjczwnnmyB8EFvQ7h9cd98F\n\tUMlruh25x1CE3s/uNCO770v8fsjX2VdFt8S3KEdxKqBlskWJKQziRx4yuVzXMVrluSN1\n\tkHku8jZfuIyxKAwXi1KZoIFbfCYtZuz77hO/nKpxF9kqc9chdw8fnjxlWXV+MIl/qXt6\n\t4Tbls8bOhiR8COx5UUBiuQF6npic6xBnV/XA5CMuIzgi717bPLuyHNoW6ZfsCEOVRPFq\n\td9eCbB5KeWRK8cOk+RpX0P7ntQc3bRCaOH7NYFtDf8WwBa1XU2VLeeCUU0KxzxUZSBuK\n\tsfSQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Ocf9hqMl\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=U0Hr826nZlpRlI7INshlIsHMOTtiH1LfV3SV9HL5AMc=;\n\tb=RnKdS6YfwTW37OkV6D1vVWg4DwmQNOhetXG7KtwsGqmiRRmb8bBhI5FchPlB5zyUnj\n\tCGXYNAhp++wuY/B0o3cMYibg8QKuha3XEnkJay5qqvKxt+jirqb9p+zKS1YuZch+ujsP\n\t54AezJJ1XkqQGHpiJ10PbGWOQEjxwv3XgEVQMlw3ih+fr7S2oNqV1K+acpUt2FO94biL\n\tbuEkRtwBZ8O0vcQOzAOVuEVxMOIJi9/G4zM8qQeUQqj0QFwau/lgAPgH2jAA6IgPfAJc\n\ty7/+v0UkXOHNJx0r4B1YLFfcnSJlIwlkMkDf0PgvfRNMT04rrl8jIhs9YdUkMROoeeuE\n\th4jA==","X-Gm-Message-State":"AOAM530DW+CrPSa183YlnzuT2IfBfNV1wW81TpmMaeB/LtwNxTimjX/5\n\tC3yYHruReSWG7IwERwpWH81RhLnQn1ZKAEX9","X-Google-Smtp-Source":"ABdhPJzAwwrFPGBSJE0/JA23oQFeyJUop/5KmND/ZPmSIvdbgxlGqhQCvWTSaVx1i1CYzx7YdrqVjg==","X-Received":"by 2002:a05:600c:4f0f:b0:394:54c1:f5b3 with SMTP id\n\tl15-20020a05600c4f0f00b0039454c1f5b3mr36099068wmq.33.1652864889525; \n\tWed, 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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] py: Improve print methods for Transform\n\tand ColorSpace objects","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"They should now print out their meaningful string representations\ninstead of \"object at <address>\".\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/py/libcamera/pymain.cpp | 6 ++++++\n 1 file changed, 6 insertions(+)","diff":"diff --git a/src/py/libcamera/pymain.cpp b/src/py/libcamera/pymain.cpp\nindex fb89975c..2ba5fcbb 100644\n--- a/src/py/libcamera/pymain.cpp\n+++ b/src/py/libcamera/pymain.cpp\n@@ -567,6 +567,9 @@ PYBIND11_MODULE(_libcamera, m)\n \t\t.def(\"__str__\", [](Transform &self) {\n \t\t\treturn \"<libcamera.Transform '\" + std::string(transformToString(self)) + \"'>\";\n \t\t})\n+\t\t.def(\"__repr__\", [](Transform &self) {\n+\t\t\treturn \"<libcamera.Transform '\" + std::string(transformToString(self)) + \"'>\";\n+\t\t})\n \t\t.def_property(\"hflip\",\n \t\t\t      [](Transform &self) {\n \t\t\t\t      return !!(self & Transform::HFlip);\n@@ -617,6 +620,9 @@ PYBIND11_MODULE(_libcamera, m)\n \t\t.def(\"__str__\", [](ColorSpace &self) {\n \t\t\treturn \"<libcamera.ColorSpace '\" + self.toString() + \"'>\";\n \t\t})\n+\t\t.def(\"__repr__\", [](ColorSpace &self) {\n+\t\t\treturn \"<libcamera.ColorSpace '\" + self.toString() + \"'>\";\n+\t\t})\n \t\t.def_readwrite(\"primaries\", &ColorSpace::primaries)\n \t\t.def_readwrite(\"transferFunction\", &ColorSpace::transferFunction)\n \t\t.def_readwrite(\"ycbcrEncoding\", &ColorSpace::ycbcrEncoding)\n","prefixes":["libcamera-devel"]}