Skip to content

Commit 728456b

Browse files
Renamed version function
The name clash with the version module was causing problems with documentation.
1 parent ad948a7 commit 728456b

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Changes in v0.18.0:
4040
12/ Deprecated keys(), values(), and items() methods and iterator of exiv2
4141
"data" structure types.
4242
13/ API CHANGE: exiv2.LogMsg.pythonHandler is replaced by exiv2.pythonHandler
43+
14/ API CHANGE: exiv2.version function renamed to exiv2.versionFull
4344

4445
Changes in v0.17.5:
4546
1/ Binary wheels incorporate libexiv2 v0.28.7.

src/interface/version.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
// Catch all C++ exceptions
3030
EXCEPTION()
3131

32+
// Rename version function to avoid name clash with version module
33+
%rename (versionFull) version;
34+
3235
// Function to report build options used
3336
%feature("docstring") versionInfo "Return a dict of libexiv2 build options."
3437
%fragment("set_EXV_ENABLE_FILESYSTEM");

src/swig-0_27_7/version_wrap.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4624,11 +4624,11 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args
46244624
}
46254625

46264626

4627-
SWIGINTERN PyObject *_wrap_version(PyObject *self, PyObject *args) {
4627+
SWIGINTERN PyObject *_wrap_versionFull(PyObject *self, PyObject *args) {
46284628
PyObject *resultobj = 0;
46294629
char *result = 0 ;
46304630

4631-
if (!SWIG_Python_UnpackTuple(args, "version", 0, 0, 0)) SWIG_fail;
4631+
if (!SWIG_Python_UnpackTuple(args, "versionFull", 0, 0, 0)) SWIG_fail;
46324632
{
46334633
try {
46344634
result = (char *)Exiv2::version();
@@ -4696,7 +4696,7 @@ static PyMethodDef SwigMethods[] = {
46964696
{ "versionNumber", _wrap_versionNumber, METH_NOARGS, "Return the version of %Exiv2 available at runtime as an integer."},
46974697
{ "versionString", _wrap_versionString, METH_NOARGS, "Return the version string Example: \"0.25.0\" (major.minor.patch)"},
46984698
{ "versionNumberHexString", _wrap_versionNumberHexString, METH_NOARGS, "Return the version of %Exiv2 as hex string of fixed length 6."},
4699-
{ "version", _wrap_version, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
4699+
{ "versionFull", _wrap_versionFull, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
47004700
{ "testVersion", _wrap_testVersion, METH_VARARGS, "\n"
47014701
"Test the version of the available %Exiv2 library at runtime. Return\n"
47024702
" true if it is the same as or newer than the passed-in version.\n"

src/swig-0_28_7/version_wrap.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4628,11 +4628,11 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args
46284628
}
46294629

46304630

4631-
SWIGINTERN PyObject *_wrap_version(PyObject *self, PyObject *args) {
4631+
SWIGINTERN PyObject *_wrap_versionFull(PyObject *self, PyObject *args) {
46324632
PyObject *resultobj = 0;
46334633
char *result = 0 ;
46344634

4635-
if (!SWIG_Python_UnpackTuple(args, "version", 0, 0, 0)) SWIG_fail;
4635+
if (!SWIG_Python_UnpackTuple(args, "versionFull", 0, 0, 0)) SWIG_fail;
46364636
{
46374637
try {
46384638
result = (char *)Exiv2::version();
@@ -4700,7 +4700,7 @@ static PyMethodDef SwigMethods[] = {
47004700
{ "versionNumber", _wrap_versionNumber, METH_NOARGS, "Return the version of %Exiv2 available at runtime as a uint32_t."},
47014701
{ "versionString", _wrap_versionString, METH_NOARGS, "Return the version string Example: \"0.25.0\" (major.minor.patch)"},
47024702
{ "versionNumberHexString", _wrap_versionNumberHexString, METH_NOARGS, "Return the version of %Exiv2 as hex string of fixed length 6."},
4703-
{ "version", _wrap_version, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
4703+
{ "versionFull", _wrap_versionFull, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
47044704
{ "testVersion", _wrap_testVersion, METH_VARARGS, "\n"
47054705
"Test the version of the available %Exiv2 library at runtime. Return\n"
47064706
" true if it is the same as or newer than the passed-in version.\n"

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_module(self):
2727
result = exiv2.testVersion(0, 27, 0)
2828
self.assertIsInstance(result, bool)
2929
self.assertEqual(result, True)
30-
version = exiv2.version()
30+
version = exiv2.versionFull()
3131
self.assertIsInstance(version, str)
3232
self.assertGreaterEqual(version, '0.27.0')
3333
version_tuple = tuple(int(x) for x in version.split('.')[:3])

0 commit comments

Comments
 (0)