Skip to content

Commit 06e6de5

Browse files
authored
Merge pull request #381 from ferdnyc/swig-python
Add repr to openshot.Version
2 parents 0347ad2 + 4a5eb20 commit 06e6de5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bindings/python/openshot.i

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,16 @@
153153
}
154154

155155
%extend openshot::OpenShotVersion {
156-
// Give the struct a string representation
156+
// Give the struct a string representation
157157
const std::string __str__() {
158158
return std::string(OPENSHOT_VERSION_FULL);
159159
}
160+
// And a repr for interactive use
161+
const std::string __repr__() {
162+
std::ostringstream result;
163+
result << "OpenShotVersion('" << OPENSHOT_VERSION_FULL << "')";
164+
return result.str();
165+
}
160166
}
161167

162168
%include "OpenShotVersion.h"

0 commit comments

Comments
 (0)