Skip to content

Commit 0d167a6

Browse files
Renamed version module
And stopped renaming version function. This avoids an API change and mostly undoes 728456b, while solving the same problem.
1 parent 378f1f1 commit 0d167a6

File tree

11 files changed

+28
-30
lines changed

11 files changed

+28
-30
lines changed

CHANGELOG.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ 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
4443

4544
Changes in v0.17.5:
4645
1/ Binary wheels incorporate libexiv2 v0.28.7.

src/doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import exiv2
4343

4444
# The full version, including alpha/beta/rc tags
45-
release = '{} (exiv2 {})'.format(exiv2.__version__, exiv2.versionFull())
45+
release = '{} (exiv2 {})'.format(exiv2.__version__, exiv2.version())
4646
version = exiv2.__version__
4747

4848
# -- General configuration ---------------------------------------------------

src/doc/misc/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ See :ref:`genindex` for a full index to all classes, attributes, functions and m
3636
exiv2.tags
3737
exiv2.datasets
3838
exiv2.properties
39-
exiv2.version
39+
exiv2.version_module
4040
exiv2.error
4141
exiv2.easyaccess
4242
exiv2.basicio
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18-
%module(package="exiv2") version
18+
19+
// Module is not called "version" as there is a function "version"
20+
%module(package="exiv2") version_module
1921

2022
#ifndef SWIGIMPORTED
2123
%constant char* __doc__ = "Exiv2 library version information.";
@@ -29,9 +31,6 @@
2931
// Catch all C++ exceptions
3032
EXCEPTION()
3133

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

src/swig-0_27_7/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
__all__ += exiv2._types.__all__
4343
from exiv2.value import *
4444
__all__ += exiv2._value.__all__
45-
from exiv2.version import *
46-
__all__ += exiv2._version.__all__
45+
from exiv2.version_module import *
46+
__all__ += exiv2._version_module.__all__
4747
from exiv2.xmp import *
4848
__all__ += exiv2._xmp.__all__
4949

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
from sys import version_info as _swig_python_version_info
88
# Pull in all the attributes from the low-level C/C++ module
99
if __package__ or "." in __name__:
10-
from ._version import *
10+
from ._version_module import *
1111
else:
12-
from _version import *
12+
from _version_module import *
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define SWIGPYTHON_BUILTIN
1414
#define SWIGPYTHON_FASTPROXY
1515

16-
#define SWIG_name "_version"
16+
#define SWIG_name "_version_module"
1717
/* -----------------------------------------------------------------------------
1818
* This section contains generic SWIG labels for method/variable
1919
* declarations/attributes, and other compiler dependent labels.
@@ -4011,13 +4011,13 @@ static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0};
40114011
#define SWIG_TypeQuery SWIG_Python_TypeQuery
40124012

40134013
/*-----------------------------------------------
4014-
@(target):= _version.so
4014+
@(target):= _version_module.so
40154015
------------------------------------------------*/
40164016
#if PY_VERSION_HEX >= 0x03000000
4017-
# define SWIG_init PyInit__version
4017+
# define SWIG_init PyInit__version_module
40184018

40194019
#else
4020-
# define SWIG_init init_version
4020+
# define SWIG_init init_version_module
40214021

40224022
#endif
40234023

@@ -4624,11 +4624,11 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args
46244624
}
46254625

46264626

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

4631-
if (!SWIG_Python_UnpackTuple(args, "versionFull", 0, 0, 0)) SWIG_fail;
4631+
if (!SWIG_Python_UnpackTuple(args, "version", 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-
{ "versionFull", _wrap_versionFull, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
4699+
{ "version", _wrap_version, 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/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
__all__ += exiv2._types.__all__
4343
from exiv2.value import *
4444
__all__ += exiv2._value.__all__
45-
from exiv2.version import *
46-
__all__ += exiv2._version.__all__
45+
from exiv2.version_module import *
46+
__all__ += exiv2._version_module.__all__
4747
from exiv2.xmp import *
4848
__all__ += exiv2._xmp.__all__
4949

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
from sys import version_info as _swig_python_version_info
88
# Pull in all the attributes from the low-level C/C++ module
99
if __package__ or "." in __name__:
10-
from ._version import *
10+
from ._version_module import *
1111
else:
12-
from _version import *
12+
from _version_module import *
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define SWIGPYTHON_BUILTIN
1414
#define SWIGPYTHON_FASTPROXY
1515

16-
#define SWIG_name "_version"
16+
#define SWIG_name "_version_module"
1717
/* -----------------------------------------------------------------------------
1818
* This section contains generic SWIG labels for method/variable
1919
* declarations/attributes, and other compiler dependent labels.
@@ -4011,13 +4011,13 @@ static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0};
40114011
#define SWIG_TypeQuery SWIG_Python_TypeQuery
40124012

40134013
/*-----------------------------------------------
4014-
@(target):= _version.so
4014+
@(target):= _version_module.so
40154015
------------------------------------------------*/
40164016
#if PY_VERSION_HEX >= 0x03000000
4017-
# define SWIG_init PyInit__version
4017+
# define SWIG_init PyInit__version_module
40184018

40194019
#else
4020-
# define SWIG_init init_version
4020+
# define SWIG_init init_version_module
40214021

40224022
#endif
40234023

@@ -4628,11 +4628,11 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args
46284628
}
46294629

46304630

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

4635-
if (!SWIG_Python_UnpackTuple(args, "versionFull", 0, 0, 0)) SWIG_fail;
4635+
if (!SWIG_Python_UnpackTuple(args, "version", 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-
{ "versionFull", _wrap_versionFull, METH_NOARGS, "Return the version of %Exiv2 as \"C\" string eg \"0.27.0.2\"."},
4703+
{ "version", _wrap_version, 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"

0 commit comments

Comments
 (0)