[libcamera-devel,v3,21/30] py: Add Request.__str__()
diff mbox series

Message ID 20220527144447.94891-22-tomi.valkeinen@ideasonboard.com
State Accepted
Headers show
Series
  • More misc Python patches
Related show

Commit Message

Tomi Valkeinen May 27, 2022, 2:44 p.m. UTC
Add Request.__str__() which maps directly to Request::toString().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 src/py/libcamera/py_main.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart May 29, 2022, 4:11 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Fri, May 27, 2022 at 05:44:38PM +0300, Tomi Valkeinen wrote:
> Add Request.__str__() which maps directly to Request::toString().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/py/libcamera/py_main.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
> index 3220a9e6..9e827845 100644
> --- a/src/py/libcamera/py_main.cpp
> +++ b/src/py/libcamera/py_main.cpp
> @@ -496,7 +496,8 @@ PYBIND11_MODULE(_libcamera, m)
>  		 * \todo As we add a keep_alive to the fb in addBuffers(), we
>  		 * can only allow reuse with ReuseBuffers.
>  		 */
> -		.def("reuse", [](Request &self) { self.reuse(Request::ReuseFlag::ReuseBuffers); });
> +		.def("reuse", [](Request &self) { self.reuse(Request::ReuseFlag::ReuseBuffers); })
> +		.def("__str__", &Request::toString);
>  
>  	pyRequestStatus
>  		.value("Pending", Request::RequestPending)

Patch
diff mbox series

diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
index 3220a9e6..9e827845 100644
--- a/src/py/libcamera/py_main.cpp
+++ b/src/py/libcamera/py_main.cpp
@@ -496,7 +496,8 @@  PYBIND11_MODULE(_libcamera, m)
 		 * \todo As we add a keep_alive to the fb in addBuffers(), we
 		 * can only allow reuse with ReuseBuffers.
 		 */
-		.def("reuse", [](Request &self) { self.reuse(Request::ReuseFlag::ReuseBuffers); });
+		.def("reuse", [](Request &self) { self.reuse(Request::ReuseFlag::ReuseBuffers); })
+		.def("__str__", &Request::toString);
 
 	pyRequestStatus
 		.value("Pending", Request::RequestPending)