From 4a5eb20202e01ee4cbde7ad62029dc13e8452a33 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Mon, 2 Dec 2019 22:27:52 -0500 Subject: [PATCH] Add __repr__ to openshot.Version --- src/bindings/python/openshot.i | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bindings/python/openshot.i b/src/bindings/python/openshot.i index a2228d75..44b1953e 100644 --- a/src/bindings/python/openshot.i +++ b/src/bindings/python/openshot.i @@ -153,10 +153,16 @@ } %extend openshot::OpenShotVersion { - // Give the struct a string representation + // Give the struct a string representation const std::string __str__() { return std::string(OPENSHOT_VERSION_FULL); } + // And a repr for interactive use + const std::string __repr__() { + std::ostringstream result; + result << "OpenShotVersion('" << OPENSHOT_VERSION_FULL << "')"; + return result.str(); + } } %include "OpenShotVersion.h"