Add __repr__ to openshot.Version

This commit is contained in:
FeRD (Frank Dana)
2019-12-02 22:27:52 -05:00
parent c04dc94cc8
commit 4a5eb20202

View File

@@ -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"