From ff4c9ce43432c2135fa2a9ca1d36fa8d1b7a4449 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 10:21:27 +0000 Subject: [PATCH 01/12] Moved exception handler to its own file Some modules (e.g. error.i) may not need the exception handler at all. --- src/interface/basicio.i | 4 +++ src/interface/datasets.i | 6 +++- src/interface/easyaccess.i | 6 +++- src/interface/exif.i | 4 +++ src/interface/image.i | 6 +++- src/interface/iptc.i | 4 +++ src/interface/metadatum.i | 6 +++- src/interface/preview.i | 6 +++- src/interface/properties.i | 4 +++ src/interface/shared/exception.i | 52 ++++++++++++++++++++++++++++++ src/interface/shared/preamble.i | 41 +---------------------- src/interface/tags.i | 4 +++ src/interface/types.i | 4 +++ src/interface/value.i | 4 +++ src/interface/version.i | 6 +++- src/interface/xmp.i | 4 +++ src/swig-0_27_0/basicio_wrap.cxx | 6 ++-- src/swig-0_27_0/error_wrap.cxx | 46 ++------------------------ src/swig-0_27_0/exif_wrap.cxx | 8 ++--- src/swig-0_27_0/image_wrap.cxx | 6 ++-- src/swig-0_27_0/iptc_wrap.cxx | 8 ++--- src/swig-0_27_0/metadatum_wrap.cxx | 6 ++-- src/swig-0_27_0/preview_wrap.cxx | 12 +++---- src/swig-0_27_0/types_wrap.cxx | 12 +++---- src/swig-0_27_0/value_wrap.cxx | 12 +++---- src/swig-0_27_0/version_wrap.cxx | 8 ++--- src/swig-0_27_0/xmp_wrap.cxx | 8 ++--- src/swig-0_27_4/basicio_wrap.cxx | 6 ++-- src/swig-0_27_4/error_wrap.cxx | 46 ++------------------------ src/swig-0_27_4/exif_wrap.cxx | 8 ++--- src/swig-0_27_4/image_wrap.cxx | 6 ++-- src/swig-0_27_4/iptc_wrap.cxx | 8 ++--- src/swig-0_27_4/metadatum_wrap.cxx | 6 ++-- src/swig-0_27_4/preview_wrap.cxx | 12 +++---- src/swig-0_27_4/types_wrap.cxx | 12 +++---- src/swig-0_27_4/value_wrap.cxx | 12 +++---- src/swig-0_27_4/version_wrap.cxx | 8 ++--- src/swig-0_27_4/xmp_wrap.cxx | 8 ++--- src/swig-0_28_0/basicio_wrap.cxx | 6 ++-- src/swig-0_28_0/error_wrap.cxx | 50 ++-------------------------- src/swig-0_28_0/exif_wrap.cxx | 8 ++--- src/swig-0_28_0/image_wrap.cxx | 6 ++-- src/swig-0_28_0/iptc_wrap.cxx | 8 ++--- src/swig-0_28_0/metadatum_wrap.cxx | 6 ++-- src/swig-0_28_0/preview_wrap.cxx | 12 +++---- src/swig-0_28_0/types_wrap.cxx | 12 +++---- src/swig-0_28_0/value_wrap.cxx | 12 +++---- src/swig-0_28_0/version_wrap.cxx | 8 ++--- src/swig-0_28_0/xmp_wrap.cxx | 8 ++--- 49 files changed, 250 insertions(+), 311 deletions(-) create mode 100644 src/interface/shared/exception.i diff --git a/src/interface/basicio.i b/src/interface/basicio.i index 37c7ba1c..1f06ff3f 100644 --- a/src/interface/basicio.i +++ b/src/interface/basicio.i @@ -23,6 +23,7 @@ %include "shared/preamble.i" %include "shared/buffers.i" %include "shared/enum.i" +%include "shared/exception.i" %include "shared/keep_reference.i" %include "shared/unique_ptr.i" %include "shared/windows_path.i" @@ -31,6 +32,9 @@ %import "types.i" +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::BasicIo); // Potentially blocking calls allow Python threads diff --git a/src/interface/datasets.i b/src/interface/datasets.i index 3450df9b..3c560338 100644 --- a/src/interface/datasets.i +++ b/src/interface/datasets.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -18,11 +18,15 @@ %module(package="exiv2") datasets %include "shared/preamble.i" +%include "shared/exception.i" %include "shared/static_list.i" %include "shared/unique_ptr.i" %import "metadatum.i" +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::IptcKey); // IptcDataSets::application2RecordList and IptcDataSets::envelopeRecordList diff --git a/src/interface/easyaccess.i b/src/interface/easyaccess.i index ec1fe0bf..0208ac98 100644 --- a/src/interface/easyaccess.i +++ b/src/interface/easyaccess.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -18,6 +18,10 @@ %module(package="exiv2") easyaccess %include "shared/preamble.i" +%include "shared/exception.i" + +// Catch all C++ exceptions +EXCEPTION(,) // Store data.end() after converting input %typemap(check) Exiv2::ExifData& (Exiv2::ExifData::const_iterator _global_end) %{ diff --git a/src/interface/exif.i b/src/interface/exif.i index 8b4cf129..8488adb5 100644 --- a/src/interface/exif.i +++ b/src/interface/exif.i @@ -21,6 +21,7 @@ %include "shared/buffers.i" %include "shared/containers.i" %include "shared/data_iterator.i" +%include "shared/exception.i" %include "shared/keep_reference.i" %include "shared/windows_path.i" @@ -30,6 +31,9 @@ %import "metadatum.i" %import "tags.i" +// Catch all C++ exceptions +EXCEPTION(,) + // ExifThumb keeps a reference to the ExifData it uses KEEP_REFERENCE_EX(Exiv2::ExifThumb*, swig_obj[0]) diff --git a/src/interface/image.i b/src/interface/image.i index 13b59af5..84e47446 100644 --- a/src/interface/image.i +++ b/src/interface/image.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ %include "shared/preamble.i" %include "shared/buffers.i" %include "shared/enum.i" +%include "shared/exception.i" %include "shared/keep_reference.i" %include "shared/windows_path.i" @@ -34,6 +35,9 @@ %import "tags.i"; %import "xmp.i"; +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::Image); // Potentially blocking calls allow Python threads diff --git a/src/interface/iptc.i b/src/interface/iptc.i index 866b3df5..cd74f933 100644 --- a/src/interface/iptc.i +++ b/src/interface/iptc.i @@ -20,6 +20,7 @@ %include "shared/preamble.i" %include "shared/containers.i" %include "shared/data_iterator.i" +%include "shared/exception.i" %include "stdint.i" %include "std_string.i" @@ -27,6 +28,9 @@ %import "datasets.i" %import "metadatum.i" +// Catch all C++ exceptions +EXCEPTION(,) + EXTEND_METADATUM(Exiv2::Iptcdatum) DATA_ITERATOR_TYPEMAPS(IptcData_iterator, Exiv2::IptcData::iterator) diff --git a/src/interface/metadatum.i b/src/interface/metadatum.i index 11f84f42..c6b5a77e 100644 --- a/src/interface/metadatum.i +++ b/src/interface/metadatum.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #pragma SWIG nowarn=314 // 'print' is a python keyword, renaming to '_print' %include "shared/preamble.i" +%include "shared/exception.i" %include "shared/keep_reference.i" %include "shared/unique_ptr.i" @@ -28,6 +29,9 @@ %import "types.i" %import "value.i" +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::Key); // Keep a reference to Metadatum when calling value() diff --git a/src/interface/preview.i b/src/interface/preview.i index c89f96e8..22e031a2 100644 --- a/src/interface/preview.i +++ b/src/interface/preview.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ %include "shared/preamble.i" %include "shared/buffers.i" +%include "shared/exception.i" %include "shared/keep_reference.i" %include "shared/windows_path.i" @@ -31,6 +32,9 @@ %import "image.i"; %import "types.i"; +// Catch all C++ exceptions +EXCEPTION(,) + // Some calls don't raise exceptions %noexception Exiv2::PreviewImage::__len__; %noexception Exiv2::PreviewImage::extension; diff --git a/src/interface/properties.i b/src/interface/properties.i index c9a47aa5..af73e0cc 100644 --- a/src/interface/properties.i +++ b/src/interface/properties.i @@ -18,6 +18,7 @@ %module(package="exiv2") properties %include "shared/preamble.i" +%include "shared/exception.i" %include "shared/enum.i" %include "shared/static_list.i" %include "shared/unique_ptr.i" @@ -25,6 +26,9 @@ %import "datasets.i" %import "metadatum.i" +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::XmpKey); // Make Xmp category more Pythonic diff --git a/src/interface/shared/exception.i b/src/interface/shared/exception.i new file mode 100644 index 00000000..d8a48534 --- /dev/null +++ b/src/interface/shared/exception.i @@ -0,0 +1,52 @@ +// python-exiv2 - Python interface to libexiv2 +// http://github.com/jim-easterbrook/python-exiv2 +// Copyright (C) 2024 Jim Easterbrook jim@jim-easterbrook.me.uk +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +%include "shared/fragments.i" + +// Import PyExc_Exiv2Error exception +%fragment("_import_exception_decl", "header") { +static PyObject* PyExc_Exiv2Error = NULL; +} +%fragment("import_exception", "init", fragment="_import_exception_decl", + fragment="import_exiv2") { +{ + PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); + if (!PyExc_Exiv2Error) + return NULL; +} +} + +// Macro to define %exception directives +%define EXCEPTION(method, precheck) +%fragment("import_exception"); +%exception method { +precheck + try { + $action +#if EXIV2_VERSION_HEX < 0x001c0000 + } catch(Exiv2::AnyError const& e) { +#else + } catch(Exiv2::Error const& e) { +#endif + PyErr_SetString(PyExc_Exiv2Error, e.what()); + SWIG_fail; + } catch(std::exception const& e) { + PyErr_SetString(PyExc_RuntimeError, e.what()); + SWIG_fail; + } +} +%enddef // EXCEPTION diff --git a/src/interface/shared/preamble.i b/src/interface/shared/preamble.i index 0a7b0ce7..16131cd8 100644 --- a/src/interface/shared/preamble.i +++ b/src/interface/shared/preamble.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -19,8 +19,6 @@ #include "exiv2/exiv2.hpp" %} -%include "shared/fragments.i" - // EXIV2API prepends every function declaration #define EXIV2API // Older versions of libexiv2 define these as well @@ -30,40 +28,3 @@ #ifndef SWIG_DOXYGEN %feature("autodoc", "2"); #endif - -// Import PyExc_Exiv2Error exception -%fragment("_import_exception_decl", "header") { -static PyObject* PyExc_Exiv2Error = NULL; -} -%fragment("import_exception", "init", fragment="_import_exception_decl", - fragment="import_exiv2") { -{ - PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); - if (!PyExc_Exiv2Error) - return NULL; -} -} - -// Macro to define %exception directives -%define EXCEPTION(method, precheck) -%fragment("import_exception"); -%exception method { -precheck - try { - $action -#if EXIV2_VERSION_HEX < 0x001c0000 - } catch(Exiv2::AnyError const& e) { -#else - } catch(Exiv2::Error const& e) { -#endif - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } -} -%enddef // EXCEPTION - -// Catch all C++ exceptions -EXCEPTION(,) diff --git a/src/interface/tags.i b/src/interface/tags.i index b1506a45..3558b612 100644 --- a/src/interface/tags.i +++ b/src/interface/tags.i @@ -21,11 +21,15 @@ #if EXIV2_VERSION_HEX >= 0x001c0000 %include "shared/enum.i" #endif +%include "shared/exception.i" %include "shared/static_list.i" %include "shared/unique_ptr.i" %import "metadatum.i"; +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::ExifKey); // Add Exif specific enums diff --git a/src/interface/types.i b/src/interface/types.i index a9cdefdc..fb823920 100644 --- a/src/interface/types.i +++ b/src/interface/types.i @@ -20,11 +20,15 @@ %include "shared/preamble.i" %include "shared/buffers.i" %include "shared/enum.i" +%include "shared/exception.i" %include "stdint.i" %include "std_pair.i" %include "std_string.i" +// Catch all C++ exceptions +EXCEPTION(,) + // Some calls don't raise exceptions %noexception Exiv2::DataBuf::data; %noexception Exiv2::DataBuf::free; diff --git a/src/interface/value.i b/src/interface/value.i index a0ed1463..7bc25bc8 100644 --- a/src/interface/value.i +++ b/src/interface/value.i @@ -24,6 +24,7 @@ %include "shared/preamble.i" %include "shared/buffers.i" %include "shared/enum.i" +%include "shared/exception.i" %include "shared/fragments.i" %include "shared/unique_ptr.i" @@ -35,6 +36,9 @@ %import "types.i" +// Catch all C++ exceptions +EXCEPTION(,) + UNIQUE_PTR(Exiv2::Value); // Remove exception handler for some methods known to be safe diff --git a/src/interface/version.i b/src/interface/version.i index 003e7f36..4ad4061f 100644 --- a/src/interface/version.i +++ b/src/interface/version.i @@ -1,6 +1,6 @@ // python-exiv2 - Python interface to libexiv2 // http://github.com/jim-easterbrook/python-exiv2 -// Copyright (C) 2021-23 Jim Easterbrook jim@jim-easterbrook.me.uk +// Copyright (C) 2021-24 Jim Easterbrook jim@jim-easterbrook.me.uk // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -18,10 +18,14 @@ %module(package="exiv2") version %include "shared/preamble.i" +%include "shared/exception.i" %include "stdint.i" %include "std_string.i" +// Catch all C++ exceptions +EXCEPTION(,) + // Function to report build options used %feature("docstring") versionInfo "Return a dict of libexiv2 build options." %inline %{ diff --git a/src/interface/xmp.i b/src/interface/xmp.i index 328c4037..d2e1617c 100644 --- a/src/interface/xmp.i +++ b/src/interface/xmp.i @@ -20,6 +20,7 @@ %include "shared/preamble.i" %include "shared/containers.i" %include "shared/data_iterator.i" +%include "shared/exception.i" %include "stdint.i" %include "std_string.i" @@ -27,6 +28,9 @@ %import "metadatum.i" %import "properties.i" +// Catch all C++ exceptions +EXCEPTION(,) + EXTEND_METADATUM(Exiv2::Xmpdatum) DATA_ITERATOR_TYPEMAPS(XmpData_iterator, Exiv2::XmpData::iterator) diff --git a/src/swig-0_27_0/basicio_wrap.cxx b/src/swig-0_27_0/basicio_wrap.cxx index 4ca34554..14405a1c 100644 --- a/src/swig-0_27_0/basicio_wrap.cxx +++ b/src/swig-0_27_0/basicio_wrap.cxx @@ -4119,13 +4119,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static int Exiv2_BasicIo_getbuff( diff --git a/src/swig-0_27_0/error_wrap.cxx b/src/swig-0_27_0/error_wrap.cxx index c32fdb8b..8458ea15 100644 --- a/src/swig-0_27_0/error_wrap.cxx +++ b/src/swig-0_27_0/error_wrap.cxx @@ -4101,12 +4101,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include #include @@ -4206,18 +4200,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_setLevel(PyObject *self, PyObject *args) { } arg1 = (Exiv2::LogMsg::Level)PyLong_AsLong(swig_obj[0]); } - { - try { - Exiv2::LogMsg::setLevel(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + Exiv2::LogMsg::setLevel(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -4230,18 +4213,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_level(PyObject *self, PyObject *args) { Exiv2::LogMsg::Level result; if (!SWIG_Python_UnpackTuple(args, "LogMsg_level", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5098,20 +5070,6 @@ SWIG_init(void) { SWIG_InstallConstants(d,swig_const_table); - { - exiv2_module = PyImport_ImportModule("exiv2"); - if (!exiv2_module) - return NULL; - } - - - { - PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); - if (!PyExc_Exiv2Error) - return NULL; - } - - { PyObject *module = PyImport_ImportModule("logging"); if (!module) diff --git a/src/swig-0_27_0/exif_wrap.cxx b/src/swig-0_27_0/exif_wrap.cxx index 06d60800..1e6ebaa2 100644 --- a/src/swig-0_27_0/exif_wrap.cxx +++ b/src/swig-0_27_0/exif_wrap.cxx @@ -4138,16 +4138,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_27_0/image_wrap.cxx b/src/swig-0_27_0/image_wrap.cxx index c9f88588..0c227477 100644 --- a/src/swig-0_27_0/image_wrap.cxx +++ b/src/swig-0_27_0/image_wrap.cxx @@ -4153,13 +4153,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static bool enableBMFF(bool enable) { diff --git a/src/swig-0_27_0/iptc_wrap.cxx b/src/swig-0_27_0/iptc_wrap.cxx index 51d47b3b..db1222b8 100644 --- a/src/swig-0_27_0/iptc_wrap.cxx +++ b/src/swig-0_27_0/iptc_wrap.cxx @@ -4137,16 +4137,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_27_0/metadatum_wrap.cxx b/src/swig-0_27_0/metadatum_wrap.cxx index 09871255..5fbbcf63 100644 --- a/src/swig-0_27_0/metadatum_wrap.cxx +++ b/src/swig-0_27_0/metadatum_wrap.cxx @@ -4130,13 +4130,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; SWIGINTERN swig_type_info* diff --git a/src/swig-0_27_0/preview_wrap.cxx b/src/swig-0_27_0/preview_wrap.cxx index db71dcf0..5caf5bc8 100644 --- a/src/swig-0_27_0/preview_wrap.cxx +++ b/src/swig-0_27_0/preview_wrap.cxx @@ -4155,12 +4155,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include @@ -4317,6 +4311,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + namespace swig { template struct noconst_traits { diff --git a/src/swig-0_27_0/types_wrap.cxx b/src/swig-0_27_0/types_wrap.cxx index 2c868ca3..07f44852 100644 --- a/src/swig-0_27_0/types_wrap.cxx +++ b/src/swig-0_27_0/types_wrap.cxx @@ -4113,12 +4113,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4139,6 +4133,12 @@ static PyObject* exiv2_module = NULL; #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index c1e8e723..98b63e3e 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -4132,12 +4132,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4306,6 +4300,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; diff --git a/src/swig-0_27_0/version_wrap.cxx b/src/swig-0_27_0/version_wrap.cxx index 2f98631e..d23f5d20 100644 --- a/src/swig-0_27_0/version_wrap.cxx +++ b/src/swig-0_27_0/version_wrap.cxx @@ -4106,16 +4106,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static PyObject* versionInfo() { diff --git a/src/swig-0_27_0/xmp_wrap.cxx b/src/swig-0_27_0/xmp_wrap.cxx index 4dd314b5..7bc025a8 100644 --- a/src/swig-0_27_0/xmp_wrap.cxx +++ b/src/swig-0_27_0/xmp_wrap.cxx @@ -4141,16 +4141,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_27_4/basicio_wrap.cxx b/src/swig-0_27_4/basicio_wrap.cxx index 4ca34554..14405a1c 100644 --- a/src/swig-0_27_4/basicio_wrap.cxx +++ b/src/swig-0_27_4/basicio_wrap.cxx @@ -4119,13 +4119,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static int Exiv2_BasicIo_getbuff( diff --git a/src/swig-0_27_4/error_wrap.cxx b/src/swig-0_27_4/error_wrap.cxx index c32fdb8b..8458ea15 100644 --- a/src/swig-0_27_4/error_wrap.cxx +++ b/src/swig-0_27_4/error_wrap.cxx @@ -4101,12 +4101,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include #include @@ -4206,18 +4200,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_setLevel(PyObject *self, PyObject *args) { } arg1 = (Exiv2::LogMsg::Level)PyLong_AsLong(swig_obj[0]); } - { - try { - Exiv2::LogMsg::setLevel(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + Exiv2::LogMsg::setLevel(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -4230,18 +4213,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_level(PyObject *self, PyObject *args) { Exiv2::LogMsg::Level result; if (!SWIG_Python_UnpackTuple(args, "LogMsg_level", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5098,20 +5070,6 @@ SWIG_init(void) { SWIG_InstallConstants(d,swig_const_table); - { - exiv2_module = PyImport_ImportModule("exiv2"); - if (!exiv2_module) - return NULL; - } - - - { - PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); - if (!PyExc_Exiv2Error) - return NULL; - } - - { PyObject *module = PyImport_ImportModule("logging"); if (!module) diff --git a/src/swig-0_27_4/exif_wrap.cxx b/src/swig-0_27_4/exif_wrap.cxx index 06d60800..1e6ebaa2 100644 --- a/src/swig-0_27_4/exif_wrap.cxx +++ b/src/swig-0_27_4/exif_wrap.cxx @@ -4138,16 +4138,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_27_4/image_wrap.cxx b/src/swig-0_27_4/image_wrap.cxx index c9f88588..0c227477 100644 --- a/src/swig-0_27_4/image_wrap.cxx +++ b/src/swig-0_27_4/image_wrap.cxx @@ -4153,13 +4153,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static bool enableBMFF(bool enable) { diff --git a/src/swig-0_27_4/iptc_wrap.cxx b/src/swig-0_27_4/iptc_wrap.cxx index 51d47b3b..db1222b8 100644 --- a/src/swig-0_27_4/iptc_wrap.cxx +++ b/src/swig-0_27_4/iptc_wrap.cxx @@ -4137,16 +4137,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_27_4/metadatum_wrap.cxx b/src/swig-0_27_4/metadatum_wrap.cxx index 09871255..5fbbcf63 100644 --- a/src/swig-0_27_4/metadatum_wrap.cxx +++ b/src/swig-0_27_4/metadatum_wrap.cxx @@ -4130,13 +4130,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; SWIGINTERN swig_type_info* diff --git a/src/swig-0_27_4/preview_wrap.cxx b/src/swig-0_27_4/preview_wrap.cxx index db71dcf0..5caf5bc8 100644 --- a/src/swig-0_27_4/preview_wrap.cxx +++ b/src/swig-0_27_4/preview_wrap.cxx @@ -4155,12 +4155,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include @@ -4317,6 +4311,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + namespace swig { template struct noconst_traits { diff --git a/src/swig-0_27_4/types_wrap.cxx b/src/swig-0_27_4/types_wrap.cxx index 2c868ca3..07f44852 100644 --- a/src/swig-0_27_4/types_wrap.cxx +++ b/src/swig-0_27_4/types_wrap.cxx @@ -4113,12 +4113,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4139,6 +4133,12 @@ static PyObject* exiv2_module = NULL; #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index c1e8e723..98b63e3e 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -4132,12 +4132,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4306,6 +4300,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; diff --git a/src/swig-0_27_4/version_wrap.cxx b/src/swig-0_27_4/version_wrap.cxx index 2f98631e..d23f5d20 100644 --- a/src/swig-0_27_4/version_wrap.cxx +++ b/src/swig-0_27_4/version_wrap.cxx @@ -4106,16 +4106,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static PyObject* versionInfo() { diff --git a/src/swig-0_27_4/xmp_wrap.cxx b/src/swig-0_27_4/xmp_wrap.cxx index 4dd314b5..7bc025a8 100644 --- a/src/swig-0_27_4/xmp_wrap.cxx +++ b/src/swig-0_27_4/xmp_wrap.cxx @@ -4141,16 +4141,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_28_0/basicio_wrap.cxx b/src/swig-0_28_0/basicio_wrap.cxx index 10f04a6f..74853c2c 100644 --- a/src/swig-0_28_0/basicio_wrap.cxx +++ b/src/swig-0_28_0/basicio_wrap.cxx @@ -4119,13 +4119,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static int Exiv2_BasicIo_getbuff( diff --git a/src/swig-0_28_0/error_wrap.cxx b/src/swig-0_28_0/error_wrap.cxx index 0a81afc7..26981b81 100644 --- a/src/swig-0_28_0/error_wrap.cxx +++ b/src/swig-0_28_0/error_wrap.cxx @@ -4101,12 +4101,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include #include @@ -4206,20 +4200,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_setLevel(PyObject *self, PyObject *args) { } arg1 = (Exiv2::LogMsg::Level)PyLong_AsLong(swig_obj[0]); } - { - try { - Exiv2::LogMsg::setLevel(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + Exiv2::LogMsg::setLevel(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -4232,20 +4213,7 @@ SWIGINTERN PyObject *_wrap_LogMsg_level(PyObject *self, PyObject *args) { Exiv2::LogMsg::Level result; if (!SWIG_Python_UnpackTuple(args, "LogMsg_level", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::LogMsg::Level)Exiv2::LogMsg::level(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5102,20 +5070,6 @@ SWIG_init(void) { SWIG_InstallConstants(d,swig_const_table); - { - exiv2_module = PyImport_ImportModule("exiv2"); - if (!exiv2_module) - return NULL; - } - - - { - PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); - if (!PyExc_Exiv2Error) - return NULL; - } - - { PyObject *module = PyImport_ImportModule("logging"); if (!module) diff --git a/src/swig-0_28_0/exif_wrap.cxx b/src/swig-0_28_0/exif_wrap.cxx index cda78b26..56ff551b 100644 --- a/src/swig-0_28_0/exif_wrap.cxx +++ b/src/swig-0_28_0/exif_wrap.cxx @@ -4138,16 +4138,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_28_0/image_wrap.cxx b/src/swig-0_28_0/image_wrap.cxx index 0aaf42d1..3ac07501 100644 --- a/src/swig-0_28_0/image_wrap.cxx +++ b/src/swig-0_28_0/image_wrap.cxx @@ -4153,13 +4153,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static bool enableBMFF(bool enable) { diff --git a/src/swig-0_28_0/iptc_wrap.cxx b/src/swig-0_28_0/iptc_wrap.cxx index 0e532823..527542fe 100644 --- a/src/swig-0_28_0/iptc_wrap.cxx +++ b/src/swig-0_28_0/iptc_wrap.cxx @@ -4137,16 +4137,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing diff --git a/src/swig-0_28_0/metadatum_wrap.cxx b/src/swig-0_28_0/metadatum_wrap.cxx index 7955fa3b..91e7cfb9 100644 --- a/src/swig-0_28_0/metadatum_wrap.cxx +++ b/src/swig-0_28_0/metadatum_wrap.cxx @@ -4130,13 +4130,13 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include -static PyObject* exiv2_module = NULL; +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; SWIGINTERN swig_type_info* diff --git a/src/swig-0_28_0/preview_wrap.cxx b/src/swig-0_28_0/preview_wrap.cxx index 01e3dee8..314c1a12 100644 --- a/src/swig-0_28_0/preview_wrap.cxx +++ b/src/swig-0_28_0/preview_wrap.cxx @@ -4155,12 +4155,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include @@ -4317,6 +4311,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + namespace swig { template struct noconst_traits { diff --git a/src/swig-0_28_0/types_wrap.cxx b/src/swig-0_28_0/types_wrap.cxx index 9ed97169..d613a134 100644 --- a/src/swig-0_28_0/types_wrap.cxx +++ b/src/swig-0_28_0/types_wrap.cxx @@ -4112,12 +4112,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4138,6 +4132,12 @@ static PyObject* exiv2_module = NULL; #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 007a3cd8..383ca3fe 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -4132,12 +4132,6 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; - - -static PyObject* exiv2_module = NULL; - - #include // Use the C99 official header @@ -4306,6 +4300,12 @@ namespace swig { #include +static PyObject* PyExc_Exiv2Error = NULL; + + +static PyObject* exiv2_module = NULL; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; diff --git a/src/swig-0_28_0/version_wrap.cxx b/src/swig-0_28_0/version_wrap.cxx index 3ecb7f02..2624ed5b 100644 --- a/src/swig-0_28_0/version_wrap.cxx +++ b/src/swig-0_28_0/version_wrap.cxx @@ -4106,16 +4106,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; static PyObject* versionInfo() { diff --git a/src/swig-0_28_0/xmp_wrap.cxx b/src/swig-0_28_0/xmp_wrap.cxx index 1ab0ab09..1a2b4ada 100644 --- a/src/swig-0_28_0/xmp_wrap.cxx +++ b/src/swig-0_28_0/xmp_wrap.cxx @@ -4141,16 +4141,16 @@ namespace swig { #include "exiv2/exiv2.hpp" -static PyObject* PyExc_Exiv2Error = NULL; +#include // Use the C99 official header -static PyObject* exiv2_module = NULL; +#include -#include // Use the C99 official header +static PyObject* PyExc_Exiv2Error = NULL; -#include +static PyObject* exiv2_module = NULL; // Base class implements all methods except dereferencing From 729db7900899bc61d44702c0b48e659e62339892 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 10:23:23 +0000 Subject: [PATCH 02/12] Update change log --- CHANGELOG.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8adba329..bbf101e5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . +Changes in v0.16.2: + 1/ Removed AnyError alias of Exiv2Error exception. + 2/ Improved handling of enums: + 1/ Enum results are returned as Python enum instead of int. + 2/ Passing ints as enum parameters is deprecated. + 3/ SWIG v4.1.0 or later required to run SWIG. + Changes in v0.16.1: 1/ Binary wheels incorporate libexiv2 v0.27.7. From 7ebfd91dd2c43c01bed0fe630300fad75a31f68e Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 10:49:40 +0000 Subject: [PATCH 03/12] Cache imported enum objects --- src/interface/shared/enum.i | 41 ++++++++++------ src/swig-0_27_0/basicio_wrap.cxx | 16 +++++-- src/swig-0_27_0/datasets_wrap.cxx | 12 +++-- src/swig-0_27_0/error_wrap.cxx | 16 +++++-- src/swig-0_27_0/exif_wrap.cxx | 24 ++++++---- src/swig-0_27_0/image_wrap.cxx | 36 +++++++++------ src/swig-0_27_0/iptc_wrap.cxx | 24 ++++++---- src/swig-0_27_0/metadatum_wrap.cxx | 24 ++++++---- src/swig-0_27_0/properties_wrap.cxx | 24 ++++++---- src/swig-0_27_0/tags_wrap.cxx | 12 +++-- src/swig-0_27_0/types_wrap.cxx | 12 +++-- src/swig-0_27_0/value_wrap.cxx | 72 ++++++++++++++++++++--------- src/swig-0_27_0/xmp_wrap.cxx | 24 ++++++---- src/swig-0_27_4/basicio_wrap.cxx | 16 +++++-- src/swig-0_27_4/datasets_wrap.cxx | 12 +++-- src/swig-0_27_4/error_wrap.cxx | 16 +++++-- src/swig-0_27_4/exif_wrap.cxx | 24 ++++++---- src/swig-0_27_4/image_wrap.cxx | 36 +++++++++------ src/swig-0_27_4/iptc_wrap.cxx | 24 ++++++---- src/swig-0_27_4/metadatum_wrap.cxx | 24 ++++++---- src/swig-0_27_4/properties_wrap.cxx | 24 ++++++---- src/swig-0_27_4/tags_wrap.cxx | 12 +++-- src/swig-0_27_4/types_wrap.cxx | 12 +++-- src/swig-0_27_4/value_wrap.cxx | 72 ++++++++++++++++++++--------- src/swig-0_27_4/xmp_wrap.cxx | 24 ++++++---- src/swig-0_28_0/basicio_wrap.cxx | 16 +++++-- src/swig-0_28_0/datasets_wrap.cxx | 12 +++-- src/swig-0_28_0/error_wrap.cxx | 16 +++++-- src/swig-0_28_0/exif_wrap.cxx | 24 ++++++---- src/swig-0_28_0/image_wrap.cxx | 48 +++++++++++-------- src/swig-0_28_0/iptc_wrap.cxx | 24 ++++++---- src/swig-0_28_0/metadatum_wrap.cxx | 24 ++++++---- src/swig-0_28_0/properties_wrap.cxx | 24 ++++++---- src/swig-0_28_0/tags_wrap.cxx | 36 +++++++++------ src/swig-0_28_0/types_wrap.cxx | 12 +++-- src/swig-0_28_0/value_wrap.cxx | 72 ++++++++++++++++++++--------- src/swig-0_28_0/xmp_wrap.cxx | 24 ++++++---- 37 files changed, 605 insertions(+), 360 deletions(-) diff --git a/src/interface/shared/enum.i b/src/interface/shared/enum.i index d7cda8e8..6cb4f2f0 100644 --- a/src/interface/shared/enum.i +++ b/src/interface/shared/enum.i @@ -20,7 +20,12 @@ %include "shared/fragments.i" -%define _ENUM_TYPEMAPS(pattern) +%define _ENUM_COMMON(pattern) +// static variable to hold Python enum object +%fragment("_declare_enum_object"{pattern}, "header") { +static PyObject* PyEnum_%mangle(pattern) = NULL; +} + // typemap to disambiguate enum from int %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, fragment="import_py_enum") pattern { @@ -63,7 +68,7 @@ static PyObject* py_from_enum(pattern value) { if (!$result) SWIG_fail; } -%enddef // _ENUM_TYPEMAPS +%enddef // _ENUM_COMMON // Function to return enum members as Python list %fragment("get_enum_list", "header") { @@ -103,16 +108,16 @@ static PyObject* Py_IntEnum = NULL; } %define ENUM(name, doc, contents...) -_ENUM_TYPEMAPS(Exiv2::name); +_ENUM_COMMON(Exiv2::name); // fragment to get enum object %fragment("get_enum_typeobject"{Exiv2::name}, "header", - fragment="import_exiv2") { + fragment="import_exiv2", + fragment="_declare_enum_object"{Exiv2::name}) { static PyObject* get_enum_typeobject(Exiv2::name value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "name"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_%mangle(Exiv2::name)) + PyEnum_%mangle(Exiv2::name) = PyObject_GetAttrString( + exiv2_module, "name"); + return PyEnum_%mangle(Exiv2::name); }; } @@ -178,14 +183,20 @@ static PyObject* _get_enum_object(const char* name, const char* doc, } %define CLASS_ENUM(class, name, doc, contents...) -_ENUM_TYPEMAPS(Exiv2::class::name); +_ENUM_COMMON(Exiv2::class::name); // fragment to get enum object -%fragment("get_enum_typeobject"{Exiv2::class::name}, "header") { +%fragment("get_enum_typeobject"{Exiv2::class::name}, "header", + fragment="_declare_enum_object"{Exiv2::class::name}) { static PyObject* get_enum_typeobject(Exiv2::class::name value) { - swig_type_info* desc = $descriptor(Exiv2::class*); - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "name"); + if (!PyEnum_%mangle(Exiv2::class::name)) { + swig_type_info* desc = $descriptor(Exiv2::class*); + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_%mangle(Exiv2::class::name) = PyDict_GetItemString( + cd->pytype->tp_dict, "name"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_%mangle(Exiv2::class::name)); + } + return PyEnum_%mangle(Exiv2::class::name); }; } diff --git a/src/swig-0_27_0/basicio_wrap.cxx b/src/swig-0_27_0/basicio_wrap.cxx index 14405a1c..842fe2cf 100644 --- a/src/swig-0_27_0/basicio_wrap.cxx +++ b/src/swig-0_27_0/basicio_wrap.cxx @@ -4432,11 +4432,19 @@ SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) } +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Position"); + if (!PyEnum_Exiv2_BasicIo_Position) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( + cd->pytype->tp_dict, "Position"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + } + return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_27_0/datasets_wrap.cxx b/src/swig-0_27_0/datasets_wrap.cxx index 96945ea8..54157e21 100644 --- a/src/swig-0_27_0/datasets_wrap.cxx +++ b/src/swig-0_27_0/datasets_wrap.cxx @@ -4493,12 +4493,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/error_wrap.cxx b/src/swig-0_27_0/error_wrap.cxx index 8458ea15..8e81e7a9 100644 --- a/src/swig-0_27_0/error_wrap.cxx +++ b/src/swig-0_27_0/error_wrap.cxx @@ -4155,11 +4155,19 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Level"); + if (!PyEnum_Exiv2_LogMsg_Level) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( + cd->pytype->tp_dict, "Level"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + } + return PyEnum_Exiv2_LogMsg_Level; }; diff --git a/src/swig-0_27_0/exif_wrap.cxx b/src/swig-0_27_0/exif_wrap.cxx index 1e6ebaa2..ebb334e4 100644 --- a/src/swig-0_27_0/exif_wrap.cxx +++ b/src/swig-0_27_0/exif_wrap.cxx @@ -4530,24 +4530,28 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/image_wrap.cxx b/src/swig-0_27_0/image_wrap.cxx index 0c227477..20a8fa35 100644 --- a/src/swig-0_27_0/image_wrap.cxx +++ b/src/swig-0_27_0/image_wrap.cxx @@ -4524,12 +4524,14 @@ SWIG_From_std_string (const std::string& s) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4556,21 +4558,25 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::MetadataId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "MetadataId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_MetadataId) + PyEnum_Exiv2_MetadataId = PyObject_GetAttrString( + exiv2_module, "MetadataId"); + return PyEnum_Exiv2_MetadataId; }; +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + static PyObject* get_enum_typeobject(Exiv2::AccessMode value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "AccessMode"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_AccessMode) + PyEnum_Exiv2_AccessMode = PyObject_GetAttrString( + exiv2_module, "AccessMode"); + return PyEnum_Exiv2_AccessMode; }; diff --git a/src/swig-0_27_0/iptc_wrap.cxx b/src/swig-0_27_0/iptc_wrap.cxx index db1222b8..ff907d6a 100644 --- a/src/swig-0_27_0/iptc_wrap.cxx +++ b/src/swig-0_27_0/iptc_wrap.cxx @@ -4372,12 +4372,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4409,12 +4411,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/metadatum_wrap.cxx b/src/swig-0_27_0/metadatum_wrap.cxx index 5fbbcf63..0acb8509 100644 --- a/src/swig-0_27_0/metadatum_wrap.cxx +++ b/src/swig-0_27_0/metadatum_wrap.cxx @@ -4337,24 +4337,28 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/properties_wrap.cxx b/src/swig-0_27_0/properties_wrap.cxx index faad1122..4f1b23ba 100644 --- a/src/swig-0_27_0/properties_wrap.cxx +++ b/src/swig-0_27_0/properties_wrap.cxx @@ -4221,12 +4221,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -4246,12 +4248,14 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "XmpCategory"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_XmpCategory) + PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( + exiv2_module, "XmpCategory"); + return PyEnum_Exiv2_XmpCategory; }; diff --git a/src/swig-0_27_0/tags_wrap.cxx b/src/swig-0_27_0/tags_wrap.cxx index f1801bcf..4fec3abb 100644 --- a/src/swig-0_27_0/tags_wrap.cxx +++ b/src/swig-0_27_0/tags_wrap.cxx @@ -4154,12 +4154,14 @@ class _TagListFct { }; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/types_wrap.cxx b/src/swig-0_27_0/types_wrap.cxx index 07f44852..d1dd8554 100644 --- a/src/swig-0_27_0/types_wrap.cxx +++ b/src/swig-0_27_0/types_wrap.cxx @@ -4327,12 +4327,14 @@ static int Exiv2_DataBuf_getbuff( }; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index 98b63e3e..849c8caf 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -5197,12 +5197,14 @@ namespace swig { } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -5479,12 +5481,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -5919,11 +5923,19 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "CharsetId"); + if (!PyEnum_Exiv2_CommentValue_CharsetId) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( + cd->pytype->tp_dict, "CharsetId"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + } + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5978,11 +5990,19 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons return pv; } +static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpArrayType"); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpArrayType"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + } + return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6002,11 +6022,19 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpStruct"); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpStruct"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + } + return PyEnum_Exiv2_XmpValue_XmpStruct; }; diff --git a/src/swig-0_27_0/xmp_wrap.cxx b/src/swig-0_27_0/xmp_wrap.cxx index 7bc025a8..ce0a85e1 100644 --- a/src/swig-0_27_0/xmp_wrap.cxx +++ b/src/swig-0_27_0/xmp_wrap.cxx @@ -4376,12 +4376,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4413,12 +4415,14 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/basicio_wrap.cxx b/src/swig-0_27_4/basicio_wrap.cxx index 14405a1c..842fe2cf 100644 --- a/src/swig-0_27_4/basicio_wrap.cxx +++ b/src/swig-0_27_4/basicio_wrap.cxx @@ -4432,11 +4432,19 @@ SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) } +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Position"); + if (!PyEnum_Exiv2_BasicIo_Position) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( + cd->pytype->tp_dict, "Position"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + } + return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_27_4/datasets_wrap.cxx b/src/swig-0_27_4/datasets_wrap.cxx index 96945ea8..54157e21 100644 --- a/src/swig-0_27_4/datasets_wrap.cxx +++ b/src/swig-0_27_4/datasets_wrap.cxx @@ -4493,12 +4493,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/error_wrap.cxx b/src/swig-0_27_4/error_wrap.cxx index 8458ea15..8e81e7a9 100644 --- a/src/swig-0_27_4/error_wrap.cxx +++ b/src/swig-0_27_4/error_wrap.cxx @@ -4155,11 +4155,19 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Level"); + if (!PyEnum_Exiv2_LogMsg_Level) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( + cd->pytype->tp_dict, "Level"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + } + return PyEnum_Exiv2_LogMsg_Level; }; diff --git a/src/swig-0_27_4/exif_wrap.cxx b/src/swig-0_27_4/exif_wrap.cxx index 1e6ebaa2..ebb334e4 100644 --- a/src/swig-0_27_4/exif_wrap.cxx +++ b/src/swig-0_27_4/exif_wrap.cxx @@ -4530,24 +4530,28 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/image_wrap.cxx b/src/swig-0_27_4/image_wrap.cxx index 0c227477..20a8fa35 100644 --- a/src/swig-0_27_4/image_wrap.cxx +++ b/src/swig-0_27_4/image_wrap.cxx @@ -4524,12 +4524,14 @@ SWIG_From_std_string (const std::string& s) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4556,21 +4558,25 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::MetadataId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "MetadataId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_MetadataId) + PyEnum_Exiv2_MetadataId = PyObject_GetAttrString( + exiv2_module, "MetadataId"); + return PyEnum_Exiv2_MetadataId; }; +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + static PyObject* get_enum_typeobject(Exiv2::AccessMode value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "AccessMode"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_AccessMode) + PyEnum_Exiv2_AccessMode = PyObject_GetAttrString( + exiv2_module, "AccessMode"); + return PyEnum_Exiv2_AccessMode; }; diff --git a/src/swig-0_27_4/iptc_wrap.cxx b/src/swig-0_27_4/iptc_wrap.cxx index db1222b8..ff907d6a 100644 --- a/src/swig-0_27_4/iptc_wrap.cxx +++ b/src/swig-0_27_4/iptc_wrap.cxx @@ -4372,12 +4372,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4409,12 +4411,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/metadatum_wrap.cxx b/src/swig-0_27_4/metadatum_wrap.cxx index 5fbbcf63..0acb8509 100644 --- a/src/swig-0_27_4/metadatum_wrap.cxx +++ b/src/swig-0_27_4/metadatum_wrap.cxx @@ -4337,24 +4337,28 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/properties_wrap.cxx b/src/swig-0_27_4/properties_wrap.cxx index faad1122..4f1b23ba 100644 --- a/src/swig-0_27_4/properties_wrap.cxx +++ b/src/swig-0_27_4/properties_wrap.cxx @@ -4221,12 +4221,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -4246,12 +4248,14 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "XmpCategory"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_XmpCategory) + PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( + exiv2_module, "XmpCategory"); + return PyEnum_Exiv2_XmpCategory; }; diff --git a/src/swig-0_27_4/tags_wrap.cxx b/src/swig-0_27_4/tags_wrap.cxx index f1801bcf..4fec3abb 100644 --- a/src/swig-0_27_4/tags_wrap.cxx +++ b/src/swig-0_27_4/tags_wrap.cxx @@ -4154,12 +4154,14 @@ class _TagListFct { }; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/types_wrap.cxx b/src/swig-0_27_4/types_wrap.cxx index 07f44852..d1dd8554 100644 --- a/src/swig-0_27_4/types_wrap.cxx +++ b/src/swig-0_27_4/types_wrap.cxx @@ -4327,12 +4327,14 @@ static int Exiv2_DataBuf_getbuff( }; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index 98b63e3e..849c8caf 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -5197,12 +5197,14 @@ namespace swig { } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -5479,12 +5481,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -5919,11 +5923,19 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "CharsetId"); + if (!PyEnum_Exiv2_CommentValue_CharsetId) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( + cd->pytype->tp_dict, "CharsetId"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + } + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5978,11 +5990,19 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons return pv; } +static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpArrayType"); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpArrayType"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + } + return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6002,11 +6022,19 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpStruct"); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpStruct"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + } + return PyEnum_Exiv2_XmpValue_XmpStruct; }; diff --git a/src/swig-0_27_4/xmp_wrap.cxx b/src/swig-0_27_4/xmp_wrap.cxx index 7bc025a8..ce0a85e1 100644 --- a/src/swig-0_27_4/xmp_wrap.cxx +++ b/src/swig-0_27_4/xmp_wrap.cxx @@ -4376,12 +4376,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4413,12 +4415,14 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/basicio_wrap.cxx b/src/swig-0_28_0/basicio_wrap.cxx index 74853c2c..bcfc551d 100644 --- a/src/swig-0_28_0/basicio_wrap.cxx +++ b/src/swig-0_28_0/basicio_wrap.cxx @@ -4575,11 +4575,19 @@ SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) #endif +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Position"); + if (!PyEnum_Exiv2_BasicIo_Position) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( + cd->pytype->tp_dict, "Position"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + } + return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_28_0/datasets_wrap.cxx b/src/swig-0_28_0/datasets_wrap.cxx index 4b1fde11..d565dea7 100644 --- a/src/swig-0_28_0/datasets_wrap.cxx +++ b/src/swig-0_28_0/datasets_wrap.cxx @@ -4493,12 +4493,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/error_wrap.cxx b/src/swig-0_28_0/error_wrap.cxx index 26981b81..c90ec477 100644 --- a/src/swig-0_28_0/error_wrap.cxx +++ b/src/swig-0_28_0/error_wrap.cxx @@ -4155,11 +4155,19 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "Level"); + if (!PyEnum_Exiv2_LogMsg_Level) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( + cd->pytype->tp_dict, "Level"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + } + return PyEnum_Exiv2_LogMsg_Level; }; diff --git a/src/swig-0_28_0/exif_wrap.cxx b/src/swig-0_28_0/exif_wrap.cxx index 56ff551b..5f198e86 100644 --- a/src/swig-0_28_0/exif_wrap.cxx +++ b/src/swig-0_28_0/exif_wrap.cxx @@ -4611,12 +4611,14 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4649,12 +4651,14 @@ SWIG_From_size_t (size_t value) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/image_wrap.cxx b/src/swig-0_28_0/image_wrap.cxx index 3ac07501..9ee7dfcf 100644 --- a/src/swig-0_28_0/image_wrap.cxx +++ b/src/swig-0_28_0/image_wrap.cxx @@ -4524,12 +4524,14 @@ SWIG_From_std_string (const std::string& s) } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4556,21 +4558,25 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::MetadataId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "MetadataId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_MetadataId) + PyEnum_Exiv2_MetadataId = PyObject_GetAttrString( + exiv2_module, "MetadataId"); + return PyEnum_Exiv2_MetadataId; }; +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + static PyObject* get_enum_typeobject(Exiv2::AccessMode value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "AccessMode"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_AccessMode) + PyEnum_Exiv2_AccessMode = PyObject_GetAttrString( + exiv2_module, "AccessMode"); + return PyEnum_Exiv2_AccessMode; }; @@ -4590,12 +4596,14 @@ static PyObject* py_from_enum(Exiv2::AccessMode value) { } +static PyObject* PyEnum_Exiv2_ImageType = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ImageType value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ImageType"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ImageType) + PyEnum_Exiv2_ImageType = PyObject_GetAttrString( + exiv2_module, "ImageType"); + return PyEnum_Exiv2_ImageType; }; diff --git a/src/swig-0_28_0/iptc_wrap.cxx b/src/swig-0_28_0/iptc_wrap.cxx index 527542fe..a8d6b1f3 100644 --- a/src/swig-0_28_0/iptc_wrap.cxx +++ b/src/swig-0_28_0/iptc_wrap.cxx @@ -4372,12 +4372,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4450,12 +4452,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/metadatum_wrap.cxx b/src/swig-0_28_0/metadatum_wrap.cxx index 91e7cfb9..ab296e2c 100644 --- a/src/swig-0_28_0/metadatum_wrap.cxx +++ b/src/swig-0_28_0/metadatum_wrap.cxx @@ -4337,12 +4337,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4390,12 +4392,14 @@ SWIG_From_size_t (size_t value) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/properties_wrap.cxx b/src/swig-0_28_0/properties_wrap.cxx index 419fe12f..4191eddc 100644 --- a/src/swig-0_28_0/properties_wrap.cxx +++ b/src/swig-0_28_0/properties_wrap.cxx @@ -4221,12 +4221,14 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -4246,12 +4248,14 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "XmpCategory"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_XmpCategory) + PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( + exiv2_module, "XmpCategory"); + return PyEnum_Exiv2_XmpCategory; }; diff --git a/src/swig-0_28_0/tags_wrap.cxx b/src/swig-0_28_0/tags_wrap.cxx index 9a385def..923e1030 100644 --- a/src/swig-0_28_0/tags_wrap.cxx +++ b/src/swig-0_28_0/tags_wrap.cxx @@ -4191,12 +4191,14 @@ class _TagListFct { }; +static PyObject* PyEnum_Exiv2_IfdId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::IfdId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "IfdId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_IfdId) + PyEnum_Exiv2_IfdId = PyObject_GetAttrString( + exiv2_module, "IfdId"); + return PyEnum_Exiv2_IfdId; }; @@ -4216,12 +4218,14 @@ static PyObject* py_from_enum(Exiv2::IfdId value) { } +static PyObject* PyEnum_Exiv2_SectionId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::SectionId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "SectionId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_SectionId) + PyEnum_Exiv2_SectionId = PyObject_GetAttrString( + exiv2_module, "SectionId"); + return PyEnum_Exiv2_SectionId; }; @@ -4241,12 +4245,14 @@ static PyObject* py_from_enum(Exiv2::SectionId value) { } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/types_wrap.cxx b/src/swig-0_28_0/types_wrap.cxx index d613a134..d43c7b90 100644 --- a/src/swig-0_28_0/types_wrap.cxx +++ b/src/swig-0_28_0/types_wrap.cxx @@ -4326,12 +4326,14 @@ static int Exiv2_DataBuf_getbuff( }; +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 383ca3fe..70427af5 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -5197,12 +5197,14 @@ namespace swig { } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -5560,12 +5562,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; @@ -6089,11 +6093,19 @@ SWIG_FromCharPtr(const char *cptr) } +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "CharsetId"); + if (!PyEnum_Exiv2_CommentValue_CharsetId) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( + cd->pytype->tp_dict, "CharsetId"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + } + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -6148,11 +6160,19 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons return pv; } +static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpArrayType"); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpArrayType"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + } + return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6172,11 +6192,19 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - // PyDict_GetItemString returns a borrowed reference - return PyDict_GetItemString(cd->pytype->tp_dict, "XmpStruct"); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) { + swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; + SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; + PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( + cd->pytype->tp_dict, "XmpStruct"); + // PyDict_GetItemString returns a borrowed reference + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + } + return PyEnum_Exiv2_XmpValue_XmpStruct; }; diff --git a/src/swig-0_28_0/xmp_wrap.cxx b/src/swig-0_28_0/xmp_wrap.cxx index 1a2b4ada..22dc7207 100644 --- a/src/swig-0_28_0/xmp_wrap.cxx +++ b/src/swig-0_28_0/xmp_wrap.cxx @@ -4376,12 +4376,14 @@ SWIGINTERNINLINE PyObject* } +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; + + static PyObject* get_enum_typeobject(Exiv2::ByteOrder value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "ByteOrder"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_ByteOrder) + PyEnum_Exiv2_ByteOrder = PyObject_GetAttrString( + exiv2_module, "ByteOrder"); + return PyEnum_Exiv2_ByteOrder; }; @@ -4454,12 +4456,14 @@ SWIG_From_unsigned_SS_short (unsigned short value) } +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + static PyObject* get_enum_typeobject(Exiv2::TypeId value) { - PyObject* result = PyObject_GetAttrString(exiv2_module, "TypeId"); - // PyObject_GetAttrString returns a new reference, decref is safe as - // the object is referred to elsewhere - Py_DECREF(result); - return result; + if (!PyEnum_Exiv2_TypeId) + PyEnum_Exiv2_TypeId = PyObject_GetAttrString( + exiv2_module, "TypeId"); + return PyEnum_Exiv2_TypeId; }; From b93643d9e523cca26c0a72b66ec2c60626ec683d Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 10:58:17 +0000 Subject: [PATCH 04/12] Import class enums more conventionally This is more maintainable and probably safer than mucking about with swig_type_info and client data. --- src/interface/shared/enum.i | 14 +++++++----- src/swig-0_27_0/basicio_wrap.cxx | 13 ++++++----- src/swig-0_27_0/error_wrap.cxx | 23 ++++++++++++++----- src/swig-0_27_0/value_wrap.cxx | 39 +++++++++++++++++--------------- src/swig-0_27_4/basicio_wrap.cxx | 13 ++++++----- src/swig-0_27_4/error_wrap.cxx | 23 ++++++++++++++----- src/swig-0_27_4/value_wrap.cxx | 39 +++++++++++++++++--------------- src/swig-0_28_0/basicio_wrap.cxx | 13 ++++++----- src/swig-0_28_0/error_wrap.cxx | 23 ++++++++++++++----- src/swig-0_28_0/value_wrap.cxx | 39 +++++++++++++++++--------------- 10 files changed, 143 insertions(+), 96 deletions(-) diff --git a/src/interface/shared/enum.i b/src/interface/shared/enum.i index 6cb4f2f0..1c0b70aa 100644 --- a/src/interface/shared/enum.i +++ b/src/interface/shared/enum.i @@ -186,15 +186,17 @@ static PyObject* _get_enum_object(const char* name, const char* doc, _ENUM_COMMON(Exiv2::class::name); // fragment to get enum object %fragment("get_enum_typeobject"{Exiv2::class::name}, "header", + fragment="import_exiv2", fragment="_declare_enum_object"{Exiv2::class::name}) { static PyObject* get_enum_typeobject(Exiv2::class::name value) { if (!PyEnum_%mangle(Exiv2::class::name)) { - swig_type_info* desc = $descriptor(Exiv2::class*); - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_%mangle(Exiv2::class::name) = PyDict_GetItemString( - cd->pytype->tp_dict, "name"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_%mangle(Exiv2::class::name)); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "class"); + if (parent_class) { + PyEnum_%mangle(Exiv2::class::name) = PyObject_GetAttrString( + parent_class, "name"); + Py_DECREF(parent_class); + } } return PyEnum_%mangle(Exiv2::class::name); }; diff --git a/src/swig-0_27_0/basicio_wrap.cxx b/src/swig-0_27_0/basicio_wrap.cxx index 842fe2cf..c150f7c7 100644 --- a/src/swig-0_27_0/basicio_wrap.cxx +++ b/src/swig-0_27_0/basicio_wrap.cxx @@ -4437,12 +4437,13 @@ static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( - cd->pytype->tp_dict, "Position"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "BasicIo"); + if (parent_class) { + PyEnum_Exiv2_BasicIo_Position = PyObject_GetAttrString( + parent_class, "Position"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_27_0/error_wrap.cxx b/src/swig-0_27_0/error_wrap.cxx index 8e81e7a9..7c21db4d 100644 --- a/src/swig-0_27_0/error_wrap.cxx +++ b/src/swig-0_27_0/error_wrap.cxx @@ -4155,17 +4155,21 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* exiv2_module = NULL; + + static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( - cd->pytype->tp_dict, "Level"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "LogMsg"); + if (parent_class) { + PyEnum_Exiv2_LogMsg_Level = PyObject_GetAttrString( + parent_class, "Level"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_LogMsg_Level; }; @@ -5104,6 +5108,13 @@ SWIG_init(void) { return NULL; } + + { + exiv2_module = PyImport_ImportModule("exiv2"); + if (!exiv2_module) + return NULL; + } + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index 849c8caf..21614bd4 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -5928,12 +5928,13 @@ static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( - cd->pytype->tp_dict, "CharsetId"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "CommentValue"); + if (parent_class) { + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_GetAttrString( + parent_class, "CharsetId"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5995,12 +5996,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpArrayType"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_GetAttrString( + parent_class, "XmpArrayType"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6027,12 +6029,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpStruct"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_GetAttrString( + parent_class, "XmpStruct"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpStruct; }; diff --git a/src/swig-0_27_4/basicio_wrap.cxx b/src/swig-0_27_4/basicio_wrap.cxx index 842fe2cf..c150f7c7 100644 --- a/src/swig-0_27_4/basicio_wrap.cxx +++ b/src/swig-0_27_4/basicio_wrap.cxx @@ -4437,12 +4437,13 @@ static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( - cd->pytype->tp_dict, "Position"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "BasicIo"); + if (parent_class) { + PyEnum_Exiv2_BasicIo_Position = PyObject_GetAttrString( + parent_class, "Position"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_27_4/error_wrap.cxx b/src/swig-0_27_4/error_wrap.cxx index 8e81e7a9..7c21db4d 100644 --- a/src/swig-0_27_4/error_wrap.cxx +++ b/src/swig-0_27_4/error_wrap.cxx @@ -4155,17 +4155,21 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* exiv2_module = NULL; + + static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( - cd->pytype->tp_dict, "Level"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "LogMsg"); + if (parent_class) { + PyEnum_Exiv2_LogMsg_Level = PyObject_GetAttrString( + parent_class, "Level"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_LogMsg_Level; }; @@ -5104,6 +5108,13 @@ SWIG_init(void) { return NULL; } + + { + exiv2_module = PyImport_ImportModule("exiv2"); + if (!exiv2_module) + return NULL; + } + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index 849c8caf..21614bd4 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -5928,12 +5928,13 @@ static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( - cd->pytype->tp_dict, "CharsetId"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "CommentValue"); + if (parent_class) { + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_GetAttrString( + parent_class, "CharsetId"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5995,12 +5996,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpArrayType"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_GetAttrString( + parent_class, "XmpArrayType"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6027,12 +6029,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpStruct"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_GetAttrString( + parent_class, "XmpStruct"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpStruct; }; diff --git a/src/swig-0_28_0/basicio_wrap.cxx b/src/swig-0_28_0/basicio_wrap.cxx index bcfc551d..51c45bb5 100644 --- a/src/swig-0_28_0/basicio_wrap.cxx +++ b/src/swig-0_28_0/basicio_wrap.cxx @@ -4580,12 +4580,13 @@ static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__BasicIo; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_BasicIo_Position = PyDict_GetItemString( - cd->pytype->tp_dict, "Position"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "BasicIo"); + if (parent_class) { + PyEnum_Exiv2_BasicIo_Position = PyObject_GetAttrString( + parent_class, "Position"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_BasicIo_Position; }; diff --git a/src/swig-0_28_0/error_wrap.cxx b/src/swig-0_28_0/error_wrap.cxx index c90ec477..bbf30348 100644 --- a/src/swig-0_28_0/error_wrap.cxx +++ b/src/swig-0_28_0/error_wrap.cxx @@ -4155,17 +4155,21 @@ static PyObject* _get_enum_object(const char* name, const char* doc, }; +static PyObject* exiv2_module = NULL; + + static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__LogMsg; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_LogMsg_Level = PyDict_GetItemString( - cd->pytype->tp_dict, "Level"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "LogMsg"); + if (parent_class) { + PyEnum_Exiv2_LogMsg_Level = PyObject_GetAttrString( + parent_class, "Level"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_LogMsg_Level; }; @@ -5104,6 +5108,13 @@ SWIG_init(void) { return NULL; } + + { + exiv2_module = PyImport_ImportModule("exiv2"); + if (!exiv2_module) + return NULL; + } + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 70427af5..6cfd74d4 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -6098,12 +6098,13 @@ static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__CommentValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_CommentValue_CharsetId = PyDict_GetItemString( - cd->pytype->tp_dict, "CharsetId"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "CommentValue"); + if (parent_class) { + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_GetAttrString( + parent_class, "CharsetId"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -6165,12 +6166,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpArrayType = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpArrayType"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_GetAttrString( + parent_class, "XmpArrayType"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpArrayType; }; @@ -6197,12 +6199,13 @@ static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { - swig_type_info* desc = SWIGTYPE_p_Exiv2__XmpValue; - SwigPyClientData* cd = (SwigPyClientData*)desc->clientdata; - PyEnum_Exiv2_XmpValue_XmpStruct = PyDict_GetItemString( - cd->pytype->tp_dict, "XmpStruct"); - // PyDict_GetItemString returns a borrowed reference - Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + PyObject* parent_class = PyObject_GetAttrString( + exiv2_module, "XmpValue"); + if (parent_class) { + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_GetAttrString( + parent_class, "XmpStruct"); + Py_DECREF(parent_class); + } } return PyEnum_Exiv2_XmpValue_XmpStruct; }; From 42de2edf4da24f22319002f0dee25973b2c5515a Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 12:17:21 +0000 Subject: [PATCH 05/12] Improved initialisation of python enum objects --- src/interface/shared/enum.i | 54 +++++++++-------- src/swig-0_27_0/basicio_wrap.cxx | 26 ++++---- src/swig-0_27_0/error_wrap.cxx | 46 +++++++------- src/swig-0_27_0/image_wrap.cxx | 43 +++++++------ src/swig-0_27_0/properties_wrap.cxx | 46 +++++++------- src/swig-0_27_0/types_wrap.cxx | 94 ++++++++++++++++++++++++----- src/swig-0_27_0/value_wrap.cxx | 70 +++++++++++++++------ src/swig-0_27_4/basicio_wrap.cxx | 26 ++++---- src/swig-0_27_4/error_wrap.cxx | 46 +++++++------- src/swig-0_27_4/image_wrap.cxx | 43 +++++++------ src/swig-0_27_4/properties_wrap.cxx | 46 +++++++------- src/swig-0_27_4/types_wrap.cxx | 94 ++++++++++++++++++++++++----- src/swig-0_27_4/value_wrap.cxx | 70 +++++++++++++++------ src/swig-0_28_0/basicio_wrap.cxx | 26 ++++---- src/swig-0_28_0/error_wrap.cxx | 46 +++++++------- src/swig-0_28_0/image_wrap.cxx | 46 +++++++------- src/swig-0_28_0/properties_wrap.cxx | 46 +++++++------- src/swig-0_28_0/tags_wrap.cxx | 53 ++++++++++------ src/swig-0_28_0/types_wrap.cxx | 94 ++++++++++++++++++++++++----- src/swig-0_28_0/value_wrap.cxx | 70 +++++++++++++++------ 20 files changed, 716 insertions(+), 369 deletions(-) diff --git a/src/interface/shared/enum.i b/src/interface/shared/enum.i index 1c0b70aa..0cf8f979 100644 --- a/src/interface/shared/enum.i +++ b/src/interface/shared/enum.i @@ -26,9 +26,30 @@ static PyObject* PyEnum_%mangle(pattern) = NULL; } +// Function to initialise Python enum +%fragment("_create_enum_object"{pattern}, "header", + fragment="_import_py_enum", + fragment="_declare_enum_object"{pattern}) { +static PyObject* _create_enum_%mangle(pattern)( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_%mangle(pattern) = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_%mangle(pattern)) + return NULL; + if (PyObject_SetAttrString( + PyEnum_%mangle(pattern), "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_%mangle(pattern)); + return PyEnum_%mangle(pattern); +}; +} + // typemap to disambiguate enum from int %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, - fragment="import_py_enum") pattern { + fragment="_import_py_enum") pattern { $1 = PyObject_IsInstance($input, Py_IntEnum); } @@ -95,7 +116,7 @@ static PyObject* _get_enum_list(int dummy, ...) { %fragment("_declare_py_enum", "header") { static PyObject* Py_IntEnum = NULL; } -%fragment("import_py_enum", "init", fragment="_declare_py_enum") { +%fragment("_import_py_enum", "init", fragment="_declare_py_enum") { { PyObject* module = PyImport_ImportModule("enum"); if (!module) @@ -122,9 +143,9 @@ static PyObject* get_enum_typeobject(Exiv2::name value) { } // Add enum to module during init +%fragment("_create_enum_object"{Exiv2::name}); %fragment("get_enum_list"); -%fragment("get_enum_object"); -%constant PyObject* name = _get_enum_object( +%constant PyObject* name = _create_enum_%mangle(Exiv2::name)( "name", doc, _get_enum_list(0, contents, NULL)); %ignore Exiv2::name; %enddef // ENUM @@ -132,7 +153,7 @@ static PyObject* get_enum_typeobject(Exiv2::name value) { %define DEPRECATED_ENUM(moved_to, enum_name, doc, contents...) // typemap to disambiguate enum from int %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, - fragment="import_py_enum") Exiv2::moved_to::enum_name { + fragment="_import_py_enum") Exiv2::moved_to::enum_name { $1 = PyObject_IsInstance($input, Py_IntEnum); } @@ -165,23 +186,6 @@ enum_name.__doc__ = doc %ignore Exiv2::enum_name; %enddef // DEPRECATED_ENUM -// Function to generate Python enum -%fragment("get_enum_object", "header", fragment="import_py_enum") { -%#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; -} - %define CLASS_ENUM(class, name, doc, contents...) _ENUM_COMMON(Exiv2::class::name); // fragment to get enum object @@ -202,11 +206,11 @@ static PyObject* get_enum_typeobject(Exiv2::class::name value) { }; } -// Add enum to type object during module init +// Add enum as static class member during module init %extend Exiv2::class { +%fragment("_create_enum_object"{Exiv2::class::name}); %fragment("get_enum_list"); -%fragment("get_enum_object"); -%constant PyObject* name = _get_enum_object( +%constant PyObject* name = _create_enum_%mangle(Exiv2::class::name)( "name", doc, _get_enum_list(0, contents, NULL)); } %ignore Exiv2::class::name; diff --git a/src/swig-0_27_0/basicio_wrap.cxx b/src/swig-0_27_0/basicio_wrap.cxx index c150f7c7..5fd93adf 100644 --- a/src/swig-0_27_0/basicio_wrap.cxx +++ b/src/swig-0_27_0/basicio_wrap.cxx @@ -4197,18 +4197,23 @@ PyObject* _enum_list_Position() { static PyObject* Py_IntEnum = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + +static PyObject* _create_enum_Exiv2_BasicIo_Position( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_BasicIo_Position = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_BasicIo_Position) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_BasicIo_Position, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + return PyEnum_Exiv2_BasicIo_Position; }; @@ -4432,9 +4437,6 @@ SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) } -static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; - - static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { PyObject* parent_class = PyObject_GetAttrString( @@ -11394,7 +11396,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_create_enum_Exiv2_BasicIo_Position( "Position", "Seek starting positions.", _get_enum_list(0, "beg",Exiv2::BasicIo::beg,"cur",Exiv2::BasicIo::cur,"end",Exiv2::BasicIo::end, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; diff --git a/src/swig-0_27_0/error_wrap.cxx b/src/swig-0_27_0/error_wrap.cxx index 7c21db4d..fb498c22 100644 --- a/src/swig-0_27_0/error_wrap.cxx +++ b/src/swig-0_27_0/error_wrap.cxx @@ -4118,6 +4118,29 @@ static void log_to_python(int level, const char* msg) { }; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + +static PyObject* _create_enum_Exiv2_LogMsg_Level( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_LogMsg_Level = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_LogMsg_Level) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_LogMsg_Level, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + return PyEnum_Exiv2_LogMsg_Level; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4137,30 +4160,9 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - static PyObject* exiv2_module = NULL; -static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; - - static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { PyObject* parent_class = PyObject_GetAttrString( @@ -5115,7 +5117,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_create_enum_Exiv2_LogMsg_Level( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" "\nthe log message handler to None.", _get_enum_list(0, "debug",Exiv2::LogMsg::debug,"info",Exiv2::LogMsg::info,"warn",Exiv2::LogMsg::warn,"error",Exiv2::LogMsg::error,"mute",Exiv2::LogMsg::mute, NULL))); diff --git a/src/swig-0_27_0/image_wrap.cxx b/src/swig-0_27_0/image_wrap.cxx index 20a8fa35..9759a660 100644 --- a/src/swig-0_27_0/image_wrap.cxx +++ b/src/swig-0_27_0/image_wrap.cxx @@ -4324,6 +4324,29 @@ SWIGINTERNINLINE PyObject* } +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_ImageType = NULL; + + +static PyObject* _create_enum_Exiv2_ImageType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_ImageType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ImageType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_ImageType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ImageType); + return PyEnum_Exiv2_ImageType; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4343,24 +4366,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -8644,7 +8649,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(19), "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), "webp", int(23), diff --git a/src/swig-0_27_0/properties_wrap.cxx b/src/swig-0_27_0/properties_wrap.cxx index 4f1b23ba..ba5a6150 100644 --- a/src/swig-0_27_0/properties_wrap.cxx +++ b/src/swig-0_27_0/properties_wrap.cxx @@ -4139,6 +4139,29 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + +static PyObject* _create_enum_Exiv2_XmpCategory( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpCategory = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpCategory) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpCategory, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpCategory); + return PyEnum_Exiv2_XmpCategory; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4158,24 +4181,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -4248,9 +4253,6 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } -static PyObject* PyEnum_Exiv2_XmpCategory = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { if (!PyEnum_Exiv2_XmpCategory) PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( @@ -6929,7 +6931,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_create_enum_Exiv2_XmpCategory( "XmpCategory", "Category of an XMP property.", _get_enum_list(0, "xmpInternal",Exiv2::xmpInternal,"xmpExternal",Exiv2::xmpExternal,"Internal",Exiv2::xmpInternal,"External",Exiv2::xmpExternal, NULL))); /* type 'Exiv2::XmpProperties' */ diff --git a/src/swig-0_27_0/types_wrap.cxx b/src/swig-0_27_0/types_wrap.cxx index d1dd8554..c6ceb8d1 100644 --- a/src/swig-0_27_0/types_wrap.cxx +++ b/src/swig-0_27_0/types_wrap.cxx @@ -4273,6 +4273,29 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc) #define DATABUF_SIZE size_ +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + +static PyObject* _create_enum_Exiv2_AccessMode( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_AccessMode = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_AccessMode) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_AccessMode, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_AccessMode); + return PyEnum_Exiv2_AccessMode; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4292,21 +4315,63 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* _create_enum_Exiv2_ByteOrder( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_ByteOrder = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ByteOrder) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_ByteOrder, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ByteOrder); + return PyEnum_Exiv2_ByteOrder; +}; + + +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + +static PyObject* _create_enum_Exiv2_MetadataId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_MetadataId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_MetadataId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_MetadataId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_MetadataId); + return PyEnum_Exiv2_MetadataId; +}; + + +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + +static PyObject* _create_enum_Exiv2_TypeId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_TypeId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_TypeId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_TypeId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_TypeId); + return PyEnum_Exiv2_TypeId; }; @@ -4327,9 +4392,6 @@ static int Exiv2_DataBuf_getbuff( }; -static PyObject* PyEnum_Exiv2_TypeId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::TypeId value) { if (!PyEnum_Exiv2_TypeId) PyEnum_Exiv2_TypeId = PyObject_GetAttrString( @@ -8179,13 +8241,13 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_create_enum_Exiv2_AccessMode( "AccessMode", "An identifier for each mode of metadata support.", _get_enum_list(0, "amNone",Exiv2::amNone,"amRead",Exiv2::amRead,"amWrite",Exiv2::amWrite,"amReadWrite",Exiv2::amReadWrite,"none",Exiv2::amNone,"Read",Exiv2::amRead,"Write",Exiv2::amWrite,"ReadWrite",Exiv2::amReadWrite, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_create_enum_Exiv2_ByteOrder( "ByteOrder", "Type to express the byte order (little or big endian).", _get_enum_list(0, "invalidByteOrder",Exiv2::invalidByteOrder,"littleEndian",Exiv2::littleEndian,"bigEndian",Exiv2::bigEndian, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_create_enum_Exiv2_MetadataId( "MetadataId", "An identifier for each type of metadata.", _get_enum_list(0, "mdNone",Exiv2::mdNone,"mdExif",Exiv2::mdExif,"mdIptc",Exiv2::mdIptc,"mdComment",Exiv2::mdComment,"mdXmp",Exiv2::mdXmp,"mdIccProfile",Exiv2::mdIccProfile,"none",Exiv2::mdNone,"Exif",Exiv2::mdExif,"Iptc",Exiv2::mdIptc,"Comment",Exiv2::mdComment,"Xmp",Exiv2::mdXmp,"IccProfile",Exiv2::mdIccProfile, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_create_enum_Exiv2_TypeId( "TypeId", "Exiv2 value type identifiers.\n" "\nUsed primarily as identifiers when creating Exiv2 Value instances. See" "\nexiv2.Value.create(). 0x0000 to 0xffff are reserved for TIFF (Exif) types.", _get_enum_list(0, "unsignedByte",Exiv2::unsignedByte,"asciiString",Exiv2::asciiString,"unsignedShort",Exiv2::unsignedShort,"unsignedLong",Exiv2::unsignedLong,"unsignedRational",Exiv2::unsignedRational,"signedByte",Exiv2::signedByte,"undefined",Exiv2::undefined,"signedShort",Exiv2::signedShort,"signedLong",Exiv2::signedLong,"signedRational",Exiv2::signedRational,"tiffFloat",Exiv2::tiffFloat,"tiffDouble",Exiv2::tiffDouble,"tiffIfd",Exiv2::tiffIfd,"string",Exiv2::string,"date",Exiv2::date,"time",Exiv2::time,"comment",Exiv2::comment,"directory",Exiv2::directory,"xmpText",Exiv2::xmpText,"xmpAlt",Exiv2::xmpAlt,"xmpBag",Exiv2::xmpBag,"xmpSeq",Exiv2::xmpSeq,"langAlt",Exiv2::langAlt,"invalidTypeId",Exiv2::invalidTypeId,"lastTypeId",Exiv2::lastTypeId, NULL))); diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index 21614bd4..4873d60a 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -5898,18 +5898,23 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &v return pv; } -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + +static PyObject* _create_enum_Exiv2_CommentValue_CharsetId( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_CommentValue_CharsetId) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_CommentValue_CharsetId, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5923,9 +5928,6 @@ SWIG_FromCharPtr(const char *cptr) } -static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { PyObject* parent_class = PyObject_GetAttrString( @@ -5994,6 +5996,43 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; +static PyObject* _create_enum_Exiv2_XmpValue_XmpArrayType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpArrayType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + return PyEnum_Exiv2_XmpValue_XmpArrayType; +}; + + +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + +static PyObject* _create_enum_Exiv2_XmpValue_XmpStruct( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpStruct, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + return PyEnum_Exiv2_XmpValue_XmpStruct; +}; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { PyObject* parent_class = PyObject_GetAttrString( @@ -6024,9 +6063,6 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } -static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { PyObject* parent_class = PyObject_GetAttrString( @@ -34496,7 +34532,7 @@ SWIG_init(void) { /* type 'Exiv2::CommentValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CommentValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_create_enum_Exiv2_CommentValue_CharsetId( "CharsetId", "Character set identifiers for the character sets defined by Exif.", _get_enum_list(0, "ascii",Exiv2::CommentValue::ascii,"jis",Exiv2::CommentValue::jis,"unicode",Exiv2::CommentValue::unicode,"undefined",Exiv2::CommentValue::undefined,"invalidCharsetId",Exiv2::CommentValue::invalidCharsetId,"lastCharsetId",Exiv2::CommentValue::lastCharsetId, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; @@ -34532,9 +34568,9 @@ SWIG_init(void) { /* type 'Exiv2::XmpValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__XmpValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_create_enum_Exiv2_XmpValue_XmpArrayType( "XmpArrayType", "XMP array types.", _get_enum_list(0, "xaNone",Exiv2::XmpValue::xaNone,"xaAlt",Exiv2::XmpValue::xaAlt,"xaBag",Exiv2::XmpValue::xaBag,"xaSeq",Exiv2::XmpValue::xaSeq, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_create_enum_Exiv2_XmpValue_XmpStruct( "XmpStruct", "XMP structure indicator.", _get_enum_list(0, "xsNone",Exiv2::XmpValue::xsNone,"xsStruct",Exiv2::XmpValue::xsStruct, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; diff --git a/src/swig-0_27_4/basicio_wrap.cxx b/src/swig-0_27_4/basicio_wrap.cxx index c150f7c7..5fd93adf 100644 --- a/src/swig-0_27_4/basicio_wrap.cxx +++ b/src/swig-0_27_4/basicio_wrap.cxx @@ -4197,18 +4197,23 @@ PyObject* _enum_list_Position() { static PyObject* Py_IntEnum = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + +static PyObject* _create_enum_Exiv2_BasicIo_Position( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_BasicIo_Position = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_BasicIo_Position) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_BasicIo_Position, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + return PyEnum_Exiv2_BasicIo_Position; }; @@ -4432,9 +4437,6 @@ SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) } -static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; - - static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { PyObject* parent_class = PyObject_GetAttrString( @@ -11394,7 +11396,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_create_enum_Exiv2_BasicIo_Position( "Position", "Seek starting positions.", _get_enum_list(0, "beg",Exiv2::BasicIo::beg,"cur",Exiv2::BasicIo::cur,"end",Exiv2::BasicIo::end, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; diff --git a/src/swig-0_27_4/error_wrap.cxx b/src/swig-0_27_4/error_wrap.cxx index 7c21db4d..fb498c22 100644 --- a/src/swig-0_27_4/error_wrap.cxx +++ b/src/swig-0_27_4/error_wrap.cxx @@ -4118,6 +4118,29 @@ static void log_to_python(int level, const char* msg) { }; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + +static PyObject* _create_enum_Exiv2_LogMsg_Level( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_LogMsg_Level = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_LogMsg_Level) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_LogMsg_Level, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + return PyEnum_Exiv2_LogMsg_Level; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4137,30 +4160,9 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - static PyObject* exiv2_module = NULL; -static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; - - static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { PyObject* parent_class = PyObject_GetAttrString( @@ -5115,7 +5117,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_create_enum_Exiv2_LogMsg_Level( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" "\nthe log message handler to None.", _get_enum_list(0, "debug",Exiv2::LogMsg::debug,"info",Exiv2::LogMsg::info,"warn",Exiv2::LogMsg::warn,"error",Exiv2::LogMsg::error,"mute",Exiv2::LogMsg::mute, NULL))); diff --git a/src/swig-0_27_4/image_wrap.cxx b/src/swig-0_27_4/image_wrap.cxx index 20a8fa35..9759a660 100644 --- a/src/swig-0_27_4/image_wrap.cxx +++ b/src/swig-0_27_4/image_wrap.cxx @@ -4324,6 +4324,29 @@ SWIGINTERNINLINE PyObject* } +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_ImageType = NULL; + + +static PyObject* _create_enum_Exiv2_ImageType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_ImageType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ImageType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_ImageType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ImageType); + return PyEnum_Exiv2_ImageType; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4343,24 +4366,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -8644,7 +8649,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(19), "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), "webp", int(23), diff --git a/src/swig-0_27_4/properties_wrap.cxx b/src/swig-0_27_4/properties_wrap.cxx index 4f1b23ba..ba5a6150 100644 --- a/src/swig-0_27_4/properties_wrap.cxx +++ b/src/swig-0_27_4/properties_wrap.cxx @@ -4139,6 +4139,29 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + +static PyObject* _create_enum_Exiv2_XmpCategory( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpCategory = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpCategory) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpCategory, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpCategory); + return PyEnum_Exiv2_XmpCategory; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4158,24 +4181,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -4248,9 +4253,6 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } -static PyObject* PyEnum_Exiv2_XmpCategory = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { if (!PyEnum_Exiv2_XmpCategory) PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( @@ -6929,7 +6931,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_create_enum_Exiv2_XmpCategory( "XmpCategory", "Category of an XMP property.", _get_enum_list(0, "xmpInternal",Exiv2::xmpInternal,"xmpExternal",Exiv2::xmpExternal,"Internal",Exiv2::xmpInternal,"External",Exiv2::xmpExternal, NULL))); /* type 'Exiv2::XmpProperties' */ diff --git a/src/swig-0_27_4/types_wrap.cxx b/src/swig-0_27_4/types_wrap.cxx index d1dd8554..c6ceb8d1 100644 --- a/src/swig-0_27_4/types_wrap.cxx +++ b/src/swig-0_27_4/types_wrap.cxx @@ -4273,6 +4273,29 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc) #define DATABUF_SIZE size_ +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + +static PyObject* _create_enum_Exiv2_AccessMode( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_AccessMode = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_AccessMode) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_AccessMode, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_AccessMode); + return PyEnum_Exiv2_AccessMode; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4292,21 +4315,63 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* _create_enum_Exiv2_ByteOrder( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_ByteOrder = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ByteOrder) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_ByteOrder, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ByteOrder); + return PyEnum_Exiv2_ByteOrder; +}; + + +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + +static PyObject* _create_enum_Exiv2_MetadataId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_MetadataId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_MetadataId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_MetadataId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_MetadataId); + return PyEnum_Exiv2_MetadataId; +}; + + +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + +static PyObject* _create_enum_Exiv2_TypeId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_TypeId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_TypeId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_TypeId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_TypeId); + return PyEnum_Exiv2_TypeId; }; @@ -4327,9 +4392,6 @@ static int Exiv2_DataBuf_getbuff( }; -static PyObject* PyEnum_Exiv2_TypeId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::TypeId value) { if (!PyEnum_Exiv2_TypeId) PyEnum_Exiv2_TypeId = PyObject_GetAttrString( @@ -8179,13 +8241,13 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_create_enum_Exiv2_AccessMode( "AccessMode", "An identifier for each mode of metadata support.", _get_enum_list(0, "amNone",Exiv2::amNone,"amRead",Exiv2::amRead,"amWrite",Exiv2::amWrite,"amReadWrite",Exiv2::amReadWrite,"none",Exiv2::amNone,"Read",Exiv2::amRead,"Write",Exiv2::amWrite,"ReadWrite",Exiv2::amReadWrite, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_create_enum_Exiv2_ByteOrder( "ByteOrder", "Type to express the byte order (little or big endian).", _get_enum_list(0, "invalidByteOrder",Exiv2::invalidByteOrder,"littleEndian",Exiv2::littleEndian,"bigEndian",Exiv2::bigEndian, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_create_enum_Exiv2_MetadataId( "MetadataId", "An identifier for each type of metadata.", _get_enum_list(0, "mdNone",Exiv2::mdNone,"mdExif",Exiv2::mdExif,"mdIptc",Exiv2::mdIptc,"mdComment",Exiv2::mdComment,"mdXmp",Exiv2::mdXmp,"mdIccProfile",Exiv2::mdIccProfile,"none",Exiv2::mdNone,"Exif",Exiv2::mdExif,"Iptc",Exiv2::mdIptc,"Comment",Exiv2::mdComment,"Xmp",Exiv2::mdXmp,"IccProfile",Exiv2::mdIccProfile, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_create_enum_Exiv2_TypeId( "TypeId", "Exiv2 value type identifiers.\n" "\nUsed primarily as identifiers when creating Exiv2 Value instances. See" "\nexiv2.Value.create(). 0x0000 to 0xffff are reserved for TIFF (Exif) types.", _get_enum_list(0, "unsignedByte",Exiv2::unsignedByte,"asciiString",Exiv2::asciiString,"unsignedShort",Exiv2::unsignedShort,"unsignedLong",Exiv2::unsignedLong,"unsignedRational",Exiv2::unsignedRational,"signedByte",Exiv2::signedByte,"undefined",Exiv2::undefined,"signedShort",Exiv2::signedShort,"signedLong",Exiv2::signedLong,"signedRational",Exiv2::signedRational,"tiffFloat",Exiv2::tiffFloat,"tiffDouble",Exiv2::tiffDouble,"tiffIfd",Exiv2::tiffIfd,"string",Exiv2::string,"date",Exiv2::date,"time",Exiv2::time,"comment",Exiv2::comment,"directory",Exiv2::directory,"xmpText",Exiv2::xmpText,"xmpAlt",Exiv2::xmpAlt,"xmpBag",Exiv2::xmpBag,"xmpSeq",Exiv2::xmpSeq,"langAlt",Exiv2::langAlt,"invalidTypeId",Exiv2::invalidTypeId,"lastTypeId",Exiv2::lastTypeId, NULL))); diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index 21614bd4..4873d60a 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -5898,18 +5898,23 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &v return pv; } -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + +static PyObject* _create_enum_Exiv2_CommentValue_CharsetId( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_CommentValue_CharsetId) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_CommentValue_CharsetId, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -5923,9 +5928,6 @@ SWIG_FromCharPtr(const char *cptr) } -static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { PyObject* parent_class = PyObject_GetAttrString( @@ -5994,6 +5996,43 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; +static PyObject* _create_enum_Exiv2_XmpValue_XmpArrayType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpArrayType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + return PyEnum_Exiv2_XmpValue_XmpArrayType; +}; + + +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + +static PyObject* _create_enum_Exiv2_XmpValue_XmpStruct( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpStruct, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + return PyEnum_Exiv2_XmpValue_XmpStruct; +}; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { PyObject* parent_class = PyObject_GetAttrString( @@ -6024,9 +6063,6 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } -static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { PyObject* parent_class = PyObject_GetAttrString( @@ -34496,7 +34532,7 @@ SWIG_init(void) { /* type 'Exiv2::CommentValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CommentValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_create_enum_Exiv2_CommentValue_CharsetId( "CharsetId", "Character set identifiers for the character sets defined by Exif.", _get_enum_list(0, "ascii",Exiv2::CommentValue::ascii,"jis",Exiv2::CommentValue::jis,"unicode",Exiv2::CommentValue::unicode,"undefined",Exiv2::CommentValue::undefined,"invalidCharsetId",Exiv2::CommentValue::invalidCharsetId,"lastCharsetId",Exiv2::CommentValue::lastCharsetId, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; @@ -34532,9 +34568,9 @@ SWIG_init(void) { /* type 'Exiv2::XmpValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__XmpValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_create_enum_Exiv2_XmpValue_XmpArrayType( "XmpArrayType", "XMP array types.", _get_enum_list(0, "xaNone",Exiv2::XmpValue::xaNone,"xaAlt",Exiv2::XmpValue::xaAlt,"xaBag",Exiv2::XmpValue::xaBag,"xaSeq",Exiv2::XmpValue::xaSeq, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_create_enum_Exiv2_XmpValue_XmpStruct( "XmpStruct", "XMP structure indicator.", _get_enum_list(0, "xsNone",Exiv2::XmpValue::xsNone,"xsStruct",Exiv2::XmpValue::xsStruct, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; diff --git a/src/swig-0_28_0/basicio_wrap.cxx b/src/swig-0_28_0/basicio_wrap.cxx index 51c45bb5..95229b12 100644 --- a/src/swig-0_28_0/basicio_wrap.cxx +++ b/src/swig-0_28_0/basicio_wrap.cxx @@ -4197,18 +4197,23 @@ PyObject* _enum_list_Position() { static PyObject* Py_IntEnum = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; + + +static PyObject* _create_enum_Exiv2_BasicIo_Position( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_BasicIo_Position = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_BasicIo_Position) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_BasicIo_Position, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_BasicIo_Position); + return PyEnum_Exiv2_BasicIo_Position; }; @@ -4575,9 +4580,6 @@ SWIG_AsVal_long_SS_long (PyObject *obj, long long *val) #endif -static PyObject* PyEnum_Exiv2_BasicIo_Position = NULL; - - static PyObject* get_enum_typeobject(Exiv2::BasicIo::Position value) { if (!PyEnum_Exiv2_BasicIo_Position) { PyObject* parent_class = PyObject_GetAttrString( @@ -11576,7 +11578,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Position",_create_enum_Exiv2_BasicIo_Position( "Position", "Seek starting positions.", _get_enum_list(0, "beg",Exiv2::BasicIo::beg,"cur",Exiv2::BasicIo::cur,"end",Exiv2::BasicIo::end, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; diff --git a/src/swig-0_28_0/error_wrap.cxx b/src/swig-0_28_0/error_wrap.cxx index bbf30348..a4ad8121 100644 --- a/src/swig-0_28_0/error_wrap.cxx +++ b/src/swig-0_28_0/error_wrap.cxx @@ -4118,6 +4118,29 @@ static void log_to_python(int level, const char* msg) { }; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; + + +static PyObject* _create_enum_Exiv2_LogMsg_Level( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_LogMsg_Level = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_LogMsg_Level) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_LogMsg_Level, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_LogMsg_Level); + return PyEnum_Exiv2_LogMsg_Level; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4137,30 +4160,9 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - static PyObject* exiv2_module = NULL; -static PyObject* PyEnum_Exiv2_LogMsg_Level = NULL; - - static PyObject* get_enum_typeobject(Exiv2::LogMsg::Level value) { if (!PyEnum_Exiv2_LogMsg_Level) { PyObject* parent_class = PyObject_GetAttrString( @@ -5115,7 +5117,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "Level",_create_enum_Exiv2_LogMsg_Level( "Level", "Defined log levels.\n" "\nTo suppress all log messages, either set the log level to mute or set" "\nthe log message handler to None.", _get_enum_list(0, "debug",Exiv2::LogMsg::debug,"info",Exiv2::LogMsg::info,"warn",Exiv2::LogMsg::warn,"error",Exiv2::LogMsg::error,"mute",Exiv2::LogMsg::mute, NULL))); diff --git a/src/swig-0_28_0/image_wrap.cxx b/src/swig-0_28_0/image_wrap.cxx index 9ee7dfcf..c862ddc1 100644 --- a/src/swig-0_28_0/image_wrap.cxx +++ b/src/swig-0_28_0/image_wrap.cxx @@ -4324,6 +4324,29 @@ SWIGINTERNINLINE PyObject* } +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_ImageType = NULL; + + +static PyObject* _create_enum_Exiv2_ImageType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_ImageType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ImageType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_ImageType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ImageType); + return PyEnum_Exiv2_ImageType; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4343,24 +4366,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -4596,9 +4601,6 @@ static PyObject* py_from_enum(Exiv2::AccessMode value) { } -static PyObject* PyEnum_Exiv2_ImageType = NULL; - - static PyObject* get_enum_typeobject(Exiv2::ImageType value) { if (!PyEnum_Exiv2_ImageType) PyEnum_Exiv2_ImageType = PyObject_GetAttrString( @@ -8881,7 +8883,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(Exiv2::ImageType::bmff), "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(Exiv2::ImageType::asf), "mkv", int(Exiv2::ImageType::mkv), "qtime", int(Exiv2::ImageType::qtime), "riff", int(Exiv2::ImageType::riff), "webp", int(Exiv2::ImageType::webp), diff --git a/src/swig-0_28_0/properties_wrap.cxx b/src/swig-0_28_0/properties_wrap.cxx index 4191eddc..098682c7 100644 --- a/src/swig-0_28_0/properties_wrap.cxx +++ b/src/swig-0_28_0/properties_wrap.cxx @@ -4139,6 +4139,29 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_XmpCategory = NULL; + + +static PyObject* _create_enum_Exiv2_XmpCategory( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpCategory = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpCategory) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpCategory, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpCategory); + return PyEnum_Exiv2_XmpCategory; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4158,24 +4181,6 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; - - -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { - if (!enum_list) - return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) - return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) - return NULL; - return result; -}; - - SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -4248,9 +4253,6 @@ static PyObject* py_from_enum(Exiv2::TypeId value) { } -static PyObject* PyEnum_Exiv2_XmpCategory = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpCategory value) { if (!PyEnum_Exiv2_XmpCategory) PyEnum_Exiv2_XmpCategory = PyObject_GetAttrString( @@ -7043,7 +7045,7 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpCategory",_create_enum_Exiv2_XmpCategory( "XmpCategory", "Category of an XMP property.", _get_enum_list(0, "xmpInternal",Exiv2::xmpInternal,"xmpExternal",Exiv2::xmpExternal,"Internal",Exiv2::xmpInternal,"External",Exiv2::xmpExternal, NULL))); /* type 'Exiv2::XmpProperties' */ diff --git a/src/swig-0_28_0/tags_wrap.cxx b/src/swig-0_28_0/tags_wrap.cxx index 923e1030..f7a4750e 100644 --- a/src/swig-0_28_0/tags_wrap.cxx +++ b/src/swig-0_28_0/tags_wrap.cxx @@ -4137,6 +4137,29 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_IfdId = NULL; + + +static PyObject* _create_enum_Exiv2_IfdId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_IfdId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_IfdId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_IfdId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_IfdId); + return PyEnum_Exiv2_IfdId; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4156,21 +4179,23 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_SectionId = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* _create_enum_Exiv2_SectionId( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_SectionId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_SectionId) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_SectionId, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_SectionId); + return PyEnum_Exiv2_SectionId; }; @@ -4191,9 +4216,6 @@ class _TagListFct { }; -static PyObject* PyEnum_Exiv2_IfdId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::IfdId value) { if (!PyEnum_Exiv2_IfdId) PyEnum_Exiv2_IfdId = PyObject_GetAttrString( @@ -4218,9 +4240,6 @@ static PyObject* py_from_enum(Exiv2::IfdId value) { } -static PyObject* PyEnum_Exiv2_SectionId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::SectionId value) { if (!PyEnum_Exiv2_SectionId) PyEnum_Exiv2_SectionId = PyObject_GetAttrString( @@ -7379,10 +7398,10 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "IfdId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "IfdId",_create_enum_Exiv2_IfdId( "IfdId", "Type to specify the IFD to which a metadata belongs.\n" "\nMaker note IFDs have been omitted from this enum.", _get_enum_list(0, "ifdIdNotSet",Exiv2::IfdId::ifdIdNotSet,"ifd0Id",Exiv2::IfdId::ifd0Id,"ifd1Id",Exiv2::IfdId::ifd1Id,"ifd2Id",Exiv2::IfdId::ifd2Id,"ifd3Id",Exiv2::IfdId::ifd3Id,"exifId",Exiv2::IfdId::exifId,"gpsId",Exiv2::IfdId::gpsId,"iopId",Exiv2::IfdId::iopId,"mpfId",Exiv2::IfdId::mpfId,"subImage1Id",Exiv2::IfdId::subImage1Id,"subImage2Id",Exiv2::IfdId::subImage2Id,"subImage3Id",Exiv2::IfdId::subImage3Id,"subImage4Id",Exiv2::IfdId::subImage4Id,"subImage5Id",Exiv2::IfdId::subImage5Id,"subImage6Id",Exiv2::IfdId::subImage6Id,"subImage7Id",Exiv2::IfdId::subImage7Id,"subImage8Id",Exiv2::IfdId::subImage8Id,"subImage9Id",Exiv2::IfdId::subImage9Id,"subThumb1Id",Exiv2::IfdId::subThumb1Id,"lastId",Exiv2::IfdId::lastId,"ignoreId",Exiv2::IfdId::ignoreId, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SectionId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SectionId",_create_enum_Exiv2_SectionId( "SectionId", "Section identifiers to logically group tags.\n" "\nA section consists of nothing more than a name, based on the" "\nExif standard.", _get_enum_list(0, "sectionIfNotSet",Exiv2::SectionId::sectionIdNotSet,"imgStruct",Exiv2::SectionId::imgStruct,"recOffset",Exiv2::SectionId::recOffset,"imgCharacter",Exiv2::SectionId::imgCharacter,"otherTags",Exiv2::SectionId::otherTags,"exifFormat",Exiv2::SectionId::exifFormat,"exifVersion",Exiv2::SectionId::exifVersion,"imgConfig",Exiv2::SectionId::imgConfig,"userInfo",Exiv2::SectionId::userInfo,"relatedFile",Exiv2::SectionId::relatedFile,"dateTime",Exiv2::SectionId::dateTime,"captureCond",Exiv2::SectionId::captureCond,"gpsTags",Exiv2::SectionId::gpsTags,"iopTags",Exiv2::SectionId::iopTags,"mpfTags",Exiv2::SectionId::mpfTags,"makerTags",Exiv2::SectionId::makerTags,"dngTags",Exiv2::SectionId::dngTags,"panaRaw",Exiv2::SectionId::panaRaw,"tiffEp",Exiv2::SectionId::tiffEp,"tiffPm6",Exiv2::SectionId::tiffPm6,"adobeOpi",Exiv2::SectionId::adobeOpi,"lastSectionId ",Exiv2::SectionId::lastSectionId, NULL))); diff --git a/src/swig-0_28_0/types_wrap.cxx b/src/swig-0_28_0/types_wrap.cxx index d43c7b90..cb1b3001 100644 --- a/src/swig-0_28_0/types_wrap.cxx +++ b/src/swig-0_28_0/types_wrap.cxx @@ -4272,6 +4272,29 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc) #define DATABUF_SIZE size() +static PyObject* Py_IntEnum = NULL; + + +static PyObject* PyEnum_Exiv2_AccessMode = NULL; + + +static PyObject* _create_enum_Exiv2_AccessMode( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_AccessMode = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_AccessMode) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_AccessMode, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_AccessMode); + return PyEnum_Exiv2_AccessMode; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -4291,21 +4314,63 @@ static PyObject* _get_enum_list(int dummy, ...) { }; -static PyObject* Py_IntEnum = NULL; +static PyObject* PyEnum_Exiv2_ByteOrder = NULL; -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* _create_enum_Exiv2_ByteOrder( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_ByteOrder = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_ByteOrder) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_ByteOrder, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_ByteOrder); + return PyEnum_Exiv2_ByteOrder; +}; + + +static PyObject* PyEnum_Exiv2_MetadataId = NULL; + + +static PyObject* _create_enum_Exiv2_MetadataId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_MetadataId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_MetadataId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_MetadataId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_MetadataId); + return PyEnum_Exiv2_MetadataId; +}; + + +static PyObject* PyEnum_Exiv2_TypeId = NULL; + + +static PyObject* _create_enum_Exiv2_TypeId( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_TypeId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_TypeId) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_TypeId, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_TypeId); + return PyEnum_Exiv2_TypeId; }; @@ -4326,9 +4391,6 @@ static int Exiv2_DataBuf_getbuff( }; -static PyObject* PyEnum_Exiv2_TypeId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::TypeId value) { if (!PyEnum_Exiv2_TypeId) PyEnum_Exiv2_TypeId = PyObject_GetAttrString( @@ -8178,13 +8240,13 @@ SWIG_init(void) { return NULL; } - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AccessMode",_create_enum_Exiv2_AccessMode( "AccessMode", "An identifier for each mode of metadata support.", _get_enum_list(0, "amNone",Exiv2::amNone,"amRead",Exiv2::amRead,"amWrite",Exiv2::amWrite,"amReadWrite",Exiv2::amReadWrite,"none",Exiv2::amNone,"Read",Exiv2::amRead,"Write",Exiv2::amWrite,"ReadWrite",Exiv2::amReadWrite, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ByteOrder",_create_enum_Exiv2_ByteOrder( "ByteOrder", "Type to express the byte order (little or big endian).", _get_enum_list(0, "invalidByteOrder",Exiv2::invalidByteOrder,"littleEndian",Exiv2::littleEndian,"bigEndian",Exiv2::bigEndian, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "MetadataId",_create_enum_Exiv2_MetadataId( "MetadataId", "An identifier for each type of metadata.", _get_enum_list(0, "mdNone",Exiv2::mdNone,"mdExif",Exiv2::mdExif,"mdIptc",Exiv2::mdIptc,"mdComment",Exiv2::mdComment,"mdXmp",Exiv2::mdXmp,"mdIccProfile",Exiv2::mdIccProfile,"none",Exiv2::mdNone,"Exif",Exiv2::mdExif,"Iptc",Exiv2::mdIptc,"Comment",Exiv2::mdComment,"Xmp",Exiv2::mdXmp,"IccProfile",Exiv2::mdIccProfile, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "TypeId",_create_enum_Exiv2_TypeId( "TypeId", "Exiv2 value type identifiers.\n" "\nUsed primarily as identifiers when creating Exiv2 Value instances. See" "\nexiv2.Value.create(). 0x0000 to 0xffff are reserved for TIFF (Exif) types.", _get_enum_list(0, "unsignedByte",Exiv2::unsignedByte,"asciiString",Exiv2::asciiString,"unsignedShort",Exiv2::unsignedShort,"unsignedLong",Exiv2::unsignedLong,"unsignedRational",Exiv2::unsignedRational,"signedByte",Exiv2::signedByte,"undefined",Exiv2::undefined,"signedShort",Exiv2::signedShort,"signedLong",Exiv2::signedLong,"signedRational",Exiv2::signedRational,"tiffFloat",Exiv2::tiffFloat,"tiffDouble",Exiv2::tiffDouble,"tiffIfd",Exiv2::tiffIfd,"string",Exiv2::string,"date",Exiv2::date,"time",Exiv2::time,"comment",Exiv2::comment,"directory",Exiv2::directory,"xmpText",Exiv2::xmpText,"xmpAlt",Exiv2::xmpAlt,"xmpBag",Exiv2::xmpBag,"xmpSeq",Exiv2::xmpSeq,"langAlt",Exiv2::langAlt,"invalidTypeId",Exiv2::invalidTypeId,"lastTypeId",Exiv2::lastTypeId, NULL))); diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 6cfd74d4..7fe4462d 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -6068,18 +6068,23 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &v return pv; } -#include -static PyObject* _get_enum_object(const char* name, const char* doc, - PyObject* enum_list) { +static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; + + +static PyObject* _create_enum_Exiv2_CommentValue_CharsetId( + const char* name, const char* doc, PyObject* enum_list) { if (!enum_list) return NULL; - PyObject* result = PyObject_CallFunction(Py_IntEnum, "sN", - name, enum_list); - if (!result) + PyEnum_Exiv2_CommentValue_CharsetId = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_CommentValue_CharsetId) return NULL; - if (PyObject_SetAttrString(result, "__doc__", PyUnicode_FromString(doc))) + if (PyObject_SetAttrString( + PyEnum_Exiv2_CommentValue_CharsetId, "__doc__", PyUnicode_FromString(doc))) return NULL; - return result; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_CommentValue_CharsetId); + return PyEnum_Exiv2_CommentValue_CharsetId; }; @@ -6093,9 +6098,6 @@ SWIG_FromCharPtr(const char *cptr) } -static PyObject* PyEnum_Exiv2_CommentValue_CharsetId = NULL; - - static PyObject* get_enum_typeobject(Exiv2::CommentValue::CharsetId value) { if (!PyEnum_Exiv2_CommentValue_CharsetId) { PyObject* parent_class = PyObject_GetAttrString( @@ -6164,6 +6166,43 @@ SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value cons static PyObject* PyEnum_Exiv2_XmpValue_XmpArrayType = NULL; +static PyObject* _create_enum_Exiv2_XmpValue_XmpArrayType( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpArrayType = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpArrayType) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpArrayType, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpArrayType); + return PyEnum_Exiv2_XmpValue_XmpArrayType; +}; + + +static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; + + +static PyObject* _create_enum_Exiv2_XmpValue_XmpStruct( + const char* name, const char* doc, PyObject* enum_list) { + if (!enum_list) + return NULL; + PyEnum_Exiv2_XmpValue_XmpStruct = PyObject_CallFunction( + Py_IntEnum, "sN", name, enum_list); + if (!PyEnum_Exiv2_XmpValue_XmpStruct) + return NULL; + if (PyObject_SetAttrString( + PyEnum_Exiv2_XmpValue_XmpStruct, "__doc__", PyUnicode_FromString(doc))) + return NULL; + // SWIG_Python_SetConstant will decref PyEnum object + Py_INCREF(PyEnum_Exiv2_XmpValue_XmpStruct); + return PyEnum_Exiv2_XmpValue_XmpStruct; +}; + + static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpArrayType value) { if (!PyEnum_Exiv2_XmpValue_XmpArrayType) { PyObject* parent_class = PyObject_GetAttrString( @@ -6194,9 +6233,6 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpArrayType value) { } -static PyObject* PyEnum_Exiv2_XmpValue_XmpStruct = NULL; - - static PyObject* get_enum_typeobject(Exiv2::XmpValue::XmpStruct value) { if (!PyEnum_Exiv2_XmpValue_XmpStruct) { PyObject* parent_class = PyObject_GetAttrString( @@ -36527,7 +36563,7 @@ SWIG_init(void) { /* type 'Exiv2::CommentValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__CommentValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "CharsetId",_create_enum_Exiv2_CommentValue_CharsetId( "CharsetId", "Character set identifiers for the character sets defined by Exif.", _get_enum_list(0, "ascii",Exiv2::CommentValue::ascii,"jis",Exiv2::CommentValue::jis,"unicode",Exiv2::CommentValue::unicode,"undefined",Exiv2::CommentValue::undefined,"invalidCharsetId",Exiv2::CommentValue::invalidCharsetId,"lastCharsetId",Exiv2::CommentValue::lastCharsetId, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; @@ -36563,9 +36599,9 @@ SWIG_init(void) { /* type 'Exiv2::XmpValue' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__XmpValue_type; builtin_pytype->tp_dict = d = PyDict_New(); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpArrayType",_create_enum_Exiv2_XmpValue_XmpArrayType( "XmpArrayType", "XMP array types.", _get_enum_list(0, "xaNone",Exiv2::XmpValue::xaNone,"xaAlt",Exiv2::XmpValue::xaAlt,"xaBag",Exiv2::XmpValue::xaBag,"xaSeq",Exiv2::XmpValue::xaSeq, NULL))); - SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_get_enum_object( + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XmpStruct",_create_enum_Exiv2_XmpValue_XmpStruct( "XmpStruct", "XMP structure indicator.", _get_enum_list(0, "xsNone",Exiv2::XmpValue::xsNone,"xsStruct",Exiv2::XmpValue::xsStruct, NULL))); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; From 01ffd297e2e027aca357d340094172bd42f387f3 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 12:25:25 +0000 Subject: [PATCH 06/12] Remove unneeded type converters in ImageType list --- src/interface/image.i | 60 +++++++++++++++++----------------- src/swig-0_27_0/image_wrap.cxx | 6 ++-- src/swig-0_27_4/image_wrap.cxx | 6 ++-- src/swig-0_28_0/image_wrap.cxx | 8 ++--- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/interface/image.i b/src/interface/image.i index 84e47446..895a5c42 100644 --- a/src/interface/image.i +++ b/src/interface/image.i @@ -114,13 +114,13 @@ KEEP_REFERENCE(Exiv2::DataBuf&) // Make image types available #if (EXIV2_VERSION_HEX >= 0x001c0000) -#define _BMFF "bmff", int(Exiv2::ImageType::bmff), -#define _WEBP "webp", int(Exiv2::ImageType::webp), +#define _BMFF "bmff", Exiv2::ImageType::bmff, +#define _WEBP "webp", Exiv2::ImageType::webp, #define _VIDEO \ - "asf", int(Exiv2::ImageType::asf), \ - "mkv", int(Exiv2::ImageType::mkv), \ - "qtime", int(Exiv2::ImageType::qtime), \ - "riff", int(Exiv2::ImageType::riff), + "asf", Exiv2::ImageType::asf, \ + "mkv", Exiv2::ImageType::mkv, \ + "qtime", Exiv2::ImageType::qtime, \ + "riff", Exiv2::ImageType::riff, #else #define _BMFF "bmff", int(19), #define _WEBP "webp", int(23), @@ -132,33 +132,33 @@ KEEP_REFERENCE(Exiv2::DataBuf&) #endif ENUM(ImageType, "Supported image formats.", - "arw", int(Exiv2::ImageType::arw), + "arw", Exiv2::ImageType::arw, _BMFF - "bmp", int(Exiv2::ImageType::bmp), - "cr2", int(Exiv2::ImageType::cr2), - "crw", int(Exiv2::ImageType::crw), - "dng", int(Exiv2::ImageType::dng), - "eps", int(Exiv2::ImageType::eps), - "exv", int(Exiv2::ImageType::exv), - "gif", int(Exiv2::ImageType::gif), - "jp2", int(Exiv2::ImageType::jp2), - "jpeg", int(Exiv2::ImageType::jpeg), - "mrw", int(Exiv2::ImageType::mrw), - "nef", int(Exiv2::ImageType::nef), - "none", int(Exiv2::ImageType::none), - "orf", int(Exiv2::ImageType::orf), - "pgf", int(Exiv2::ImageType::pgf), - "png", int(Exiv2::ImageType::png), - "psd", int(Exiv2::ImageType::psd), - "raf", int(Exiv2::ImageType::raf), - "rw2", int(Exiv2::ImageType::rw2), - "sr2", int(Exiv2::ImageType::sr2), - "srw", int(Exiv2::ImageType::srw), - "tga", int(Exiv2::ImageType::tga), - "tiff", int(Exiv2::ImageType::tiff), + "bmp", Exiv2::ImageType::bmp, + "cr2", Exiv2::ImageType::cr2, + "crw", Exiv2::ImageType::crw, + "dng", Exiv2::ImageType::dng, + "eps", Exiv2::ImageType::eps, + "exv", Exiv2::ImageType::exv, + "gif", Exiv2::ImageType::gif, + "jp2", Exiv2::ImageType::jp2, + "jpeg", Exiv2::ImageType::jpeg, + "mrw", Exiv2::ImageType::mrw, + "nef", Exiv2::ImageType::nef, + "none", Exiv2::ImageType::none, + "orf", Exiv2::ImageType::orf, + "pgf", Exiv2::ImageType::pgf, + "png", Exiv2::ImageType::png, + "psd", Exiv2::ImageType::psd, + "raf", Exiv2::ImageType::raf, + "rw2", Exiv2::ImageType::rw2, + "sr2", Exiv2::ImageType::sr2, + "srw", Exiv2::ImageType::srw, + "tga", Exiv2::ImageType::tga, + "tiff", Exiv2::ImageType::tiff, _VIDEO _WEBP - "xmp", int(Exiv2::ImageType::xmp)); + "xmp", Exiv2::ImageType::xmp); %ignore Exiv2::ImageType::none; // Ignore const versions of methods diff --git a/src/swig-0_27_0/image_wrap.cxx b/src/swig-0_27_0/image_wrap.cxx index 9759a660..0fde11d9 100644 --- a/src/swig-0_27_0/image_wrap.cxx +++ b/src/swig-0_27_0/image_wrap.cxx @@ -8650,10 +8650,10 @@ SWIG_init(void) { } SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( - "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(19), - "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), + "ImageType", "Supported image formats.", _get_enum_list(0, "arw",Exiv2::ImageType::arw,"bmff", int(19), + "bmp",Exiv2::ImageType::bmp,"cr2",Exiv2::ImageType::cr2,"crw",Exiv2::ImageType::crw,"dng",Exiv2::ImageType::dng,"eps",Exiv2::ImageType::eps,"exv",Exiv2::ImageType::exv,"gif",Exiv2::ImageType::gif,"jp2",Exiv2::ImageType::jp2,"jpeg",Exiv2::ImageType::jpeg,"mrw",Exiv2::ImageType::mrw,"nef",Exiv2::ImageType::nef,"none",Exiv2::ImageType::none,"orf",Exiv2::ImageType::orf,"pgf",Exiv2::ImageType::pgf,"png",Exiv2::ImageType::png,"psd",Exiv2::ImageType::psd,"raf",Exiv2::ImageType::raf,"rw2",Exiv2::ImageType::rw2,"sr2",Exiv2::ImageType::sr2,"srw",Exiv2::ImageType::srw,"tga",Exiv2::ImageType::tga,"tiff",Exiv2::ImageType::tiff, "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), "webp", int(23), - "xmp",int(Exiv2::ImageType::xmp), NULL))); + "xmp",Exiv2::ImageType::xmp, NULL))); /* type 'Exiv2::Image' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__Image_type; diff --git a/src/swig-0_27_4/image_wrap.cxx b/src/swig-0_27_4/image_wrap.cxx index 9759a660..0fde11d9 100644 --- a/src/swig-0_27_4/image_wrap.cxx +++ b/src/swig-0_27_4/image_wrap.cxx @@ -8650,10 +8650,10 @@ SWIG_init(void) { } SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( - "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(19), - "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), + "ImageType", "Supported image formats.", _get_enum_list(0, "arw",Exiv2::ImageType::arw,"bmff", int(19), + "bmp",Exiv2::ImageType::bmp,"cr2",Exiv2::ImageType::cr2,"crw",Exiv2::ImageType::crw,"dng",Exiv2::ImageType::dng,"eps",Exiv2::ImageType::eps,"exv",Exiv2::ImageType::exv,"gif",Exiv2::ImageType::gif,"jp2",Exiv2::ImageType::jp2,"jpeg",Exiv2::ImageType::jpeg,"mrw",Exiv2::ImageType::mrw,"nef",Exiv2::ImageType::nef,"none",Exiv2::ImageType::none,"orf",Exiv2::ImageType::orf,"pgf",Exiv2::ImageType::pgf,"png",Exiv2::ImageType::png,"psd",Exiv2::ImageType::psd,"raf",Exiv2::ImageType::raf,"rw2",Exiv2::ImageType::rw2,"sr2",Exiv2::ImageType::sr2,"srw",Exiv2::ImageType::srw,"tga",Exiv2::ImageType::tga,"tiff",Exiv2::ImageType::tiff, "asf", int(24), "mkv", int(21), "qtime", int(22), "riff", int(20), "webp", int(23), - "xmp",int(Exiv2::ImageType::xmp), NULL))); + "xmp",Exiv2::ImageType::xmp, NULL))); /* type 'Exiv2::Image' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__Image_type; diff --git a/src/swig-0_28_0/image_wrap.cxx b/src/swig-0_28_0/image_wrap.cxx index c862ddc1..a2544e88 100644 --- a/src/swig-0_28_0/image_wrap.cxx +++ b/src/swig-0_28_0/image_wrap.cxx @@ -8884,10 +8884,10 @@ SWIG_init(void) { } SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ImageType",_create_enum_Exiv2_ImageType( - "ImageType", "Supported image formats.", _get_enum_list(0, "arw",int(Exiv2::ImageType::arw),"bmff", int(Exiv2::ImageType::bmff), - "bmp",int(Exiv2::ImageType::bmp),"cr2",int(Exiv2::ImageType::cr2),"crw",int(Exiv2::ImageType::crw),"dng",int(Exiv2::ImageType::dng),"eps",int(Exiv2::ImageType::eps),"exv",int(Exiv2::ImageType::exv),"gif",int(Exiv2::ImageType::gif),"jp2",int(Exiv2::ImageType::jp2),"jpeg",int(Exiv2::ImageType::jpeg),"mrw",int(Exiv2::ImageType::mrw),"nef",int(Exiv2::ImageType::nef),"none",int(Exiv2::ImageType::none),"orf",int(Exiv2::ImageType::orf),"pgf",int(Exiv2::ImageType::pgf),"png",int(Exiv2::ImageType::png),"psd",int(Exiv2::ImageType::psd),"raf",int(Exiv2::ImageType::raf),"rw2",int(Exiv2::ImageType::rw2),"sr2",int(Exiv2::ImageType::sr2),"srw",int(Exiv2::ImageType::srw),"tga",int(Exiv2::ImageType::tga),"tiff",int(Exiv2::ImageType::tiff), "asf", int(Exiv2::ImageType::asf), "mkv", int(Exiv2::ImageType::mkv), "qtime", int(Exiv2::ImageType::qtime), "riff", int(Exiv2::ImageType::riff), - "webp", int(Exiv2::ImageType::webp), - "xmp",int(Exiv2::ImageType::xmp), NULL))); + "ImageType", "Supported image formats.", _get_enum_list(0, "arw",Exiv2::ImageType::arw,"bmff", Exiv2::ImageType::bmff, + "bmp",Exiv2::ImageType::bmp,"cr2",Exiv2::ImageType::cr2,"crw",Exiv2::ImageType::crw,"dng",Exiv2::ImageType::dng,"eps",Exiv2::ImageType::eps,"exv",Exiv2::ImageType::exv,"gif",Exiv2::ImageType::gif,"jp2",Exiv2::ImageType::jp2,"jpeg",Exiv2::ImageType::jpeg,"mrw",Exiv2::ImageType::mrw,"nef",Exiv2::ImageType::nef,"none",Exiv2::ImageType::none,"orf",Exiv2::ImageType::orf,"pgf",Exiv2::ImageType::pgf,"png",Exiv2::ImageType::png,"psd",Exiv2::ImageType::psd,"raf",Exiv2::ImageType::raf,"rw2",Exiv2::ImageType::rw2,"sr2",Exiv2::ImageType::sr2,"srw",Exiv2::ImageType::srw,"tga",Exiv2::ImageType::tga,"tiff",Exiv2::ImageType::tiff, "asf", Exiv2::ImageType::asf, "mkv", Exiv2::ImageType::mkv, "qtime", Exiv2::ImageType::qtime, "riff", Exiv2::ImageType::riff, + "webp", Exiv2::ImageType::webp, + "xmp",Exiv2::ImageType::xmp, NULL))); /* type 'Exiv2::Image' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__Exiv2__Image_type; From e9a4cc0c61126c6130bf431f8e5bb1a147a61985 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 14:27:47 +0000 Subject: [PATCH 07/12] Remove unneeded exception handlers --- src/interface/datasets.i | 9 +- src/swig-0_27_0/datasets_wrap.cxx | 321 ++------------------------ src/swig-0_27_4/datasets_wrap.cxx | 321 ++------------------------ src/swig-0_28_0/datasets_wrap.cxx | 367 ++---------------------------- 4 files changed, 76 insertions(+), 942 deletions(-) diff --git a/src/interface/datasets.i b/src/interface/datasets.i index 3c560338..f0c84250 100644 --- a/src/interface/datasets.i +++ b/src/interface/datasets.i @@ -24,8 +24,12 @@ %import "metadatum.i" -// Catch all C++ exceptions -EXCEPTION(,) +// Catch some C++ exceptions +%exception; +EXCEPTION(Exiv2::IptcDataSets::dataSet,) +EXCEPTION(Exiv2::IptcDataSets::recordId,) +EXCEPTION(Exiv2::IptcKey::IptcKey(std::string),) +EXCEPTION(Exiv2::IptcKey::IptcKey(std::string const &),) UNIQUE_PTR(Exiv2::IptcKey); @@ -56,6 +60,7 @@ LIST_POINTER(const Exiv2::DataSet*, Exiv2::DataSet, number_ != 0xffff) %ignore Exiv2::Dictionary_i; %ignore Exiv2::IptcDataSets::dataSetList; %ignore Exiv2::IptcDataSets::IptcDataSets; +%ignore Exiv2::IptcDataSets::~IptcDataSets; %ignore Exiv2::RecordInfo; %ignore Exiv2::StringSet; %ignore Exiv2::StringSet_i; diff --git a/src/swig-0_27_0/datasets_wrap.cxx b/src/swig-0_27_0/datasets_wrap.cxx index 54157e21..46baccad 100644 --- a/src/swig-0_27_0/datasets_wrap.cxx +++ b/src/swig-0_27_0/datasets_wrap.cxx @@ -4579,18 +4579,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetName(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4620,18 +4609,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetTitle(PyObject *self, PyObject *a SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetTitle" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4661,18 +4639,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetDesc(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetDesc" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4702,18 +4669,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetPsName(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetPsName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4743,18 +4699,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetRepeatable(PyObject *self, PyObje SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetRepeatable" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -4832,18 +4777,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetType(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetType" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); { resultobj = py_from_enum(result); if (!resultobj) @@ -4870,18 +4804,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordName(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordName" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = Exiv2::IptcDataSets::recordName(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::recordName(arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4904,18 +4827,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordDesc(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordDesc" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4969,18 +4881,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_envelopeRecordList(PyObject *self, PyObj Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_envelopeRecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4995,18 +4896,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_application2RecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -5016,39 +4906,6 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P } -SWIGINTERN PyObject *_wrap_delete_IptcDataSets(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::IptcDataSets *arg1 = (Exiv2::IptcDataSets *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_IptcDataSets", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__IptcDataSets, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcDataSets" "', argument " "1"" of type '" "Exiv2::IptcDataSets *""'"); - } - arg1 = reinterpret_cast< Exiv2::IptcDataSets * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_IptcDataSets) /* defines _wrap_delete_IptcDataSets_destructor_closure */ - SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5109,18 +4966,7 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IptcKey" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__IptcKey, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5144,18 +4990,7 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_IptcKey" "', argument " "1"" of type '" "Exiv2::IptcKey const &""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (Exiv2::IptcKey *)new Exiv2::IptcKey((Exiv2::IptcKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::IptcKey *)new Exiv2::IptcKey((Exiv2::IptcKey const &)*arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__IptcKey, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5217,18 +5052,7 @@ SWIGINTERN PyObject *_wrap_delete_IptcKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcKey" "', argument " "1"" of type '" "Exiv2::IptcKey *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5249,18 +5073,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_key" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5281,18 +5094,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_familyName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5313,18 +5115,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_groupName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5345,18 +5136,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5377,18 +5157,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagLabel" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5409,18 +5178,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tag" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5441,18 +5199,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_clone(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_clone" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->clone(); resultobj = SWIG_NewPointerObj((&result)->release(), SWIGTYPE_p_Exiv2__IptcKey, SWIG_POINTER_OWN | 0 ); @@ -5475,18 +5222,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_recordName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_recordName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->recordName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5507,18 +5243,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_record(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_record" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5665,7 +5390,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__IptcDataSets_type = { "exiv2.datasets.IptcDataSets", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_IptcDataSets_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_27_4/datasets_wrap.cxx b/src/swig-0_27_4/datasets_wrap.cxx index 54157e21..46baccad 100644 --- a/src/swig-0_27_4/datasets_wrap.cxx +++ b/src/swig-0_27_4/datasets_wrap.cxx @@ -4579,18 +4579,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetName(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4620,18 +4609,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetTitle(PyObject *self, PyObject *a SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetTitle" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4661,18 +4639,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetDesc(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetDesc" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4702,18 +4669,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetPsName(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetPsName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4743,18 +4699,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetRepeatable(PyObject *self, PyObje SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetRepeatable" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -4832,18 +4777,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetType(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetType" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); { resultobj = py_from_enum(result); if (!resultobj) @@ -4870,18 +4804,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordName(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordName" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = Exiv2::IptcDataSets::recordName(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::recordName(arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4904,18 +4827,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordDesc(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordDesc" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4969,18 +4881,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_envelopeRecordList(PyObject *self, PyObj Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_envelopeRecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4995,18 +4896,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_application2RecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -5016,39 +4906,6 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P } -SWIGINTERN PyObject *_wrap_delete_IptcDataSets(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::IptcDataSets *arg1 = (Exiv2::IptcDataSets *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_IptcDataSets", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__IptcDataSets, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcDataSets" "', argument " "1"" of type '" "Exiv2::IptcDataSets *""'"); - } - arg1 = reinterpret_cast< Exiv2::IptcDataSets * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_IptcDataSets) /* defines _wrap_delete_IptcDataSets_destructor_closure */ - SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5109,18 +4966,7 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IptcKey" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__IptcKey, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5144,18 +4990,7 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_IptcKey" "', argument " "1"" of type '" "Exiv2::IptcKey const &""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (Exiv2::IptcKey *)new Exiv2::IptcKey((Exiv2::IptcKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::IptcKey *)new Exiv2::IptcKey((Exiv2::IptcKey const &)*arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__IptcKey, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5217,18 +5052,7 @@ SWIGINTERN PyObject *_wrap_delete_IptcKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcKey" "', argument " "1"" of type '" "Exiv2::IptcKey *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5249,18 +5073,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_key" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5281,18 +5094,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_familyName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5313,18 +5115,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_groupName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5345,18 +5136,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5377,18 +5157,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagLabel" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5409,18 +5178,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tag" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5441,18 +5199,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_clone(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_clone" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->clone(); resultobj = SWIG_NewPointerObj((&result)->release(), SWIGTYPE_p_Exiv2__IptcKey, SWIG_POINTER_OWN | 0 ); @@ -5475,18 +5222,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_recordName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_recordName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->recordName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5507,18 +5243,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_record(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_record" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5665,7 +5390,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__IptcDataSets_type = { "exiv2.datasets.IptcDataSets", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_IptcDataSets_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_28_0/datasets_wrap.cxx b/src/swig-0_28_0/datasets_wrap.cxx index d565dea7..5981c9ae 100644 --- a/src/swig-0_28_0/datasets_wrap.cxx +++ b/src/swig-0_28_0/datasets_wrap.cxx @@ -4579,20 +4579,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetName(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::dataSetName(arg1,arg2); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4622,20 +4609,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetTitle(PyObject *self, PyObject *a SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetTitle" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetTitle(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4665,20 +4639,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetDesc(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetDesc" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetDesc(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4708,20 +4669,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetPsName(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetPsName" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::dataSetPsName(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4751,20 +4699,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetRepeatable(PyObject *self, PyObje SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetRepeatable" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::IptcDataSets::dataSetRepeatable(arg1,arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -4844,20 +4779,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSetType(PyObject *self, PyObject *ar SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IptcDataSets_dataSetType" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::IptcDataSets::dataSetType(arg1,arg2); { resultobj = py_from_enum(result); if (!resultobj) @@ -4884,20 +4806,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordName(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordName" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = Exiv2::IptcDataSets::recordName(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::IptcDataSets::recordName(arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -4920,20 +4829,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordDesc(PyObject *self, PyObject *arg SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "IptcDataSets_recordDesc" "', argument " "1"" of type '" "uint16_t""'"); } arg1 = static_cast< uint16_t >(val1); - { - try { - result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::IptcDataSets::recordDesc(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4989,20 +4885,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_envelopeRecordList(PyObject *self, PyObj Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_envelopeRecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::envelopeRecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -5017,20 +4900,7 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P Exiv2::DataSet *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "IptcDataSets_application2RecordList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::DataSet *)Exiv2::IptcDataSets::application2RecordList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -5040,41 +4910,6 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P } -SWIGINTERN PyObject *_wrap_delete_IptcDataSets(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::IptcDataSets *arg1 = (Exiv2::IptcDataSets *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_IptcDataSets", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__IptcDataSets, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcDataSets" "', argument " "1"" of type '" "Exiv2::IptcDataSets *""'"); - } - arg1 = reinterpret_cast< Exiv2::IptcDataSets * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_IptcDataSets) /* defines _wrap_delete_IptcDataSets_destructor_closure */ - SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string arg1 ; @@ -5132,20 +4967,7 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IptcKey" "', argument " "2"" of type '" "uint16_t""'"); } arg2 = static_cast< uint16_t >(val2); - { - try { - result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__IptcKey, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5196,20 +5018,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_key" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5230,20 +5039,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_familyName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::IptcKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5264,20 +5060,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_groupName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5298,20 +5081,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5332,20 +5102,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagLabel" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5366,20 +5123,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tagDesc(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tagDesc" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->tagDesc(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5400,20 +5144,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_tag" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5434,20 +5165,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_clone(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_clone" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->clone(); resultobj = SWIG_NewPointerObj((&result)->release(), SWIGTYPE_p_Exiv2__IptcKey, SWIG_POINTER_OWN | 0 ); @@ -5470,20 +5188,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_recordName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_recordName" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = ((Exiv2::IptcKey const *)arg1)->recordName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::IptcKey const *)arg1)->recordName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5504,20 +5209,7 @@ SWIGINTERN PyObject *_wrap_IptcKey_record(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IptcKey_record" "', argument " "1"" of type '" "Exiv2::IptcKey const *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::IptcKey const *)arg1)->record(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5537,20 +5229,7 @@ SWIGINTERN PyObject *_wrap_delete_IptcKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IptcKey" "', argument " "1"" of type '" "Exiv2::IptcKey *""'"); } arg1 = reinterpret_cast< Exiv2::IptcKey * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5697,7 +5376,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__IptcDataSets_type = { "exiv2.datasets.IptcDataSets", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_IptcDataSets_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else From 8e3f2652c0403e19b74203bfd18e7fdbdd673904 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 15:34:40 +0000 Subject: [PATCH 08/12] Remove unneeded exception handlers --- src/interface/properties.i | 17 ++- src/swig-0_27_0/properties_wrap.cxx | 191 ++---------------------- src/swig-0_27_4/properties_wrap.cxx | 191 ++---------------------- src/swig-0_28_0/properties_wrap.cxx | 217 ++-------------------------- 4 files changed, 55 insertions(+), 561 deletions(-) diff --git a/src/interface/properties.i b/src/interface/properties.i index af73e0cc..f010ccee 100644 --- a/src/interface/properties.i +++ b/src/interface/properties.i @@ -26,9 +26,23 @@ %import "datasets.i" %import "metadatum.i" -// Catch all C++ exceptions +// Catch all C++ exceptions... EXCEPTION(,) +// ...except these +%noexception Exiv2::XmpKey::~XmpKey; +%noexception Exiv2::XmpKey::familyName; +%noexception Exiv2::XmpKey::groupName; +%noexception Exiv2::XmpKey::key; +%noexception Exiv2::XmpKey::tag; +%noexception Exiv2::XmpKey::tagLabel; +%noexception Exiv2::XmpKey::tagName; +%noexception Exiv2::XmpProperties::prefix; +%noexception Exiv2::XmpProperties::propertyDesc; +%noexception Exiv2::XmpProperties::propertyInfo; +%noexception Exiv2::XmpProperties::propertyTitle; +%noexception Exiv2::XmpProperties::propertyType; + UNIQUE_PTR(Exiv2::XmpKey); // Make Xmp category more Pythonic @@ -112,6 +126,7 @@ static PyObject* struct_to_dict(const Exiv2::XmpNsInfo* info) { %ignore Exiv2::XmpNsInfo::Ns; // Ignore stuff Python can't use +%ignore Exiv2::XmpProperties::~XmpProperties; %ignore Exiv2::XmpProperties::lookupNsRegistry; %ignore Exiv2::XmpProperties::printProperties; %ignore Exiv2::XmpProperties::printProperty; diff --git a/src/swig-0_27_0/properties_wrap.cxx b/src/swig-0_27_0/properties_wrap.cxx index ba5a6150..a8beb0fd 100644 --- a/src/swig-0_27_0/properties_wrap.cxx +++ b/src/swig-0_27_0/properties_wrap.cxx @@ -4480,18 +4480,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyTitle(PyObject *self, PyObject SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyTitle" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4517,18 +4506,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyDesc(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyDesc" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4554,18 +4532,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyType(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyType" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); { resultobj = py_from_enum(result); if (!resultobj) @@ -4595,18 +4562,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyInfo(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyInfo" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); { resultobj = struct_to_dict(result); } @@ -4804,18 +4760,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_prefix(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5008,39 +4953,6 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registeredNamespaces(PyObject *self, Py } -SWIGINTERN PyObject *_wrap_delete_XmpProperties(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::XmpProperties *arg1 = (Exiv2::XmpProperties *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_XmpProperties", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__XmpProperties, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpProperties" "', argument " "1"" of type '" "Exiv2::XmpProperties *""'"); - } - arg1 = reinterpret_cast< Exiv2::XmpProperties * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_XmpProperties) /* defines _wrap_delete_XmpProperties_destructor_closure */ - SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5223,18 +5135,7 @@ SWIGINTERN PyObject *_wrap_delete_XmpKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpKey" "', argument " "1"" of type '" "Exiv2::XmpKey *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5255,18 +5156,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_key" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5287,18 +5177,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_familyName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5319,18 +5198,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_groupName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5351,18 +5219,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5383,18 +5240,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagLabel" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5415,18 +5261,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tag" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5659,7 +5494,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XmpProperties_type = { "exiv2.properties.XmpProperties", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_XmpProperties_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_27_4/properties_wrap.cxx b/src/swig-0_27_4/properties_wrap.cxx index ba5a6150..a8beb0fd 100644 --- a/src/swig-0_27_4/properties_wrap.cxx +++ b/src/swig-0_27_4/properties_wrap.cxx @@ -4480,18 +4480,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyTitle(PyObject *self, PyObject SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyTitle" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4517,18 +4506,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyDesc(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyDesc" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4554,18 +4532,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyType(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyType" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); { resultobj = py_from_enum(result); if (!resultobj) @@ -4595,18 +4562,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyInfo(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyInfo" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); { resultobj = struct_to_dict(result); } @@ -4804,18 +4760,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_prefix(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5008,39 +4953,6 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registeredNamespaces(PyObject *self, Py } -SWIGINTERN PyObject *_wrap_delete_XmpProperties(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::XmpProperties *arg1 = (Exiv2::XmpProperties *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_XmpProperties", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__XmpProperties, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpProperties" "', argument " "1"" of type '" "Exiv2::XmpProperties *""'"); - } - arg1 = reinterpret_cast< Exiv2::XmpProperties * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_XmpProperties) /* defines _wrap_delete_XmpProperties_destructor_closure */ - SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5223,18 +5135,7 @@ SWIGINTERN PyObject *_wrap_delete_XmpKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpKey" "', argument " "1"" of type '" "Exiv2::XmpKey *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5255,18 +5156,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_key" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5287,18 +5177,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_familyName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5319,18 +5198,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_groupName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5351,18 +5219,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5383,18 +5240,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagLabel" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5415,18 +5261,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tag" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5659,7 +5494,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XmpProperties_type = { "exiv2.properties.XmpProperties", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_XmpProperties_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_28_0/properties_wrap.cxx b/src/swig-0_28_0/properties_wrap.cxx index 098682c7..9ab052c0 100644 --- a/src/swig-0_28_0/properties_wrap.cxx +++ b/src/swig-0_28_0/properties_wrap.cxx @@ -4480,20 +4480,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyTitle(PyObject *self, PyObject SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyTitle" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyTitle((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4519,20 +4506,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyDesc(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyDesc" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::XmpProperties::propertyDesc((Exiv2::XmpKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4558,20 +4532,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyType(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyType" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)Exiv2::XmpProperties::propertyType((Exiv2::XmpKey const &)*arg1); { resultobj = py_from_enum(result); if (!resultobj) @@ -4601,20 +4562,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyInfo(PyObject *self, PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "XmpProperties_propertyInfo" "', argument " "1"" of type '" "Exiv2::XmpKey const &""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyInfo((Exiv2::XmpKey const &)*arg1); { resultobj = struct_to_dict(result); } @@ -4820,20 +4768,7 @@ SWIGINTERN PyObject *_wrap_XmpProperties_prefix(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = Exiv2::XmpProperties::prefix((std::string const &)*arg1); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5061,41 +4996,6 @@ SWIGINTERN int _wrap_new_XmpProperties(PyObject *self, PyObject *args, PyObject } -SWIGINTERN PyObject *_wrap_delete_XmpProperties(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::XmpProperties *arg1 = (Exiv2::XmpProperties *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_XmpProperties", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__XmpProperties, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpProperties" "', argument " "1"" of type '" "Exiv2::XmpProperties *""'"); - } - arg1 = reinterpret_cast< Exiv2::XmpProperties * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_XmpProperties) /* defines _wrap_delete_XmpProperties_destructor_closure */ - SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5284,20 +5184,7 @@ SWIGINTERN PyObject *_wrap_delete_XmpKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmpKey" "', argument " "1"" of type '" "Exiv2::XmpKey *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5318,20 +5205,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_key" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5352,20 +5226,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_familyName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::XmpKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5386,20 +5247,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_groupName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5420,20 +5268,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagName" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5454,20 +5289,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tagLabel" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::XmpKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5522,20 +5344,7 @@ SWIGINTERN PyObject *_wrap_XmpKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmpKey_tag" "', argument " "1"" of type '" "Exiv2::XmpKey const *""'"); } arg1 = reinterpret_cast< Exiv2::XmpKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::XmpKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5772,7 +5581,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__XmpProperties_type = { "exiv2.properties.XmpProperties", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_XmpProperties_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else From fe8e6e6a21796e9f3ac8b721be89473c8b0c4242 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 16:07:19 +0000 Subject: [PATCH 09/12] Remove unneeded exception handlers --- src/interface/tags.i | 7 +- src/swig-0_27_0/tags_wrap.cxx | 269 ++-------------------------- src/swig-0_27_4/tags_wrap.cxx | 269 ++-------------------------- src/swig-0_28_0/tags_wrap.cxx | 322 +++------------------------------- 4 files changed, 63 insertions(+), 804 deletions(-) diff --git a/src/interface/tags.i b/src/interface/tags.i index 3558b612..ac7f4266 100644 --- a/src/interface/tags.i +++ b/src/interface/tags.i @@ -27,8 +27,10 @@ %import "metadatum.i"; -// Catch all C++ exceptions -EXCEPTION(,) +// Catch some C++ exceptions +%exception; +EXCEPTION(Exiv2::ExifKey::ExifKey,) +EXCEPTION(Exiv2::ExifKey::clone,) UNIQUE_PTR(Exiv2::ExifKey); @@ -191,6 +193,7 @@ public: %ignore Exiv2::TagInfo; // Ignore stuff that Python can't use +%ignore Exiv2::ExifTags::~ExifTags; %ignore Exiv2::ExifTags::taglist; // Ignore unneeded key constructor diff --git a/src/swig-0_27_0/tags_wrap.cxx b/src/swig-0_27_0/tags_wrap.cxx index 4fec3abb..4ca2087e 100644 --- a/src/swig-0_27_0/tags_wrap.cxx +++ b/src/swig-0_27_0/tags_wrap.cxx @@ -4805,18 +4805,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_groupList(PyObject *self, PyObject *args) { Exiv2::GroupInfo *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "ExifTags_groupList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4846,18 +4835,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_tagList(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4887,18 +4865,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_sectionName(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_sectionName" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4924,18 +4891,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_defaultCount(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_defaultCount" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -4963,18 +4919,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_ifdName(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5004,18 +4949,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isMakerGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5045,18 +4979,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isExifGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5066,39 +4989,6 @@ SWIGINTERN PyObject *_wrap_ExifTags_isExifGroup(PyObject *self, PyObject *args) } -SWIGINTERN PyObject *_wrap_delete_ExifTags(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::ExifTags *arg1 = (Exiv2::ExifTags *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_ExifTags", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__ExifTags, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifTags" "', argument " "1"" of type '" "Exiv2::ExifTags *""'"); - } - arg1 = reinterpret_cast< Exiv2::ExifTags * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_ExifTags) /* defines _wrap_delete_ExifTags_destructor_closure */ - SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5274,18 +5164,7 @@ SWIGINTERN PyObject *_wrap_delete_ExifKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifKey" "', argument " "1"" of type '" "Exiv2::ExifKey *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5315,18 +5194,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_setIdx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ExifKey_setIdx" "', argument " "2"" of type '" "int""'"); } arg2 = static_cast< int >(val2); - { - try { - (arg1)->setIdx(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + (arg1)->setIdx(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5347,18 +5215,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_key" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5379,18 +5236,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_familyName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5411,18 +5257,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_groupName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5443,18 +5278,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5475,18 +5299,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tag" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5507,18 +5320,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagLabel" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5539,18 +5341,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagDesc(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagDesc" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5571,18 +5362,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_defaultTypeId(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_defaultTypeId" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5641,18 +5421,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_idx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_idx" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (int)((Exiv2::ExifKey const *)arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (int)((Exiv2::ExifKey const *)arg1)->idx(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -5954,7 +5723,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ExifTags_type = { "exiv2.tags.ExifTags", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_ExifTags_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_27_4/tags_wrap.cxx b/src/swig-0_27_4/tags_wrap.cxx index 4fec3abb..4ca2087e 100644 --- a/src/swig-0_27_4/tags_wrap.cxx +++ b/src/swig-0_27_4/tags_wrap.cxx @@ -4805,18 +4805,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_groupList(PyObject *self, PyObject *args) { Exiv2::GroupInfo *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "ExifTags_groupList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4846,18 +4835,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_tagList(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4887,18 +4865,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_sectionName(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_sectionName" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -4924,18 +4891,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_defaultCount(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_defaultCount" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -4963,18 +4919,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_ifdName(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5004,18 +4949,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isMakerGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5045,18 +4979,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isExifGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5066,39 +4989,6 @@ SWIGINTERN PyObject *_wrap_ExifTags_isExifGroup(PyObject *self, PyObject *args) } -SWIGINTERN PyObject *_wrap_delete_ExifTags(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::ExifTags *arg1 = (Exiv2::ExifTags *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_ExifTags", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__ExifTags, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifTags" "', argument " "1"" of type '" "Exiv2::ExifTags *""'"); - } - arg1 = reinterpret_cast< Exiv2::ExifTags * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_ExifTags) /* defines _wrap_delete_ExifTags_destructor_closure */ - SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5274,18 +5164,7 @@ SWIGINTERN PyObject *_wrap_delete_ExifKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifKey" "', argument " "1"" of type '" "Exiv2::ExifKey *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5315,18 +5194,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_setIdx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ExifKey_setIdx" "', argument " "2"" of type '" "int""'"); } arg2 = static_cast< int >(val2); - { - try { - (arg1)->setIdx(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + (arg1)->setIdx(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5347,18 +5215,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_key" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5379,18 +5236,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_familyName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5411,18 +5257,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_groupName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5443,18 +5278,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5475,18 +5299,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tag" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5507,18 +5320,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagLabel" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5539,18 +5341,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagDesc(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagDesc" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5571,18 +5362,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_defaultTypeId(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_defaultTypeId" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5641,18 +5421,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_idx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_idx" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (int)((Exiv2::ExifKey const *)arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (int)((Exiv2::ExifKey const *)arg1)->idx(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -5954,7 +5723,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ExifTags_type = { "exiv2.tags.ExifTags", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_ExifTags_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else diff --git a/src/swig-0_28_0/tags_wrap.cxx b/src/swig-0_28_0/tags_wrap.cxx index f7a4750e..7628f546 100644 --- a/src/swig-0_28_0/tags_wrap.cxx +++ b/src/swig-0_28_0/tags_wrap.cxx @@ -4915,20 +4915,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_groupList(PyObject *self, PyObject *args) { Exiv2::GroupInfo *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "ExifTags_groupList", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::GroupInfo *)Exiv2::ExifTags::groupList(); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -4958,20 +4945,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_tagList(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TagInfo *)Exiv2::ExifTags::tagList((std::string const &)*arg1); { resultobj = SWIG_Python_AppendOutput(resultobj, pointer_to_list(result)); } @@ -5001,20 +4975,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_sectionName(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_sectionName" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::sectionName((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5040,20 +5001,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_defaultCount(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ExifTags_defaultCount" "', argument " "1"" of type '" "Exiv2::ExifKey const &""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)Exiv2::ExifTags::defaultCount((Exiv2::ExifKey const &)*arg1); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5081,20 +5029,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_ifdName(PyObject *self, PyObject *args) { } arg1 = ptr; } - { - try { - result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)Exiv2::ExifTags::ifdName((std::string const &)*arg1); resultobj = SWIG_FromCharPtr((const char *)result); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5124,20 +5059,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isMakerGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isMakerGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5167,20 +5089,7 @@ SWIGINTERN PyObject *_wrap_ExifTags_isExifGroup(PyObject *self, PyObject *args) } arg1 = ptr; } - { - try { - result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (bool)Exiv2::ExifTags::isExifGroup((std::string const &)*arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; @@ -5196,20 +5105,7 @@ SWIGINTERN int _wrap_new_ExifTags(PyObject *self, PyObject *args, PyObject *kwar if (!SWIG_Python_CheckNoKeywords(kwargs, "new_ExifTags")) SWIG_fail; if (!SWIG_Python_UnpackTuple(args, "new_ExifTags", 0, 0, 0)) SWIG_fail; - { - try { - result = (Exiv2::ExifTags *)new Exiv2::ExifTags(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::ExifTags *)new Exiv2::ExifTags(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__ExifTags, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: @@ -5217,41 +5113,6 @@ SWIGINTERN int _wrap_new_ExifTags(PyObject *self, PyObject *args, PyObject *kwar } -SWIGINTERN PyObject *_wrap_delete_ExifTags(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - Exiv2::ExifTags *arg1 = (Exiv2::ExifTags *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if (!SWIG_Python_UnpackTuple(args, "delete_ExifTags", 0, 0, 0)) SWIG_fail; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Exiv2__ExifTags, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifTags" "', argument " "1"" of type '" "Exiv2::ExifTags *""'"); - } - arg1 = reinterpret_cast< Exiv2::ExifTags * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_ExifTags) /* defines _wrap_delete_ExifTags_destructor_closure */ - SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -5433,20 +5294,7 @@ SWIGINTERN PyObject *_wrap_delete_ExifKey(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExifKey" "', argument " "1"" of type '" "Exiv2::ExifKey *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5476,20 +5324,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_setIdx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ExifKey_setIdx" "', argument " "2"" of type '" "int""'"); } arg2 = static_cast< int >(val2); - { - try { - ((Exiv2::ExifKey const *)arg1)->setIdx(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + ((Exiv2::ExifKey const *)arg1)->setIdx(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -5510,20 +5345,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_key(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_key" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->key(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5544,20 +5366,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_familyName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_familyName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (char *)((Exiv2::ExifKey const *)arg1)->familyName(); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -5578,20 +5387,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_groupName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_groupName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->groupName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5612,20 +5408,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagName(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagName" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagName(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5646,20 +5429,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tag(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tag" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (uint16_t)((Exiv2::ExifKey const *)arg1)->tag(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: @@ -5680,20 +5450,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagLabel(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagLabel" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagLabel(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5714,20 +5471,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_tagDesc(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_tagDesc" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = ((Exiv2::ExifKey const *)arg1)->tagDesc(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: @@ -5748,20 +5492,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_defaultTypeId(PyObject *self, PyObject *args) SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_defaultTypeId" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (Exiv2::TypeId)((Exiv2::ExifKey const *)arg1)->defaultTypeId(); { resultobj = py_from_enum(result); if (!resultobj) @@ -5822,20 +5553,7 @@ SWIGINTERN PyObject *_wrap_ExifKey_idx(PyObject *self, PyObject *args) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExifKey_idx" "', argument " "1"" of type '" "Exiv2::ExifKey const *""'"); } arg1 = reinterpret_cast< Exiv2::ExifKey * >(argp1); - { - try { - result = (int)((Exiv2::ExifKey const *)arg1)->idx(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); - SWIG_fail; - } - } + result = (int)((Exiv2::ExifKey const *)arg1)->idx(); resultobj = SWIG_From_int(static_cast< int >(result)); return resultobj; fail: @@ -6137,7 +5855,7 @@ static PyHeapTypeObject SwigPyBuiltin__Exiv2__ExifTags_type = { "exiv2.tags.ExifTags", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - _wrap_delete_ExifTags_destructor_closure, /* tp_dealloc */ + SwigPyBuiltin_BadDealloc, /* tp_dealloc */ #if PY_VERSION_HEX < 0x030800b4 (printfunc) 0, /* tp_print */ #else From b67459ce0055b8c1c3f5df8ce900c3a0d9b31ba8 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Thu, 11 Jan 2024 17:33:07 +0000 Subject: [PATCH 10/12] Simplified and improved exception handler --- src/interface/basicio.i | 2 +- src/interface/datasets.i | 8 +- src/interface/easyaccess.i | 2 +- src/interface/exif.i | 2 +- src/interface/image.i | 2 +- src/interface/iptc.i | 2 +- src/interface/metadatum.i | 2 +- src/interface/preview.i | 2 +- src/interface/properties.i | 2 +- src/interface/shared/exception.i | 38 +- src/interface/tags.i | 4 +- src/interface/types.i | 2 +- src/interface/value.i | 2 +- src/interface/version.i | 2 +- src/interface/xmp.i | 2 +- src/swig-0_27_0/basicio_wrap.cxx | 537 ++-- src/swig-0_27_0/datasets_wrap.cxx | 60 +- src/swig-0_27_0/easyaccess_wrap.cxx | 231 +- src/swig-0_27_0/exif_wrap.cxx | 915 +++---- src/swig-0_27_0/image_wrap.cxx | 474 ++-- src/swig-0_27_0/iptc_wrap.cxx | 771 ++---- src/swig-0_27_0/metadatum_wrap.cxx | 366 +-- src/swig-0_27_0/preview_wrap.cxx | 123 +- src/swig-0_27_0/properties_wrap.cxx | 150 +- src/swig-0_27_0/tags_wrap.cxx | 69 +- src/swig-0_27_0/types_wrap.cxx | 222 +- src/swig-0_27_0/value_wrap.cxx | 2832 +++++++------------- src/swig-0_27_0/version_wrap.cxx | 87 +- src/swig-0_27_0/xmp_wrap.cxx | 789 ++---- src/swig-0_27_4/basicio_wrap.cxx | 537 ++-- src/swig-0_27_4/datasets_wrap.cxx | 60 +- src/swig-0_27_4/easyaccess_wrap.cxx | 339 +-- src/swig-0_27_4/exif_wrap.cxx | 915 +++---- src/swig-0_27_4/image_wrap.cxx | 474 ++-- src/swig-0_27_4/iptc_wrap.cxx | 771 ++---- src/swig-0_27_4/metadatum_wrap.cxx | 366 +-- src/swig-0_27_4/preview_wrap.cxx | 123 +- src/swig-0_27_4/properties_wrap.cxx | 150 +- src/swig-0_27_4/tags_wrap.cxx | 69 +- src/swig-0_27_4/types_wrap.cxx | 222 +- src/swig-0_27_4/value_wrap.cxx | 2832 +++++++------------- src/swig-0_27_4/version_wrap.cxx | 87 +- src/swig-0_27_4/xmp_wrap.cxx | 789 ++---- src/swig-0_28_0/basicio_wrap.cxx | 671 ++--- src/swig-0_28_0/datasets_wrap.cxx | 66 +- src/swig-0_28_0/easyaccess_wrap.cxx | 407 +-- src/swig-0_28_0/exif_wrap.cxx | 1155 +++----- src/swig-0_28_0/image_wrap.cxx | 583 ++-- src/swig-0_28_0/iptc_wrap.cxx | 979 ++----- src/swig-0_28_0/metadatum_wrap.cxx | 484 ++-- src/swig-0_28_0/preview_wrap.cxx | 143 +- src/swig-0_28_0/properties_wrap.cxx | 198 +- src/swig-0_28_0/tags_wrap.cxx | 77 +- src/swig-0_28_0/types_wrap.cxx | 286 +- src/swig-0_28_0/value_wrap.cxx | 3806 ++++++++------------------- src/swig-0_28_0/version_wrap.cxx | 99 +- src/swig-0_28_0/xmp_wrap.cxx | 1001 +++---- 57 files changed, 8831 insertions(+), 16558 deletions(-) diff --git a/src/interface/basicio.i b/src/interface/basicio.i index 1f06ff3f..703087b7 100644 --- a/src/interface/basicio.i +++ b/src/interface/basicio.i @@ -33,7 +33,7 @@ %import "types.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() UNIQUE_PTR(Exiv2::BasicIo); diff --git a/src/interface/datasets.i b/src/interface/datasets.i index f0c84250..ccad4c92 100644 --- a/src/interface/datasets.i +++ b/src/interface/datasets.i @@ -26,10 +26,10 @@ // Catch some C++ exceptions %exception; -EXCEPTION(Exiv2::IptcDataSets::dataSet,) -EXCEPTION(Exiv2::IptcDataSets::recordId,) -EXCEPTION(Exiv2::IptcKey::IptcKey(std::string),) -EXCEPTION(Exiv2::IptcKey::IptcKey(std::string const &),) +EXCEPTION(Exiv2::IptcDataSets::dataSet) +EXCEPTION(Exiv2::IptcDataSets::recordId) +EXCEPTION(Exiv2::IptcKey::IptcKey(std::string)) +EXCEPTION(Exiv2::IptcKey::IptcKey(std::string const &)) UNIQUE_PTR(Exiv2::IptcKey); diff --git a/src/interface/easyaccess.i b/src/interface/easyaccess.i index 0208ac98..275cfae6 100644 --- a/src/interface/easyaccess.i +++ b/src/interface/easyaccess.i @@ -21,7 +21,7 @@ %include "shared/exception.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() // Store data.end() after converting input %typemap(check) Exiv2::ExifData& (Exiv2::ExifData::const_iterator _global_end) %{ diff --git a/src/interface/exif.i b/src/interface/exif.i index 8488adb5..1632f6e1 100644 --- a/src/interface/exif.i +++ b/src/interface/exif.i @@ -32,7 +32,7 @@ %import "tags.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() // ExifThumb keeps a reference to the ExifData it uses KEEP_REFERENCE_EX(Exiv2::ExifThumb*, swig_obj[0]) diff --git a/src/interface/image.i b/src/interface/image.i index 895a5c42..724093de 100644 --- a/src/interface/image.i +++ b/src/interface/image.i @@ -36,7 +36,7 @@ %import "xmp.i"; // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() UNIQUE_PTR(Exiv2::Image); diff --git a/src/interface/iptc.i b/src/interface/iptc.i index cd74f933..6f71fb6a 100644 --- a/src/interface/iptc.i +++ b/src/interface/iptc.i @@ -29,7 +29,7 @@ %import "metadatum.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() EXTEND_METADATUM(Exiv2::Iptcdatum) diff --git a/src/interface/metadatum.i b/src/interface/metadatum.i index c6b5a77e..3293c637 100644 --- a/src/interface/metadatum.i +++ b/src/interface/metadatum.i @@ -30,7 +30,7 @@ %import "value.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() UNIQUE_PTR(Exiv2::Key); diff --git a/src/interface/preview.i b/src/interface/preview.i index 22e031a2..90781480 100644 --- a/src/interface/preview.i +++ b/src/interface/preview.i @@ -33,7 +33,7 @@ %import "types.i"; // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() // Some calls don't raise exceptions %noexception Exiv2::PreviewImage::__len__; diff --git a/src/interface/properties.i b/src/interface/properties.i index f010ccee..8d667832 100644 --- a/src/interface/properties.i +++ b/src/interface/properties.i @@ -27,7 +27,7 @@ %import "metadatum.i" // Catch all C++ exceptions... -EXCEPTION(,) +EXCEPTION() // ...except these %noexception Exiv2::XmpKey::~XmpKey; diff --git a/src/interface/shared/exception.i b/src/interface/shared/exception.i index d8a48534..a5d6157b 100644 --- a/src/interface/shared/exception.i +++ b/src/interface/shared/exception.i @@ -17,11 +17,13 @@ %include "shared/fragments.i" +%include "exception.i" + // Import PyExc_Exiv2Error exception %fragment("_import_exception_decl", "header") { static PyObject* PyExc_Exiv2Error = NULL; } -%fragment("import_exception", "init", fragment="_import_exception_decl", +%fragment("_import_exception", "init", fragment="_import_exception_decl", fragment="import_exiv2") { { PyExc_Exiv2Error = PyObject_GetAttrString(exiv2_module, "Exiv2Error"); @@ -30,22 +32,34 @@ static PyObject* PyExc_Exiv2Error = NULL; } } -// Macro to define %exception directives -%define EXCEPTION(method, precheck) -%fragment("import_exception"); -%exception method { -precheck +// Function that re-raises an exception to handle different types +%fragment("_set_python_exception", "header", fragment="_import_exception") { +static void _set_python_exception() { try { - $action + throw; + } #if EXIV2_VERSION_HEX < 0x001c0000 - } catch(Exiv2::AnyError const& e) { + catch(Exiv2::AnyError const& e) { #else - } catch(Exiv2::Error const& e) { + catch(Exiv2::Error const& e) { #endif PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + SWIG_CATCH_STDEXCEPT +fail: + return; +}; +} + +// Macro to define %exception directives +%define EXCEPTION(method) +%fragment("_set_python_exception"); +%exception method { + try { + $action + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/interface/tags.i b/src/interface/tags.i index ac7f4266..964e6f91 100644 --- a/src/interface/tags.i +++ b/src/interface/tags.i @@ -29,8 +29,8 @@ // Catch some C++ exceptions %exception; -EXCEPTION(Exiv2::ExifKey::ExifKey,) -EXCEPTION(Exiv2::ExifKey::clone,) +EXCEPTION(Exiv2::ExifKey::ExifKey) +EXCEPTION(Exiv2::ExifKey::clone) UNIQUE_PTR(Exiv2::ExifKey); diff --git a/src/interface/types.i b/src/interface/types.i index fb823920..0c57ce79 100644 --- a/src/interface/types.i +++ b/src/interface/types.i @@ -27,7 +27,7 @@ %include "std_string.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() // Some calls don't raise exceptions %noexception Exiv2::DataBuf::data; diff --git a/src/interface/value.i b/src/interface/value.i index 7bc25bc8..2f607914 100644 --- a/src/interface/value.i +++ b/src/interface/value.i @@ -37,7 +37,7 @@ %import "types.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() UNIQUE_PTR(Exiv2::Value); diff --git a/src/interface/version.i b/src/interface/version.i index 4ad4061f..bac15925 100644 --- a/src/interface/version.i +++ b/src/interface/version.i @@ -24,7 +24,7 @@ %include "std_string.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() // Function to report build options used %feature("docstring") versionInfo "Return a dict of libexiv2 build options." diff --git a/src/interface/xmp.i b/src/interface/xmp.i index d2e1617c..3d7caf9e 100644 --- a/src/interface/xmp.i +++ b/src/interface/xmp.i @@ -29,7 +29,7 @@ %import "properties.i" // Catch all C++ exceptions -EXCEPTION(,) +EXCEPTION() EXTEND_METADATUM(Exiv2::Xmpdatum) diff --git a/src/swig-0_27_0/basicio_wrap.cxx b/src/swig-0_27_0/basicio_wrap.cxx index 5fd93adf..0c6e713e 100644 --- a/src/swig-0_27_0/basicio_wrap.cxx +++ b/src/swig-0_27_0/basicio_wrap.cxx @@ -4128,6 +4128,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static int Exiv2_BasicIo_getbuff( PyObject* exporter, Py_buffer* view, int flags) { Exiv2::BasicIo* self = 0; @@ -4803,12 +4836,9 @@ SWIGINTERN PyObject *_wrap_delete_BasicIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4839,12 +4869,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4875,12 +4902,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4926,12 +4950,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_0(PyObject *self, PyObject *args) result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4980,12 +5001,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5063,12 +5081,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5108,12 +5123,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5175,12 +5187,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5252,12 +5261,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5299,12 +5305,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5358,12 +5361,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5408,12 +5408,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5450,12 +5447,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5482,12 +5476,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_tell(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::BasicIo const *)arg1)->tell(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5514,12 +5505,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_size(PyObject *self, PyObject *args) { { try { result = ((Exiv2::BasicIo const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5651,12 +5639,9 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs { try { result = (Exiv2::FileIo *)new Exiv2::FileIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5684,12 +5669,9 @@ SWIGINTERN PyObject *_wrap_delete_FileIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5734,12 +5716,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_0(PyObject *self, PyObject *args) { result = (int)(arg1)->open((std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5772,12 +5751,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_1(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5843,12 +5819,9 @@ SWIGINTERN PyObject *_wrap_FileIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5894,12 +5867,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_0(PyObject *self, PyObject *args) result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5948,12 +5918,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6031,12 +5998,9 @@ SWIGINTERN PyObject *_wrap_FileIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6076,12 +6040,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_0(PyObject *self, PyObject *args) { result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6143,12 +6104,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_1(PyObject *self, PyObject *args) { result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6220,12 +6178,9 @@ SWIGINTERN PyObject *_wrap_FileIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6267,12 +6222,9 @@ SWIGINTERN PyObject *_wrap_FileIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6326,12 +6278,9 @@ SWIGINTERN PyObject *_wrap_FileIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6376,12 +6325,9 @@ SWIGINTERN PyObject *_wrap_FileIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6418,12 +6364,9 @@ SWIGINTERN PyObject *_wrap_FileIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6468,12 +6411,9 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { { try { (arg1)->setPath((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6506,12 +6446,9 @@ SWIGINTERN PyObject *_wrap_FileIo_tell(PyObject *self, PyObject *args) { result = (long)((Exiv2::FileIo const *)arg1)->tell(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6542,12 +6479,9 @@ SWIGINTERN PyObject *_wrap_FileIo_size(PyObject *self, PyObject *args) { result = ((Exiv2::FileIo const *)arg1)->size(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6660,12 +6594,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6700,12 +6631,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo((Exiv2::byte const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6779,12 +6707,9 @@ SWIGINTERN PyObject *_wrap_delete_MemIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6987,12 +6912,9 @@ SWIGINTERN PyObject *_wrap_MemIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7154,12 +7076,9 @@ SWIGINTERN PyObject *_wrap_MemIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7201,12 +7120,9 @@ SWIGINTERN PyObject *_wrap_MemIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7484,12 +7400,9 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XPathIo *)new Exiv2::XPathIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7517,12 +7430,9 @@ SWIGINTERN PyObject *_wrap_delete_XPathIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7564,12 +7474,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7607,12 +7514,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg { try { result = Exiv2::XPathIo::writeDataToFile((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7642,12 +7546,9 @@ SWIGINTERN PyObject *_wrap_delete_RemoteIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7678,12 +7579,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7714,12 +7612,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7765,12 +7660,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_0(PyObject *self, PyObject *args result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7819,12 +7711,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_1(PyObject *self, PyObject *args result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7902,12 +7791,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7947,12 +7833,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8014,12 +7897,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8091,12 +7971,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8138,12 +8015,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8232,12 +8106,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8447,12 +8318,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8493,12 +8361,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/datasets_wrap.cxx b/src/swig-0_27_0/datasets_wrap.cxx index 46baccad..4bccfdfa 100644 --- a/src/swig-0_27_0/datasets_wrap.cxx +++ b/src/swig-0_27_0/datasets_wrap.cxx @@ -4136,6 +4136,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #define SWIG_From_long PyInt_FromLong @@ -4737,12 +4770,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSet(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::dataSet((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4858,12 +4888,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordId(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::recordId((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4927,12 +4954,9 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::IptcKey *)new Exiv2::IptcKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/easyaccess_wrap.cxx b/src/swig-0_27_0/easyaccess_wrap.cxx index 9a0fe78f..29aa0c81 100644 --- a/src/swig-0_27_0/easyaccess_wrap.cxx +++ b/src/swig-0_27_0/easyaccess_wrap.cxx @@ -4105,6 +4105,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; + +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + #ifdef __cplusplus extern "C" { #endif @@ -4133,12 +4166,9 @@ SWIGINTERN PyObject *_wrap_orientation(PyObject *self, PyObject *args) { { try { result = Exiv2::orientation((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4180,12 +4210,9 @@ SWIGINTERN PyObject *_wrap_isoSpeed(PyObject *self, PyObject *args) { { try { result = Exiv2::isoSpeed((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4227,12 +4254,9 @@ SWIGINTERN PyObject *_wrap_flashBias(PyObject *self, PyObject *args) { { try { result = Exiv2::flashBias((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4274,12 +4298,9 @@ SWIGINTERN PyObject *_wrap_exposureMode(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4321,12 +4342,9 @@ SWIGINTERN PyObject *_wrap_sceneMode(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4368,12 +4386,9 @@ SWIGINTERN PyObject *_wrap_macroMode(PyObject *self, PyObject *args) { { try { result = Exiv2::macroMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4415,12 +4430,9 @@ SWIGINTERN PyObject *_wrap_imageQuality(PyObject *self, PyObject *args) { { try { result = Exiv2::imageQuality((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4462,12 +4474,9 @@ SWIGINTERN PyObject *_wrap_whiteBalance(PyObject *self, PyObject *args) { { try { result = Exiv2::whiteBalance((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4509,12 +4518,9 @@ SWIGINTERN PyObject *_wrap_lensName(PyObject *self, PyObject *args) { { try { result = Exiv2::lensName((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4556,12 +4562,9 @@ SWIGINTERN PyObject *_wrap_saturation(PyObject *self, PyObject *args) { { try { result = Exiv2::saturation((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4603,12 +4606,9 @@ SWIGINTERN PyObject *_wrap_sharpness(PyObject *self, PyObject *args) { { try { result = Exiv2::sharpness((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4650,12 +4650,9 @@ SWIGINTERN PyObject *_wrap_contrast(PyObject *self, PyObject *args) { { try { result = Exiv2::contrast((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4697,12 +4694,9 @@ SWIGINTERN PyObject *_wrap_sceneCaptureType(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneCaptureType((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4744,12 +4738,9 @@ SWIGINTERN PyObject *_wrap_meteringMode(PyObject *self, PyObject *args) { { try { result = Exiv2::meteringMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4791,12 +4782,9 @@ SWIGINTERN PyObject *_wrap_make(PyObject *self, PyObject *args) { { try { result = Exiv2::make((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4838,12 +4826,9 @@ SWIGINTERN PyObject *_wrap_model(PyObject *self, PyObject *args) { { try { result = Exiv2::model((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4885,12 +4870,9 @@ SWIGINTERN PyObject *_wrap_exposureTime(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureTime((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4932,12 +4914,9 @@ SWIGINTERN PyObject *_wrap_fNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::fNumber((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4979,12 +4958,9 @@ SWIGINTERN PyObject *_wrap_subjectDistance(PyObject *self, PyObject *args) { { try { result = Exiv2::subjectDistance((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5026,12 +5002,9 @@ SWIGINTERN PyObject *_wrap_serialNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::serialNumber((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5073,12 +5046,9 @@ SWIGINTERN PyObject *_wrap_focalLength(PyObject *self, PyObject *args) { { try { result = Exiv2::focalLength((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5120,12 +5090,9 @@ SWIGINTERN PyObject *_wrap_afPoint(PyObject *self, PyObject *args) { { try { result = Exiv2::afPoint((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/exif_wrap.cxx b/src/swig-0_27_0/exif_wrap.cxx index ebb334e4..c518e4d4 100644 --- a/src/swig-0_27_0/exif_wrap.cxx +++ b/src/swig-0_27_0/exif_wrap.cxx @@ -4150,6 +4150,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class ExifData_iterator_base { protected: @@ -5518,12 +5551,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5549,12 +5579,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5589,12 +5616,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Exifdatum *)((ExifData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5620,12 +5644,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5659,12 +5680,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5704,12 +5722,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5740,12 +5755,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5848,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setDataArea(PyObject *self, PyObjec { try { result = (int)(*arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5874,12 +5883,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5906,12 +5912,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5938,12 +5941,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5970,12 +5970,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6002,12 +5999,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6034,12 +6028,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6066,12 +6057,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_ifdName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->ifdName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6098,12 +6086,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_idx(PyObject *self, PyObject *args) { try { result = (int)(*arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6163,12 +6148,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6205,12 +6187,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6241,12 +6220,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6273,12 +6249,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeSize(PyObject *self, PyObject * { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6347,12 +6320,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6387,12 +6357,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6456,12 +6423,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toLong__SWIG_0(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6488,12 +6452,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toLong__SWIG_1(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6557,12 +6518,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6589,12 +6547,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6658,12 +6613,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6690,12 +6642,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6751,12 +6700,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6805,12 +6751,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Exifdatum_getValue__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6875,12 +6818,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6927,12 +6867,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6995,12 +6932,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_sizeDataArea(PyObject *self, PyObje { try { result = (long)(*arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7027,12 +6961,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_dataArea(PyObject *self, PyObject * { try { result = (*arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7070,12 +7001,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7102,12 +7030,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7176,12 +7101,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7211,12 +7133,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7246,12 +7165,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::Exifdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7319,12 +7235,9 @@ SWIGINTERN PyObject *_wrap_delete_Exifdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7358,12 +7271,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7403,12 +7313,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7453,12 +7360,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setDataArea(PyObject *self, PyObject *args) { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7491,12 +7395,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7523,12 +7424,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7555,12 +7453,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7587,12 +7482,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7619,12 +7511,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7651,12 +7540,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Exifdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7683,12 +7569,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_ifdName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->ifdName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7715,12 +7598,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_idx(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Exifdatum const *)arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7780,12 +7660,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Exifdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7822,12 +7699,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Exifdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7858,12 +7732,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7890,12 +7761,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Exifdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7964,12 +7832,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8004,12 +7869,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8073,12 +7935,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Exifdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8105,12 +7964,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Exifdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8174,12 +8030,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8206,12 +8059,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8275,12 +8125,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8307,12 +8154,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8368,12 +8212,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8409,12 +8250,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Exifdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8448,12 +8286,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_sizeDataArea(PyObject *self, PyObject *args { try { result = (long)((Exiv2::Exifdatum const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8480,12 +8315,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8528,12 +8360,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Exifdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8611,12 +8440,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8681,12 +8507,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8768,12 +8591,9 @@ SWIGINTERN int _wrap_new_ExifThumbC(PyObject *self, PyObject *args, PyObject *kw { try { result = (Exiv2::ExifThumbC *)new Exiv2::ExifThumbC((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8800,12 +8620,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifThumbC const *)arg1)->copy(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8855,12 +8672,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) { try { result = (long)((Exiv2::ExifThumbC const *)arg1)->writeFile((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8889,12 +8703,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_mimeType(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->mimeType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8921,12 +8732,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_extension(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->extension(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8952,12 +8760,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumbC(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8991,12 +8796,9 @@ SWIGINTERN int _wrap_new_ExifThumb(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::ExifThumb *)new Exiv2::ExifThumb(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9074,12 +8876,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2,arg3,arg4,arg5); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9149,12 +8948,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_1(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3,arg4,arg5,arg6); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9204,12 +9000,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9251,12 +9044,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_3(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9343,12 +9133,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_erase(PyObject *self, PyObject *args) { { try { (arg1)->erase(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9374,12 +9161,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumb(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9426,12 +9210,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::ExifKey const &)*arg2,(Exiv2::Value const *)arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9468,12 +9249,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::Exifdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9543,12 +9321,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9612,12 +9387,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9701,12 +9473,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9732,12 +9501,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9837,12 +9603,9 @@ SWIGINTERN PyObject *_wrap_ExifData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::ExifKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9935,12 +9698,9 @@ SWIGINTERN PyObject *_wrap_ExifData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Exifdatum *) &Exiv2_ExifData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9995,12 +9755,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10055,12 +9812,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10106,12 +9860,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10153,12 +9904,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10256,12 +10004,9 @@ SWIGINTERN PyObject *_wrap_ExifData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_ExifData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10283,12 +10028,9 @@ SWIGINTERN int _wrap_new_ExifData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::ExifData *)new Exiv2::ExifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10314,12 +10056,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/image_wrap.cxx b/src/swig-0_27_0/image_wrap.cxx index 0fde11d9..a21bbc95 100644 --- a/src/swig-0_27_0/image_wrap.cxx +++ b/src/swig-0_27_0/image_wrap.cxx @@ -4162,6 +4162,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static bool enableBMFF(bool enable) { #ifdef EXV_ENABLE_BMFF return Exiv2::enableBMFF(enable); @@ -4756,12 +4789,9 @@ SWIGINTERN PyObject *_wrap_enableBMFF(PyObject *self, PyObject *args) { { try { result = (bool)enableBMFF(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4787,12 +4817,9 @@ SWIGINTERN PyObject *_wrap_delete_Image(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4822,12 +4849,9 @@ SWIGINTERN PyObject *_wrap_Image_readMetadata(PyObject *self, PyObject *args) { (arg1)->readMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4857,12 +4881,9 @@ SWIGINTERN PyObject *_wrap_Image_writeMetadata(PyObject *self, PyObject *args) { (arg1)->writeMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4906,12 +4927,9 @@ SWIGINTERN PyObject *_wrap_Image_setExifData(PyObject *self, PyObject *args) { { try { (arg1)->setExifData((Exiv2::ExifData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4937,12 +4955,9 @@ SWIGINTERN PyObject *_wrap_Image_clearExifData(PyObject *self, PyObject *args) { { try { (arg1)->clearExifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4981,12 +4996,9 @@ SWIGINTERN PyObject *_wrap_Image_setIptcData(PyObject *self, PyObject *args) { { try { (arg1)->setIptcData((Exiv2::IptcData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5012,12 +5024,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIptcData(PyObject *self, PyObject *args) { { try { (arg1)->clearIptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5058,12 +5067,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpPacket(PyObject *self, PyObject *args) { { try { (arg1)->setXmpPacket((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5091,12 +5097,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpPacket(PyObject *self, PyObject *args) { try { (arg1)->clearXmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5135,12 +5138,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpData(PyObject *self, PyObject *args) { { try { (arg1)->setXmpData((Exiv2::XmpData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5166,12 +5166,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpData(PyObject *self, PyObject *args) { { try { (arg1)->clearXmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5212,12 +5209,9 @@ SWIGINTERN PyObject *_wrap_Image_setComment(PyObject *self, PyObject *args) { { try { (arg1)->setComment((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5245,12 +5239,9 @@ SWIGINTERN PyObject *_wrap_Image_clearComment(PyObject *self, PyObject *args) { { try { (arg1)->clearComment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5301,12 +5292,9 @@ SWIGINTERN PyObject *_wrap_Image_setIccProfile(PyObject *self, PyObject *args) { { try { (arg1)->setIccProfile(*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5332,12 +5320,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIccProfile(PyObject *self, PyObject *args) { try { (arg1)->clearIccProfile(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5364,12 +5349,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfileDefined(PyObject *self, PyObject *arg { try { result = (bool)(arg1)->iccProfileDefined(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5396,12 +5378,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfile(PyObject *self, PyObject *args) { { try { result = (Exiv2::DataBuf *)(arg1)->iccProfile(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5445,12 +5424,9 @@ SWIGINTERN PyObject *_wrap_Image_setMetadata(PyObject *self, PyObject *args) { { try { (arg1)->setMetadata((Exiv2::Image const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5476,12 +5452,9 @@ SWIGINTERN PyObject *_wrap_Image_clearMetadata(PyObject *self, PyObject *args) { { try { (arg1)->clearMetadata(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5508,12 +5481,9 @@ SWIGINTERN PyObject *_wrap_Image_exifData(PyObject *self, PyObject *args) { { try { result = (Exiv2::ExifData *) &(arg1)->exifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5545,12 +5515,9 @@ SWIGINTERN PyObject *_wrap_Image_iptcData(PyObject *self, PyObject *args) { { try { result = (Exiv2::IptcData *) &(arg1)->iptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5582,12 +5549,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpData(PyObject *self, PyObject *args) { { try { result = (Exiv2::XmpData *) &(arg1)->xmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5619,12 +5583,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &(arg1)->xmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5658,12 +5619,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_0(PyObject *self, Py_s { try { (arg1)->writeXmpFromPacket(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5704,12 +5662,9 @@ SWIGINTERN PyObject *_wrap_Image_setByteOrder(PyObject *self, PyObject *args) { { try { (arg1)->setByteOrder(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5736,12 +5691,9 @@ SWIGINTERN PyObject *_wrap_Image_byteOrder(PyObject *self, PyObject *args) { { try { result = (Exiv2::ByteOrder)((Exiv2::Image const *)arg1)->byteOrder(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5772,12 +5724,9 @@ SWIGINTERN PyObject *_wrap_Image_good(PyObject *self, PyObject *args) { { try { result = (bool)((Exiv2::Image const *)arg1)->good(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5804,12 +5753,9 @@ SWIGINTERN PyObject *_wrap_Image_mimeType(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->mimeType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5782,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelWidth(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->pixelWidth(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5868,12 +5811,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelHeight(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->pixelHeight(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5900,12 +5840,9 @@ SWIGINTERN PyObject *_wrap_Image_comment(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->comment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,12 +5869,9 @@ SWIGINTERN PyObject *_wrap_Image_io(PyObject *self, PyObject *args) { { try { result = (Exiv2::BasicIo *) &((Exiv2::Image const *)arg1)->io(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5984,12 +5918,9 @@ SWIGINTERN PyObject *_wrap_Image_checkMode(PyObject *self, PyObject *args) { { try { result = (Exiv2::AccessMode)((Exiv2::Image const *)arg1)->checkMode(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6035,12 +5966,9 @@ SWIGINTERN PyObject *_wrap_Image_supportsMetadata(PyObject *self, PyObject *args { try { result = (bool)((Exiv2::Image const *)arg1)->supportsMetadata(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6067,12 +5995,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_1(PyObject *self, Py_s { try { result = (bool)((Exiv2::Image const *)arg1)->writeXmpFromPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6144,12 +6069,9 @@ SWIGINTERN PyObject *_wrap_Image_setTypeSupported(PyObject *self, PyObject *args { try { (arg1)->setTypeSupported(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6176,12 +6098,9 @@ SWIGINTERN PyObject *_wrap_Image_imageType(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->imageType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6234,12 +6153,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) { try { result = Exiv2::ImageFactory::createIo((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6297,12 +6213,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((std::string const &)*arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6343,12 +6256,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_1(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((unsigned char const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6450,12 +6360,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1,(std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6490,12 +6397,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_1(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6563,12 +6467,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6603,12 +6504,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_1(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType((unsigned char const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6652,12 +6550,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_2(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6746,12 +6641,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkMode(PyObject *self, PyObject *args { try { result = (Exiv2::AccessMode)Exiv2::ImageFactory::checkMode(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6802,12 +6694,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkType(PyObject *self, PyObject *args { try { result = (bool)Exiv2::ImageFactory::checkType(arg1,*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6833,12 +6722,9 @@ SWIGINTERN PyObject *_wrap_delete_ImageFactory(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/iptc_wrap.cxx b/src/swig-0_27_0/iptc_wrap.cxx index ff907d6a..4dfe0607 100644 --- a/src/swig-0_27_0/iptc_wrap.cxx +++ b/src/swig-0_27_0/iptc_wrap.cxx @@ -4149,6 +4149,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class IptcData_iterator_base { protected: @@ -5427,12 +5460,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5458,12 +5488,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5498,12 +5525,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Iptcdatum *)((IptcData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5529,12 +5553,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5568,12 +5589,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5613,12 +5631,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5649,12 +5664,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5762,12 +5774,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5804,12 +5813,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5842,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_recordName(PyObject *self, PyObject { try { result = (*arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5868,12 +5871,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_record(PyObject *self, PyObject *ar { try { result = (uint16_t)(*arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5900,12 +5900,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,12 +5929,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5964,12 +5958,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5996,12 +5987,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6028,12 +6016,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6060,12 +6045,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6096,12 +6078,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6128,12 +6107,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeSize(PyObject *self, PyObject * { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6202,12 +6178,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6242,12 +6215,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6311,12 +6281,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toLong__SWIG_0(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6343,12 +6310,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toLong__SWIG_1(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6412,12 +6376,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6444,12 +6405,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6513,12 +6471,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6545,12 +6500,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6606,12 +6558,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6660,12 +6609,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Iptcdatum_getValue__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6730,12 +6676,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6782,12 +6725,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6858,12 +6798,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6890,12 +6827,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6964,12 +6898,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6999,12 +6930,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7034,12 +6962,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::Iptcdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7107,12 +7032,9 @@ SWIGINTERN PyObject *_wrap_delete_Iptcdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7146,12 +7068,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7191,12 +7110,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7258,12 +7174,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7300,12 +7213,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7332,12 +7242,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_recordName(PyObject *self, PyObject *args) { try { result = ((Exiv2::Iptcdatum const *)arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7364,12 +7271,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_record(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7396,12 +7300,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7428,12 +7329,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7460,12 +7358,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7492,12 +7387,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7524,12 +7416,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7556,12 +7445,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Iptcdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7592,12 +7478,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7624,12 +7507,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7698,12 +7578,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7738,12 +7615,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7807,12 +7681,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7839,12 +7710,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7908,12 +7776,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7940,12 +7805,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8009,12 +7871,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8041,12 +7900,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8102,12 +7958,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8143,12 +7996,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Iptcdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8195,12 +8045,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Iptcdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8278,12 +8125,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8348,12 +8192,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8449,12 +8290,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::IptcKey const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8492,12 +8330,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::Iptcdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8569,12 +8404,9 @@ SWIGINTERN PyObject *_wrap_IptcData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8629,12 +8461,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8660,12 +8489,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8765,12 +8591,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::IptcKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8822,12 +8645,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8871,12 +8691,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8983,12 +8800,9 @@ SWIGINTERN PyObject *_wrap_IptcData_size(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::IptcData const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9015,12 +8829,9 @@ SWIGINTERN PyObject *_wrap_IptcData_detectCharset(PyObject *self, PyObject *args { try { result = (char *)((Exiv2::IptcData const *)arg1)->detectCharset(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9062,12 +8873,9 @@ SWIGINTERN PyObject *_wrap_IptcData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Iptcdatum *) &Exiv2_IptcData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9122,12 +8930,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9182,12 +8987,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9233,12 +9035,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9280,12 +9079,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9383,12 +9179,9 @@ SWIGINTERN PyObject *_wrap_IptcData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_IptcData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9410,12 +9203,9 @@ SWIGINTERN int _wrap_new_IptcData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::IptcData *)new Exiv2::IptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9441,12 +9231,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/metadatum_wrap.cxx b/src/swig-0_27_0/metadatum_wrap.cxx index 0acb8509..253bf92d 100644 --- a/src/swig-0_27_0/metadatum_wrap.cxx +++ b/src/swig-0_27_0/metadatum_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -5083,12 +5116,9 @@ SWIGINTERN PyObject *_wrap_delete_Key(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5115,12 +5145,9 @@ SWIGINTERN PyObject *_wrap_Key_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5147,12 +5174,9 @@ SWIGINTERN PyObject *_wrap_Key_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Key const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5179,12 +5203,9 @@ SWIGINTERN PyObject *_wrap_Key_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5211,12 +5232,9 @@ SWIGINTERN PyObject *_wrap_Key_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5243,12 +5261,9 @@ SWIGINTERN PyObject *_wrap_Key_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5275,12 +5290,9 @@ SWIGINTERN PyObject *_wrap_Key_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Key const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5307,12 +5319,9 @@ SWIGINTERN PyObject *_wrap_Key_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5341,12 +5350,9 @@ SWIGINTERN PyObject *_wrap_Key___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Key___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5376,12 +5382,9 @@ SWIGINTERN PyObject *_wrap_delete_Metadatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5415,12 +5418,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5460,12 +5460,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5538,12 +5535,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5570,12 +5564,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5664,12 +5655,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5706,12 +5694,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5738,12 +5723,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Metadatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5770,12 +5752,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5802,12 +5781,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5834,12 +5810,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5866,12 +5839,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Metadatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5898,12 +5868,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Metadatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5934,12 +5901,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Metadatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5966,12 +5930,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5998,12 +5959,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_count(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->count(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6030,12 +5988,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_size(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6062,12 +6017,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6102,12 +6054,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6171,12 +6120,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Metadatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6203,12 +6149,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Metadatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6272,12 +6215,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6304,12 +6244,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6373,12 +6310,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6405,12 +6339,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6466,12 +6397,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_getValue(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6507,12 +6435,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_value(PyObject *self, PyObject *args) { { try { result = (Exiv2::Value *) &((Exiv2::Metadatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6546,12 +6471,9 @@ SWIGINTERN PyObject *_wrap_Metadatum___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Metadatum___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/preview_wrap.cxx b/src/swig-0_27_0/preview_wrap.cxx index 5caf5bc8..4385db0d 100644 --- a/src/swig-0_27_0/preview_wrap.cxx +++ b/src/swig-0_27_0/preview_wrap.cxx @@ -4317,6 +4317,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + namespace swig { template struct noconst_traits { @@ -5739,12 +5772,9 @@ SWIGINTERN int _wrap_new_PreviewProperties(PyObject *self, PyObject *args, PyObj { try { result = (Exiv2::PreviewProperties *)new Exiv2::PreviewProperties(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5770,12 +5800,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewProperties(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5809,12 +5836,9 @@ SWIGINTERN int _wrap_new_PreviewImage(PyObject *self, PyObject *args, PyObject * { try { result = (Exiv2::PreviewImage *)new Exiv2::PreviewImage((Exiv2::PreviewImage const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5840,12 +5864,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewImage(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5872,12 +5893,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::PreviewImage const *)arg1)->copy(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5971,12 +5989,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args { try { result = (long)((Exiv2::PreviewImage const *)arg1)->writeFile((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6145,12 +6160,9 @@ SWIGINTERN int _wrap_new_PreviewManager(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::PreviewManager *)new Exiv2::PreviewManager((Exiv2::Image const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6183,12 +6195,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewProperties(PyObject *self, P { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewProperties(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6228,12 +6237,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewImage(PyObject *self, PyObje { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewImage((Exiv2::PreviewProperties const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6259,12 +6265,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewManager(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/properties_wrap.cxx b/src/swig-0_27_0/properties_wrap.cxx index a8beb0fd..d0f0b4cb 100644 --- a/src/swig-0_27_0/properties_wrap.cxx +++ b/src/swig-0_27_0/properties_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* Py_IntEnum = NULL; @@ -4595,12 +4628,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_ns(PyObject *self, PyObject *args) { { try { result = Exiv2::XmpProperties::ns((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4636,12 +4666,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsDesc(PyObject *self, PyObject *args) { try { result = (char *)Exiv2::XmpProperties::nsDesc((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4677,12 +4704,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyList(PyObject *self, PyObject * { try { result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyList((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4720,12 +4744,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsInfo(PyObject *self, PyObject *args) { try { result = (Exiv2::XmpNsInfo *)Exiv2::XmpProperties::nsInfo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4804,12 +4825,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registerNs(PyObject *self, PyObject *ar { try { Exiv2::XmpProperties::registerNs((std::string const &)*arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4844,12 +4862,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_0(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4869,12 +4884,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_1(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4926,12 +4938,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registeredNamespaces(PyObject *self, Py { try { Exiv2::XmpProperties::registeredNamespaces(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4974,12 +4983,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5026,12 +5032,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5065,12 +5068,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5285,12 +5285,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5319,12 +5316,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_ns(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->ns(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/tags_wrap.cxx b/src/swig-0_27_0/tags_wrap.cxx index 4ca2087e..05539f07 100644 --- a/src/swig-0_27_0/tags_wrap.cxx +++ b/src/swig-0_27_0/tags_wrap.cxx @@ -4137,6 +4137,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + class _TagListFct { private: Exiv2::TagListFct func; @@ -5010,12 +5043,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5057,12 +5087,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5094,12 +5121,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5390,12 +5414,9 @@ SWIGINTERN PyObject *_wrap_ExifKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/types_wrap.cxx b/src/swig-0_27_0/types_wrap.cxx index c6ceb8d1..e4d495f3 100644 --- a/src/swig-0_27_0/types_wrap.cxx +++ b/src/swig-0_27_0/types_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan @@ -5308,12 +5341,9 @@ SWIGINTERN PyObject *_wrap__set_locale_dir(PyObject *self, PyObject *args) { { try { _set_locale_dir((char const *)arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5349,12 +5379,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeName(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::TypeInfo::typeName(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5388,12 +5415,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)Exiv2::TypeInfo::typeId((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5433,12 +5457,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeSize(PyObject *self, PyObject *args) { { try { result = (long)Exiv2::TypeInfo::typeSize(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5464,12 +5485,9 @@ SWIGINTERN PyObject *_wrap_delete_TypeInfo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5490,12 +5508,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5522,12 +5537,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5560,12 +5572,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf((Exiv2::byte const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5601,12 +5610,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5689,12 +5695,9 @@ SWIGINTERN PyObject *_wrap_delete_DataBuf(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5730,12 +5733,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_alloc(PyObject *self, PyObject *args) { { try { (arg1)->alloc(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5946,12 +5946,9 @@ SWIGINTERN PyObject *_wrap_DataBuf___getitem__(PyObject *self, PyObject *args) { { try { result = (PyObject *)Exiv2_DataBuf___getitem__(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6029,12 +6026,9 @@ SWIGINTERN PyObject *_wrap_exvGettext(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::exvGettext((char const *)arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6055,12 +6049,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6095,12 +6086,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6132,12 +6120,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >((std::pair< uint32_t,uint32_t > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6303,12 +6288,9 @@ SWIGINTERN PyObject *_wrap_delete_URational(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6329,12 +6311,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6369,12 +6348,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6406,12 +6382,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >((std::pair< int32_t,int32_t > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6577,12 +6550,9 @@ SWIGINTERN PyObject *_wrap_delete_Rational(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index 4873d60a..0023a0c3 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -4306,6 +4306,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -7427,12 +7460,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7478,12 +7508,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7563,12 +7590,9 @@ SWIGINTERN PyObject *_wrap_Value_setDataArea(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7626,12 +7650,9 @@ SWIGINTERN PyObject *_wrap_Value_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7705,12 +7726,9 @@ SWIGINTERN PyObject *_wrap_Value_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Value const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7789,12 +7807,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7829,12 +7844,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7898,12 +7910,9 @@ SWIGINTERN PyObject *_wrap_Value_toLong__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (long)((Exiv2::Value const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7930,12 +7939,9 @@ SWIGINTERN PyObject *_wrap_Value_toLong__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (long)((Exiv2::Value const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7999,12 +8005,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8031,12 +8034,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8100,12 +8100,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8132,12 +8129,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8193,12 +8187,9 @@ SWIGINTERN PyObject *_wrap_Value_sizeDataArea(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Value const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8225,12 +8216,9 @@ SWIGINTERN PyObject *_wrap_Value_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8292,12 +8280,9 @@ SWIGINTERN PyObject *_wrap_Value_create(PyObject *self, PyObject *args) { { try { result = Exiv2::Value::create(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8333,12 +8318,9 @@ SWIGINTERN PyObject *_wrap_Value___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Value___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8381,12 +8363,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8455,12 +8434,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8545,12 +8521,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8596,12 +8569,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8665,12 +8635,9 @@ SWIGINTERN PyObject *_wrap_DataValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8737,12 +8704,9 @@ SWIGINTERN PyObject *_wrap_DataValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::DataValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8831,12 +8795,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8871,12 +8832,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DataValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8903,12 +8861,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DataValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8972,12 +8927,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9004,12 +8956,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9073,12 +9022,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9105,12 +9051,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9169,12 +9112,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new_Exiv2_DataValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9289,12 +9229,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_0(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9355,12 +9292,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_1(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9428,12 +9362,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::StringValueBase const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9500,12 +9431,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_copy(PyObject *self, PyObject *args) { try { result = (long)((Exiv2::StringValueBase const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9592,12 +9520,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toLong__SWIG_0(PyObject *self, Py_ssi { try { result = (long)((Exiv2::StringValueBase const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9624,12 +9549,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toLong__SWIG_1(PyObject *self, Py_ssi { try { result = (long)((Exiv2::StringValueBase const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9693,12 +9615,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_0(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9725,12 +9644,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_1(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9794,12 +9710,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_0(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9826,12 +9739,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_1(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9945,12 +9855,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9982,12 +9889,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10036,12 +9940,9 @@ SWIGINTERN PyObject *_wrap_StringValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::StringValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10073,12 +9974,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new_Exiv2_StringValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10141,12 +10039,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new Exiv2::AsciiValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10225,12 +10120,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10276,12 +10168,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10345,12 +10234,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::AsciiValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10384,12 +10270,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_1((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10421,12 +10304,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10489,12 +10369,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10526,12 +10403,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10593,12 +10467,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10659,12 +10530,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10732,12 +10600,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::CommentValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10804,12 +10669,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::CommentValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10855,12 +10717,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment((char const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10889,12 +10748,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10965,12 +10821,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_detectCharset(PyObject *self, PyObject * { try { result = (char *)((Exiv2::CommentValue const *)arg1)->detectCharset(*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10999,12 +10852,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_charsetId(PyObject *self, PyObject *args { try { result = (Exiv2::CommentValue::CharsetId)((Exiv2::CommentValue const *)arg1)->charsetId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11098,12 +10948,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new_Exiv2_CommentValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11283,12 +11130,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::XmpValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11474,12 +11318,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11525,12 +11366,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11608,12 +11446,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11645,12 +11480,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11711,12 +11543,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11762,12 +11591,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11831,12 +11657,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpTextValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11915,12 +11738,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toLong__SWIG_0(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::XmpTextValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11947,12 +11767,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toLong__SWIG_1(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::XmpTextValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12016,12 +11833,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12048,12 +11862,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12117,12 +11928,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12149,12 +11957,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12213,12 +12018,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new_Exiv2_XmpTextValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12405,12 +12207,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12456,12 +12255,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12525,12 +12321,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpArrayValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12590,12 +12383,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12630,12 +12420,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toLong__SWIG_0(PyObject *self, Py_ssize { try { result = (long)((Exiv2::XmpArrayValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12662,12 +12449,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toLong__SWIG_1(PyObject *self, Py_ssize { try { result = (long)((Exiv2::XmpArrayValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12731,12 +12515,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12763,12 +12544,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12832,12 +12610,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12864,12 +12639,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12928,12 +12700,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_0((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12980,12 +12749,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_1(SWIG_STD_MOVE(arg1),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13022,12 +12788,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_2(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13192,12 +12955,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13229,12 +12989,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13295,12 +13052,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13346,12 +13100,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13415,12 +13166,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::LangAltValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13478,12 +13226,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13523,12 +13268,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13602,12 +13344,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toLong__SWIG_0(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::LangAltValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13634,12 +13373,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toLong__SWIG_1(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::LangAltValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13703,12 +13439,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13735,12 +13468,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13804,12 +13534,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13836,12 +13563,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13899,12 +13623,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_2(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14145,12 +13866,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14253,12 +13971,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14301,12 +14016,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(arg1,arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14385,12 +14097,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14436,12 +14145,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14526,12 +14232,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setDate((Exiv2::DateValue::Date const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14558,12 +14261,9 @@ SWIGINTERN PyObject *_wrap_DateValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DateValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14630,12 +14330,9 @@ SWIGINTERN PyObject *_wrap_DateValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::DateValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14672,12 +14369,9 @@ SWIGINTERN PyObject *_wrap_DateValue_getDate(PyObject *self, PyObject *args) { { try { result = (Exiv2::DateValue::Date *) &((Exiv2::DateValue const *)arg1)->getDate(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14757,12 +14451,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DateValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14789,12 +14480,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DateValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14858,12 +14546,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14890,12 +14575,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14959,12 +14641,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14991,12 +14670,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15066,12 +14742,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_2(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15121,12 +14794,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_DateValue_setDate__SWIG_1(arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15185,12 +14855,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15301,12 +14968,9 @@ SWIGINTERN int _wrap_new_Date(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::DateValue::Date *)new Exiv2::DateValue::Date(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15506,12 +15170,9 @@ SWIGINTERN PyObject *_wrap_delete_Date(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15534,12 +15195,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15613,12 +15271,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(arg1,arg2,arg3,arg4,arg5); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15697,12 +15352,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15748,12 +15400,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15842,12 +15491,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setTime((Exiv2::TimeValue::Time const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15874,12 +15520,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::TimeValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15946,12 +15589,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::TimeValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15988,12 +15628,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_getTime(PyObject *self, PyObject *args) { { try { result = (Exiv2::TimeValue::Time *) &((Exiv2::TimeValue const *)arg1)->getTime(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16074,12 +15711,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::TimeValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16106,12 +15740,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::TimeValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16175,12 +15806,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16207,12 +15835,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16276,12 +15901,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16308,12 +15930,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16387,12 +16006,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_2(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16473,12 +16089,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_TimeValue_setTime__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16537,12 +16150,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16653,12 +16263,9 @@ SWIGINTERN int _wrap_new_Time(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::TimeValue::Time *)new Exiv2::TimeValue::Time(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16972,12 +16579,9 @@ SWIGINTERN PyObject *_wrap_delete_Time(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17018,12 +16622,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17087,12 +16688,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17145,12 +16743,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((unsigned short const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17180,12 +16775,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::ValueType< unsigned short > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17211,12 +16803,9 @@ SWIGINTERN PyObject *_wrap_delete_UShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17270,12 +16859,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17321,12 +16907,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17400,12 +16983,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17438,12 +17018,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17505,12 +17082,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17599,12 +17173,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17639,12 +17210,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17671,12 +17239,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17740,12 +17305,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17772,12 +17334,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17841,12 +17400,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17873,12 +17429,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17934,12 +17487,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17966,12 +17516,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18004,12 +17551,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18038,12 +17582,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18295,12 +17836,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18364,12 +17902,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18422,12 +17957,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((unsigned int const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18457,12 +17989,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::ValueType< unsigned int > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18488,12 +18017,9 @@ SWIGINTERN PyObject *_wrap_delete_ULongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18547,12 +18073,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18598,12 +18121,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18677,12 +18197,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18715,12 +18232,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18782,12 +18296,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18876,12 +18387,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18916,12 +18424,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18948,12 +18453,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19017,12 +18519,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19049,12 +18548,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19118,12 +18614,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19150,12 +18643,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19211,12 +18701,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19243,12 +18730,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19281,12 +18765,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19315,12 +18796,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19572,12 +19050,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19641,12 +19116,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19702,12 +19174,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((std::pair< unsigned int,unsigned int > const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19739,12 +19208,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::ValueType< std::pair< unsigned int,unsigned int > > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19770,12 +19236,9 @@ SWIGINTERN PyObject *_wrap_delete_URationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19829,12 +19292,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_0(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19880,12 +19340,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_1(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19959,12 +19416,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_setDataArea(PyObject *self, PyObject * { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19997,12 +19451,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20064,12 +19515,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20158,12 +19606,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toString(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20198,12 +19643,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toLong__SWIG_0(PyObject *self, Py_ssiz { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20230,12 +19672,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toLong__SWIG_1(PyObject *self, Py_ssiz { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20299,12 +19738,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_0(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20331,12 +19767,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_1(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20400,12 +19833,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_0(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20432,12 +19862,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_1(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20493,12 +19920,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_sizeDataArea(PyObject *self, PyObject { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20525,12 +19949,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_dataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20563,12 +19984,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20597,12 +20015,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20848,12 +20263,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20917,12 +20329,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20975,12 +20384,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((short const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21010,12 +20416,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::ValueType< short > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21041,12 +20444,9 @@ SWIGINTERN PyObject *_wrap_delete_ShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21100,12 +20500,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21151,12 +20548,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21230,12 +20624,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21268,12 +20659,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21335,12 +20723,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21429,12 +20814,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21469,12 +20851,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21501,12 +20880,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21570,12 +20946,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21602,12 +20975,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21671,12 +21041,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21703,12 +21070,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21764,12 +21128,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21796,12 +21157,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21834,12 +21192,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21868,12 +21223,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22125,12 +21477,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22194,12 +21543,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22252,12 +21598,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((int const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22287,12 +21630,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::ValueType< int > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22318,12 +21658,9 @@ SWIGINTERN PyObject *_wrap_delete_LongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22377,12 +21714,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22428,12 +21762,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22507,12 +21838,9 @@ SWIGINTERN PyObject *_wrap_LongValue_setDataArea(PyObject *self, PyObject *args) { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22545,12 +21873,9 @@ SWIGINTERN PyObject *_wrap_LongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22612,12 +21937,9 @@ SWIGINTERN PyObject *_wrap_LongValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22706,12 +22028,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22746,12 +22065,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22778,12 +22094,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22847,12 +22160,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22879,12 +22189,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22948,12 +22255,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22980,12 +22284,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23041,12 +22342,9 @@ SWIGINTERN PyObject *_wrap_LongValue_sizeDataArea(PyObject *self, PyObject *args { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23073,12 +22371,9 @@ SWIGINTERN PyObject *_wrap_LongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23111,12 +22406,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23145,12 +22437,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23402,12 +22691,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23471,12 +22757,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23532,12 +22815,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((std::pair< int,int > const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23569,12 +22849,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::ValueType< std::pair< int,int > > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23600,12 +22877,9 @@ SWIGINTERN PyObject *_wrap_delete_RationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23659,12 +22933,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23710,12 +22981,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23789,12 +23057,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_setDataArea(PyObject *self, PyObject *a { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23827,12 +23092,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23894,12 +23156,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23988,12 +23247,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24028,12 +23284,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toLong__SWIG_0(PyObject *self, Py_ssize { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24060,12 +23313,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toLong__SWIG_1(PyObject *self, Py_ssize { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24129,12 +23379,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24161,12 +23408,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24230,12 +23474,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24262,12 +23503,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24323,12 +23561,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_sizeDataArea(PyObject *self, PyObject * { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24355,12 +23590,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_dataArea(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24393,12 +23625,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24427,12 +23656,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24678,12 +23904,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24747,12 +23970,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24805,12 +24025,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((float const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24840,12 +24057,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::ValueType< float > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24871,12 +24085,9 @@ SWIGINTERN PyObject *_wrap_delete_FloatValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24930,12 +24141,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24981,12 +24189,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25060,12 +24265,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25098,12 +24300,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25165,12 +24364,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25259,12 +24455,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25299,12 +24492,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25331,12 +24521,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25400,12 +24587,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25432,12 +24616,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25501,12 +24682,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25533,12 +24711,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25594,12 +24769,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25626,12 +24798,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25664,12 +24833,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25698,12 +24864,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25955,12 +25118,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26024,12 +25184,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26082,12 +25239,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((double const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26117,12 +25271,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::ValueType< double > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26148,12 +25299,9 @@ SWIGINTERN PyObject *_wrap_delete_DoubleValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26207,12 +25355,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26258,12 +25403,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26337,12 +25479,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26375,12 +25514,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< double > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26442,12 +25578,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26536,12 +25669,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26576,12 +25706,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26608,12 +25735,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26677,12 +25801,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26709,12 +25830,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26778,12 +25896,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26810,12 +25925,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26871,12 +25983,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26903,12 +26012,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26941,12 +26047,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26975,12 +26078,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/version_wrap.cxx b/src/swig-0_27_0/version_wrap.cxx index d23f5d20..f7586faf 100644 --- a/src/swig-0_27_0/version_wrap.cxx +++ b/src/swig-0_27_0/version_wrap.cxx @@ -4118,6 +4118,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* versionInfo() { bool nls = false; bool bmff = false; @@ -4383,12 +4416,9 @@ SWIGINTERN PyObject *_wrap_versionInfo(PyObject *self, PyObject *args) { { try { result = (PyObject *)versionInfo(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4407,12 +4437,9 @@ SWIGINTERN PyObject *_wrap_versionNumber(PyObject *self, PyObject *args) { { try { result = (int)Exiv2::versionNumber(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4431,12 +4458,9 @@ SWIGINTERN PyObject *_wrap_versionString(PyObject *self, PyObject *args) { { try { result = Exiv2::versionString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4455,12 +4479,9 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args { try { result = Exiv2::versionNumberHexString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4479,12 +4500,9 @@ SWIGINTERN PyObject *_wrap_version(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::version(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4528,12 +4546,9 @@ SWIGINTERN PyObject *_wrap_testVersion(PyObject *self, PyObject *args) { { try { result = (bool)Exiv2::testVersion(arg1,arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_0/xmp_wrap.cxx b/src/swig-0_27_0/xmp_wrap.cxx index ce0a85e1..9da02582 100644 --- a/src/swig-0_27_0/xmp_wrap.cxx +++ b/src/swig-0_27_0/xmp_wrap.cxx @@ -4153,6 +4153,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class XmpData_iterator_base { protected: @@ -5377,12 +5410,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_base___str__(PyObject *self, PyObjec { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5408,12 +5438,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator_base(PyObject *self, PyObject { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5448,12 +5475,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator___deref__(PyObject *self, PyObject * { try { result = (Exiv2::Xmpdatum *)((XmpData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5479,12 +5503,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator(PyObject *self, PyObject *arg { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5518,12 +5539,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_0(PyObject *self, Py_ { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5563,12 +5581,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_1(PyObject *self, Py_ { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5599,12 +5614,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_2(PyObject *self, Py_ { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5712,12 +5724,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_copy(PyObject *self, PyObject *args) { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5754,12 +5763,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5786,12 +5792,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5818,12 +5821,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_groupName(PyObject *self, PyObject * { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5850,12 +5850,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagName(PyObject *self, PyObject *ar { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5882,12 +5879,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagLabel(PyObject *self, PyObject *a { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5914,12 +5908,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5946,12 +5937,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeId(PyObject *self, PyObject *arg { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5982,12 +5970,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6014,12 +5999,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeSize(PyObject *self, PyObject *a { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6088,12 +6070,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6128,12 +6107,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_1(PyObject *self, Py_ { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6197,12 +6173,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toLong__SWIG_0(PyObject *self, Py_ss { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6229,12 +6202,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toLong__SWIG_1(PyObject *self, Py_ss { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6298,12 +6268,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_0(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6330,12 +6297,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_1(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6399,12 +6363,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_0(PyObject *self, P { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6431,12 +6392,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_1(PyObject *self, P { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6492,12 +6450,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6546,12 +6501,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_1(PyObject *self, Py_ { try { result = Exiv2_Xmpdatum_getValue__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6616,12 +6568,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_0(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6668,12 +6617,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_1(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6744,12 +6690,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_0(PyObject *self, Py_ss { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6776,12 +6719,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_1(PyObject *self, Py_ss { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6850,12 +6790,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6885,12 +6822,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6920,12 +6854,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::Xmpdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6993,12 +6924,9 @@ SWIGINTERN PyObject *_wrap_delete_Xmpdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7032,12 +6960,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7077,12 +7002,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7144,12 +7066,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7186,12 +7105,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7218,12 +7134,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7250,12 +7163,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7282,12 +7192,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7314,12 +7221,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7346,12 +7250,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Xmpdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7378,12 +7279,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Xmpdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7414,12 +7312,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7446,12 +7341,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7520,12 +7412,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7560,12 +7449,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7629,12 +7515,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7661,12 +7544,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7730,12 +7610,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7762,12 +7639,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7831,12 +7705,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_0(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7863,12 +7734,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_1(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7924,12 +7792,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7965,12 +7830,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &((Exiv2::Xmpdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8017,12 +7879,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Xmpdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8100,12 +7959,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8170,12 +8026,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8245,12 +8098,9 @@ SWIGINTERN int _wrap_new_XmpData(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XmpData *)new Exiv2::XmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8296,12 +8146,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::XmpKey const &)*arg2,(Exiv2::Value const *)arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8339,12 +8186,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::Xmpdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8416,12 +8260,9 @@ SWIGINTERN PyObject *_wrap_XmpData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8469,12 +8310,9 @@ SWIGINTERN PyObject *_wrap_XmpData_eraseFamily(PyObject *self, PyObject *args) { { try { (arg1)->eraseFamily(*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8520,12 +8358,9 @@ SWIGINTERN PyObject *_wrap_XmpData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8625,12 +8460,9 @@ SWIGINTERN PyObject *_wrap_XmpData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::XmpKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8708,12 +8540,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_0(PyObject *self, Py_ssize_t { try { result = (bool)((Exiv2::XmpData const *)arg1)->usePacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8748,12 +8577,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_1(PyObject *self, Py_ssize_t { try { result = (bool)(arg1)->usePacket(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8823,12 +8649,9 @@ SWIGINTERN PyObject *_wrap_XmpData_setPacket(PyObject *self, PyObject *args) { { try { (arg1)->setPacket((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8857,12 +8680,9 @@ SWIGINTERN PyObject *_wrap_XmpData_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &((Exiv2::XmpData const *)arg1)->xmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8904,12 +8724,9 @@ SWIGINTERN PyObject *_wrap_XmpData___getitem__(PyObject *self, PyObject *args) { { try { result = (Exiv2::Xmpdatum *) &Exiv2_XmpData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8964,12 +8781,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_0(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9024,12 +8838,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_1(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9075,12 +8886,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_2(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9122,12 +8930,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_3(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9225,12 +9030,9 @@ SWIGINTERN PyObject *_wrap_XmpData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_XmpData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9258,12 +9060,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9305,12 +9104,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_0(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9336,12 +9132,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_1(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9360,12 +9153,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_2(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9418,12 +9208,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_terminate(PyObject *self, PyObject *args) { { try { Exiv2::XmpParser::terminate(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9443,12 +9230,9 @@ SWIGINTERN int _wrap_new_XmpParser(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::XmpParser *)new Exiv2::XmpParser(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9474,12 +9258,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpParser(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/basicio_wrap.cxx b/src/swig-0_27_4/basicio_wrap.cxx index 5fd93adf..0c6e713e 100644 --- a/src/swig-0_27_4/basicio_wrap.cxx +++ b/src/swig-0_27_4/basicio_wrap.cxx @@ -4128,6 +4128,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static int Exiv2_BasicIo_getbuff( PyObject* exporter, Py_buffer* view, int flags) { Exiv2::BasicIo* self = 0; @@ -4803,12 +4836,9 @@ SWIGINTERN PyObject *_wrap_delete_BasicIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4839,12 +4869,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4875,12 +4902,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4926,12 +4950,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_0(PyObject *self, PyObject *args) result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4980,12 +5001,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5063,12 +5081,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5108,12 +5123,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5175,12 +5187,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5252,12 +5261,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5299,12 +5305,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5358,12 +5361,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5408,12 +5408,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5450,12 +5447,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5482,12 +5476,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_tell(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::BasicIo const *)arg1)->tell(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5514,12 +5505,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_size(PyObject *self, PyObject *args) { { try { result = ((Exiv2::BasicIo const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5651,12 +5639,9 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs { try { result = (Exiv2::FileIo *)new Exiv2::FileIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5684,12 +5669,9 @@ SWIGINTERN PyObject *_wrap_delete_FileIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5734,12 +5716,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_0(PyObject *self, PyObject *args) { result = (int)(arg1)->open((std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5772,12 +5751,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_1(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5843,12 +5819,9 @@ SWIGINTERN PyObject *_wrap_FileIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5894,12 +5867,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_0(PyObject *self, PyObject *args) result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5948,12 +5918,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6031,12 +5998,9 @@ SWIGINTERN PyObject *_wrap_FileIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6076,12 +6040,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_0(PyObject *self, PyObject *args) { result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6143,12 +6104,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_1(PyObject *self, PyObject *args) { result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6220,12 +6178,9 @@ SWIGINTERN PyObject *_wrap_FileIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6267,12 +6222,9 @@ SWIGINTERN PyObject *_wrap_FileIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6326,12 +6278,9 @@ SWIGINTERN PyObject *_wrap_FileIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6376,12 +6325,9 @@ SWIGINTERN PyObject *_wrap_FileIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6418,12 +6364,9 @@ SWIGINTERN PyObject *_wrap_FileIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6468,12 +6411,9 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { { try { (arg1)->setPath((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6506,12 +6446,9 @@ SWIGINTERN PyObject *_wrap_FileIo_tell(PyObject *self, PyObject *args) { result = (long)((Exiv2::FileIo const *)arg1)->tell(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6542,12 +6479,9 @@ SWIGINTERN PyObject *_wrap_FileIo_size(PyObject *self, PyObject *args) { result = ((Exiv2::FileIo const *)arg1)->size(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6660,12 +6594,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6700,12 +6631,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo((Exiv2::byte const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6779,12 +6707,9 @@ SWIGINTERN PyObject *_wrap_delete_MemIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6987,12 +6912,9 @@ SWIGINTERN PyObject *_wrap_MemIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7154,12 +7076,9 @@ SWIGINTERN PyObject *_wrap_MemIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7201,12 +7120,9 @@ SWIGINTERN PyObject *_wrap_MemIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7484,12 +7400,9 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XPathIo *)new Exiv2::XPathIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7517,12 +7430,9 @@ SWIGINTERN PyObject *_wrap_delete_XPathIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7564,12 +7474,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7607,12 +7514,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg { try { result = Exiv2::XPathIo::writeDataToFile((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7642,12 +7546,9 @@ SWIGINTERN PyObject *_wrap_delete_RemoteIo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7678,12 +7579,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7714,12 +7612,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7765,12 +7660,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_0(PyObject *self, PyObject *args result = (long)(arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7819,12 +7711,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_1(PyObject *self, PyObject *args result = (long)(arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7902,12 +7791,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7947,12 +7833,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8014,12 +7897,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_1(PyObject *self, PyObject *args) result = (long)(arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8091,12 +7971,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8138,12 +8015,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8232,12 +8106,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8447,12 +8318,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8493,12 +8361,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/datasets_wrap.cxx b/src/swig-0_27_4/datasets_wrap.cxx index 46baccad..4bccfdfa 100644 --- a/src/swig-0_27_4/datasets_wrap.cxx +++ b/src/swig-0_27_4/datasets_wrap.cxx @@ -4136,6 +4136,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #define SWIG_From_long PyInt_FromLong @@ -4737,12 +4770,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSet(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::dataSet((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4858,12 +4888,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordId(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::recordId((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4927,12 +4954,9 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::IptcKey *)new Exiv2::IptcKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/easyaccess_wrap.cxx b/src/swig-0_27_4/easyaccess_wrap.cxx index 043d34cf..243cf47f 100644 --- a/src/swig-0_27_4/easyaccess_wrap.cxx +++ b/src/swig-0_27_4/easyaccess_wrap.cxx @@ -4105,6 +4105,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; + +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + #ifdef __cplusplus extern "C" { #endif @@ -4133,12 +4166,9 @@ SWIGINTERN PyObject *_wrap_orientation(PyObject *self, PyObject *args) { { try { result = Exiv2::orientation((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4180,12 +4210,9 @@ SWIGINTERN PyObject *_wrap_isoSpeed(PyObject *self, PyObject *args) { { try { result = Exiv2::isoSpeed((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4227,12 +4254,9 @@ SWIGINTERN PyObject *_wrap_dateTimeOriginal(PyObject *self, PyObject *args) { { try { result = Exiv2::dateTimeOriginal((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4274,12 +4298,9 @@ SWIGINTERN PyObject *_wrap_flashBias(PyObject *self, PyObject *args) { { try { result = Exiv2::flashBias((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4321,12 +4342,9 @@ SWIGINTERN PyObject *_wrap_exposureMode(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4368,12 +4386,9 @@ SWIGINTERN PyObject *_wrap_sceneMode(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4415,12 +4430,9 @@ SWIGINTERN PyObject *_wrap_macroMode(PyObject *self, PyObject *args) { { try { result = Exiv2::macroMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4462,12 +4474,9 @@ SWIGINTERN PyObject *_wrap_imageQuality(PyObject *self, PyObject *args) { { try { result = Exiv2::imageQuality((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4509,12 +4518,9 @@ SWIGINTERN PyObject *_wrap_whiteBalance(PyObject *self, PyObject *args) { { try { result = Exiv2::whiteBalance((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4556,12 +4562,9 @@ SWIGINTERN PyObject *_wrap_lensName(PyObject *self, PyObject *args) { { try { result = Exiv2::lensName((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4603,12 +4606,9 @@ SWIGINTERN PyObject *_wrap_saturation(PyObject *self, PyObject *args) { { try { result = Exiv2::saturation((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4650,12 +4650,9 @@ SWIGINTERN PyObject *_wrap_sharpness(PyObject *self, PyObject *args) { { try { result = Exiv2::sharpness((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4697,12 +4694,9 @@ SWIGINTERN PyObject *_wrap_contrast(PyObject *self, PyObject *args) { { try { result = Exiv2::contrast((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4744,12 +4738,9 @@ SWIGINTERN PyObject *_wrap_sceneCaptureType(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneCaptureType((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4791,12 +4782,9 @@ SWIGINTERN PyObject *_wrap_meteringMode(PyObject *self, PyObject *args) { { try { result = Exiv2::meteringMode((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4838,12 +4826,9 @@ SWIGINTERN PyObject *_wrap_make(PyObject *self, PyObject *args) { { try { result = Exiv2::make((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4885,12 +4870,9 @@ SWIGINTERN PyObject *_wrap_model(PyObject *self, PyObject *args) { { try { result = Exiv2::model((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4932,12 +4914,9 @@ SWIGINTERN PyObject *_wrap_exposureTime(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureTime((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4979,12 +4958,9 @@ SWIGINTERN PyObject *_wrap_fNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::fNumber((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5026,12 +5002,9 @@ SWIGINTERN PyObject *_wrap_shutterSpeedValue(PyObject *self, PyObject *args) { { try { result = Exiv2::shutterSpeedValue((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5073,12 +5046,9 @@ SWIGINTERN PyObject *_wrap_apertureValue(PyObject *self, PyObject *args) { { try { result = Exiv2::apertureValue((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5120,12 +5090,9 @@ SWIGINTERN PyObject *_wrap_brightnessValue(PyObject *self, PyObject *args) { { try { result = Exiv2::brightnessValue((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5167,12 +5134,9 @@ SWIGINTERN PyObject *_wrap_exposureBiasValue(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureBiasValue((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5214,12 +5178,9 @@ SWIGINTERN PyObject *_wrap_maxApertureValue(PyObject *self, PyObject *args) { { try { result = Exiv2::maxApertureValue((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5261,12 +5222,9 @@ SWIGINTERN PyObject *_wrap_subjectDistance(PyObject *self, PyObject *args) { { try { result = Exiv2::subjectDistance((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5308,12 +5266,9 @@ SWIGINTERN PyObject *_wrap_lightSource(PyObject *self, PyObject *args) { { try { result = Exiv2::lightSource((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5355,12 +5310,9 @@ SWIGINTERN PyObject *_wrap_flash(PyObject *self, PyObject *args) { { try { result = Exiv2::flash((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5402,12 +5354,9 @@ SWIGINTERN PyObject *_wrap_serialNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::serialNumber((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5449,12 +5398,9 @@ SWIGINTERN PyObject *_wrap_focalLength(PyObject *self, PyObject *args) { { try { result = Exiv2::focalLength((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5496,12 +5442,9 @@ SWIGINTERN PyObject *_wrap_subjectArea(PyObject *self, PyObject *args) { { try { result = Exiv2::subjectArea((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5543,12 +5486,9 @@ SWIGINTERN PyObject *_wrap_flashEnergy(PyObject *self, PyObject *args) { { try { result = Exiv2::flashEnergy((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5590,12 +5530,9 @@ SWIGINTERN PyObject *_wrap_exposureIndex(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureIndex((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5637,12 +5574,9 @@ SWIGINTERN PyObject *_wrap_sensingMethod(PyObject *self, PyObject *args) { { try { result = Exiv2::sensingMethod((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5684,12 +5618,9 @@ SWIGINTERN PyObject *_wrap_afPoint(PyObject *self, PyObject *args) { { try { result = Exiv2::afPoint((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/exif_wrap.cxx b/src/swig-0_27_4/exif_wrap.cxx index ebb334e4..c518e4d4 100644 --- a/src/swig-0_27_4/exif_wrap.cxx +++ b/src/swig-0_27_4/exif_wrap.cxx @@ -4150,6 +4150,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class ExifData_iterator_base { protected: @@ -5518,12 +5551,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5549,12 +5579,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5589,12 +5616,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Exifdatum *)((ExifData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5620,12 +5644,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5659,12 +5680,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5704,12 +5722,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5740,12 +5755,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5848,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setDataArea(PyObject *self, PyObjec { try { result = (int)(*arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5874,12 +5883,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5906,12 +5912,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5938,12 +5941,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5970,12 +5970,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6002,12 +5999,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6034,12 +6028,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6066,12 +6057,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_ifdName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->ifdName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6098,12 +6086,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_idx(PyObject *self, PyObject *args) { try { result = (int)(*arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6163,12 +6148,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6205,12 +6187,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6241,12 +6220,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6273,12 +6249,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeSize(PyObject *self, PyObject * { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6347,12 +6320,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6387,12 +6357,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6456,12 +6423,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toLong__SWIG_0(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6488,12 +6452,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toLong__SWIG_1(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6557,12 +6518,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6589,12 +6547,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6658,12 +6613,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6690,12 +6642,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6751,12 +6700,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6805,12 +6751,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Exifdatum_getValue__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6875,12 +6818,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6927,12 +6867,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6995,12 +6932,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_sizeDataArea(PyObject *self, PyObje { try { result = (long)(*arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7027,12 +6961,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_dataArea(PyObject *self, PyObject * { try { result = (*arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7070,12 +7001,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7102,12 +7030,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7176,12 +7101,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7211,12 +7133,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7246,12 +7165,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::Exifdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7319,12 +7235,9 @@ SWIGINTERN PyObject *_wrap_delete_Exifdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7358,12 +7271,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7403,12 +7313,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7453,12 +7360,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setDataArea(PyObject *self, PyObject *args) { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7491,12 +7395,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7523,12 +7424,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7555,12 +7453,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7587,12 +7482,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7619,12 +7511,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7651,12 +7540,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Exifdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7683,12 +7569,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_ifdName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->ifdName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7715,12 +7598,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_idx(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Exifdatum const *)arg1)->idx(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7780,12 +7660,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Exifdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7822,12 +7699,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Exifdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7858,12 +7732,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7890,12 +7761,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Exifdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7964,12 +7832,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8004,12 +7869,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8073,12 +7935,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Exifdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8105,12 +7964,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Exifdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8174,12 +8030,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8206,12 +8059,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8275,12 +8125,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8307,12 +8154,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8368,12 +8212,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8409,12 +8250,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Exifdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8448,12 +8286,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_sizeDataArea(PyObject *self, PyObject *args { try { result = (long)((Exiv2::Exifdatum const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8480,12 +8315,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8528,12 +8360,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Exifdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8611,12 +8440,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8681,12 +8507,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8768,12 +8591,9 @@ SWIGINTERN int _wrap_new_ExifThumbC(PyObject *self, PyObject *args, PyObject *kw { try { result = (Exiv2::ExifThumbC *)new Exiv2::ExifThumbC((Exiv2::ExifData const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8800,12 +8620,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifThumbC const *)arg1)->copy(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8855,12 +8672,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) { try { result = (long)((Exiv2::ExifThumbC const *)arg1)->writeFile((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8889,12 +8703,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_mimeType(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->mimeType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8921,12 +8732,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_extension(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->extension(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8952,12 +8760,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumbC(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8991,12 +8796,9 @@ SWIGINTERN int _wrap_new_ExifThumb(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::ExifThumb *)new Exiv2::ExifThumb(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9074,12 +8876,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2,arg3,arg4,arg5); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9149,12 +8948,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_1(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3,arg4,arg5,arg6); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9204,12 +9000,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9251,12 +9044,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_3(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9343,12 +9133,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_erase(PyObject *self, PyObject *args) { { try { (arg1)->erase(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9374,12 +9161,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumb(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9426,12 +9210,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::ExifKey const &)*arg2,(Exiv2::Value const *)arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9468,12 +9249,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::Exifdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9543,12 +9321,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9612,12 +9387,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9701,12 +9473,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9732,12 +9501,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9837,12 +9603,9 @@ SWIGINTERN PyObject *_wrap_ExifData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::ExifKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9935,12 +9698,9 @@ SWIGINTERN PyObject *_wrap_ExifData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Exifdatum *) &Exiv2_ExifData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9995,12 +9755,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10055,12 +9812,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10106,12 +9860,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10153,12 +9904,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10256,12 +10004,9 @@ SWIGINTERN PyObject *_wrap_ExifData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_ExifData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10283,12 +10028,9 @@ SWIGINTERN int _wrap_new_ExifData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::ExifData *)new Exiv2::ExifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10314,12 +10056,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/image_wrap.cxx b/src/swig-0_27_4/image_wrap.cxx index 0fde11d9..a21bbc95 100644 --- a/src/swig-0_27_4/image_wrap.cxx +++ b/src/swig-0_27_4/image_wrap.cxx @@ -4162,6 +4162,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static bool enableBMFF(bool enable) { #ifdef EXV_ENABLE_BMFF return Exiv2::enableBMFF(enable); @@ -4756,12 +4789,9 @@ SWIGINTERN PyObject *_wrap_enableBMFF(PyObject *self, PyObject *args) { { try { result = (bool)enableBMFF(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4787,12 +4817,9 @@ SWIGINTERN PyObject *_wrap_delete_Image(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4822,12 +4849,9 @@ SWIGINTERN PyObject *_wrap_Image_readMetadata(PyObject *self, PyObject *args) { (arg1)->readMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4857,12 +4881,9 @@ SWIGINTERN PyObject *_wrap_Image_writeMetadata(PyObject *self, PyObject *args) { (arg1)->writeMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4906,12 +4927,9 @@ SWIGINTERN PyObject *_wrap_Image_setExifData(PyObject *self, PyObject *args) { { try { (arg1)->setExifData((Exiv2::ExifData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4937,12 +4955,9 @@ SWIGINTERN PyObject *_wrap_Image_clearExifData(PyObject *self, PyObject *args) { { try { (arg1)->clearExifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4981,12 +4996,9 @@ SWIGINTERN PyObject *_wrap_Image_setIptcData(PyObject *self, PyObject *args) { { try { (arg1)->setIptcData((Exiv2::IptcData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5012,12 +5024,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIptcData(PyObject *self, PyObject *args) { { try { (arg1)->clearIptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5058,12 +5067,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpPacket(PyObject *self, PyObject *args) { { try { (arg1)->setXmpPacket((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5091,12 +5097,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpPacket(PyObject *self, PyObject *args) { try { (arg1)->clearXmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5135,12 +5138,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpData(PyObject *self, PyObject *args) { { try { (arg1)->setXmpData((Exiv2::XmpData const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5166,12 +5166,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpData(PyObject *self, PyObject *args) { { try { (arg1)->clearXmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5212,12 +5209,9 @@ SWIGINTERN PyObject *_wrap_Image_setComment(PyObject *self, PyObject *args) { { try { (arg1)->setComment((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5245,12 +5239,9 @@ SWIGINTERN PyObject *_wrap_Image_clearComment(PyObject *self, PyObject *args) { { try { (arg1)->clearComment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5301,12 +5292,9 @@ SWIGINTERN PyObject *_wrap_Image_setIccProfile(PyObject *self, PyObject *args) { { try { (arg1)->setIccProfile(*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5332,12 +5320,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIccProfile(PyObject *self, PyObject *args) { try { (arg1)->clearIccProfile(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5364,12 +5349,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfileDefined(PyObject *self, PyObject *arg { try { result = (bool)(arg1)->iccProfileDefined(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5396,12 +5378,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfile(PyObject *self, PyObject *args) { { try { result = (Exiv2::DataBuf *)(arg1)->iccProfile(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5445,12 +5424,9 @@ SWIGINTERN PyObject *_wrap_Image_setMetadata(PyObject *self, PyObject *args) { { try { (arg1)->setMetadata((Exiv2::Image const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5476,12 +5452,9 @@ SWIGINTERN PyObject *_wrap_Image_clearMetadata(PyObject *self, PyObject *args) { { try { (arg1)->clearMetadata(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5508,12 +5481,9 @@ SWIGINTERN PyObject *_wrap_Image_exifData(PyObject *self, PyObject *args) { { try { result = (Exiv2::ExifData *) &(arg1)->exifData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5545,12 +5515,9 @@ SWIGINTERN PyObject *_wrap_Image_iptcData(PyObject *self, PyObject *args) { { try { result = (Exiv2::IptcData *) &(arg1)->iptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5582,12 +5549,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpData(PyObject *self, PyObject *args) { { try { result = (Exiv2::XmpData *) &(arg1)->xmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5619,12 +5583,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &(arg1)->xmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5658,12 +5619,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_0(PyObject *self, Py_s { try { (arg1)->writeXmpFromPacket(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5704,12 +5662,9 @@ SWIGINTERN PyObject *_wrap_Image_setByteOrder(PyObject *self, PyObject *args) { { try { (arg1)->setByteOrder(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5736,12 +5691,9 @@ SWIGINTERN PyObject *_wrap_Image_byteOrder(PyObject *self, PyObject *args) { { try { result = (Exiv2::ByteOrder)((Exiv2::Image const *)arg1)->byteOrder(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5772,12 +5724,9 @@ SWIGINTERN PyObject *_wrap_Image_good(PyObject *self, PyObject *args) { { try { result = (bool)((Exiv2::Image const *)arg1)->good(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5804,12 +5753,9 @@ SWIGINTERN PyObject *_wrap_Image_mimeType(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->mimeType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5782,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelWidth(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->pixelWidth(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5868,12 +5811,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelHeight(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->pixelHeight(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5900,12 +5840,9 @@ SWIGINTERN PyObject *_wrap_Image_comment(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->comment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,12 +5869,9 @@ SWIGINTERN PyObject *_wrap_Image_io(PyObject *self, PyObject *args) { { try { result = (Exiv2::BasicIo *) &((Exiv2::Image const *)arg1)->io(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5984,12 +5918,9 @@ SWIGINTERN PyObject *_wrap_Image_checkMode(PyObject *self, PyObject *args) { { try { result = (Exiv2::AccessMode)((Exiv2::Image const *)arg1)->checkMode(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6035,12 +5966,9 @@ SWIGINTERN PyObject *_wrap_Image_supportsMetadata(PyObject *self, PyObject *args { try { result = (bool)((Exiv2::Image const *)arg1)->supportsMetadata(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6067,12 +5995,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_1(PyObject *self, Py_s { try { result = (bool)((Exiv2::Image const *)arg1)->writeXmpFromPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6144,12 +6069,9 @@ SWIGINTERN PyObject *_wrap_Image_setTypeSupported(PyObject *self, PyObject *args { try { (arg1)->setTypeSupported(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6176,12 +6098,9 @@ SWIGINTERN PyObject *_wrap_Image_imageType(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Image const *)arg1)->imageType(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6234,12 +6153,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) { try { result = Exiv2::ImageFactory::createIo((std::string const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6297,12 +6213,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((std::string const &)*arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6343,12 +6256,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_1(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((unsigned char const *)arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6450,12 +6360,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1,(std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6490,12 +6397,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_1(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6563,12 +6467,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6603,12 +6504,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_1(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType((unsigned char const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6652,12 +6550,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_2(PyObject *self, Py_ssize { try { result = (int)Exiv2::ImageFactory::getType(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6746,12 +6641,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkMode(PyObject *self, PyObject *args { try { result = (Exiv2::AccessMode)Exiv2::ImageFactory::checkMode(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6802,12 +6694,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkType(PyObject *self, PyObject *args { try { result = (bool)Exiv2::ImageFactory::checkType(arg1,*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6833,12 +6722,9 @@ SWIGINTERN PyObject *_wrap_delete_ImageFactory(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/iptc_wrap.cxx b/src/swig-0_27_4/iptc_wrap.cxx index ff907d6a..4dfe0607 100644 --- a/src/swig-0_27_4/iptc_wrap.cxx +++ b/src/swig-0_27_4/iptc_wrap.cxx @@ -4149,6 +4149,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class IptcData_iterator_base { protected: @@ -5427,12 +5460,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5458,12 +5488,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5498,12 +5525,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Iptcdatum *)((IptcData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5529,12 +5553,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5568,12 +5589,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5613,12 +5631,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5649,12 +5664,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5762,12 +5774,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5804,12 +5813,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5836,12 +5842,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_recordName(PyObject *self, PyObject { try { result = (*arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5868,12 +5871,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_record(PyObject *self, PyObject *ar { try { result = (uint16_t)(*arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5900,12 +5900,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,12 +5929,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5964,12 +5958,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5996,12 +5987,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6028,12 +6016,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6060,12 +6045,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6096,12 +6078,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6128,12 +6107,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeSize(PyObject *self, PyObject * { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6202,12 +6178,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6242,12 +6215,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6311,12 +6281,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toLong__SWIG_0(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6343,12 +6310,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toLong__SWIG_1(PyObject *self, Py_s { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6412,12 +6376,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6444,12 +6405,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6513,12 +6471,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6545,12 +6500,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6606,12 +6558,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6660,12 +6609,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Iptcdatum_getValue__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6730,12 +6676,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6782,12 +6725,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6858,12 +6798,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6890,12 +6827,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6964,12 +6898,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6999,12 +6930,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7034,12 +6962,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::Iptcdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7107,12 +7032,9 @@ SWIGINTERN PyObject *_wrap_delete_Iptcdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7146,12 +7068,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7191,12 +7110,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7258,12 +7174,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7300,12 +7213,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7332,12 +7242,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_recordName(PyObject *self, PyObject *args) { try { result = ((Exiv2::Iptcdatum const *)arg1)->recordName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7364,12 +7271,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_record(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->record(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7396,12 +7300,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7428,12 +7329,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7460,12 +7358,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7492,12 +7387,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7524,12 +7416,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7556,12 +7445,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Iptcdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7592,12 +7478,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7624,12 +7507,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7698,12 +7578,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7738,12 +7615,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7807,12 +7681,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7839,12 +7710,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Iptcdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7908,12 +7776,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7940,12 +7805,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8009,12 +7871,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8041,12 +7900,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8102,12 +7958,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8143,12 +7996,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Iptcdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8195,12 +8045,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Iptcdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8278,12 +8125,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8348,12 +8192,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8449,12 +8290,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::IptcKey const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8492,12 +8330,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::Iptcdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8569,12 +8404,9 @@ SWIGINTERN PyObject *_wrap_IptcData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8629,12 +8461,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8660,12 +8489,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8765,12 +8591,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::IptcKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8822,12 +8645,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8871,12 +8691,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8983,12 +8800,9 @@ SWIGINTERN PyObject *_wrap_IptcData_size(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::IptcData const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9015,12 +8829,9 @@ SWIGINTERN PyObject *_wrap_IptcData_detectCharset(PyObject *self, PyObject *args { try { result = (char *)((Exiv2::IptcData const *)arg1)->detectCharset(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9062,12 +8873,9 @@ SWIGINTERN PyObject *_wrap_IptcData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Iptcdatum *) &Exiv2_IptcData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9122,12 +8930,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9182,12 +8987,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9233,12 +9035,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9280,12 +9079,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9383,12 +9179,9 @@ SWIGINTERN PyObject *_wrap_IptcData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_IptcData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9410,12 +9203,9 @@ SWIGINTERN int _wrap_new_IptcData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::IptcData *)new Exiv2::IptcData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9441,12 +9231,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/metadatum_wrap.cxx b/src/swig-0_27_4/metadatum_wrap.cxx index 0acb8509..253bf92d 100644 --- a/src/swig-0_27_4/metadatum_wrap.cxx +++ b/src/swig-0_27_4/metadatum_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -5083,12 +5116,9 @@ SWIGINTERN PyObject *_wrap_delete_Key(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5115,12 +5145,9 @@ SWIGINTERN PyObject *_wrap_Key_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5147,12 +5174,9 @@ SWIGINTERN PyObject *_wrap_Key_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Key const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5179,12 +5203,9 @@ SWIGINTERN PyObject *_wrap_Key_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5211,12 +5232,9 @@ SWIGINTERN PyObject *_wrap_Key_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5243,12 +5261,9 @@ SWIGINTERN PyObject *_wrap_Key_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5275,12 +5290,9 @@ SWIGINTERN PyObject *_wrap_Key_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Key const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5307,12 +5319,9 @@ SWIGINTERN PyObject *_wrap_Key_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5341,12 +5350,9 @@ SWIGINTERN PyObject *_wrap_Key___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Key___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5376,12 +5382,9 @@ SWIGINTERN PyObject *_wrap_delete_Metadatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5415,12 +5418,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5460,12 +5460,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5538,12 +5535,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5570,12 +5564,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5664,12 +5655,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5706,12 +5694,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5738,12 +5723,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Metadatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5770,12 +5752,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5802,12 +5781,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5834,12 +5810,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5866,12 +5839,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Metadatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5898,12 +5868,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Metadatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5934,12 +5901,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Metadatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5966,12 +5930,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5998,12 +5959,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_count(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->count(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6030,12 +5988,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_size(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Metadatum const *)arg1)->size(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6062,12 +6017,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6102,12 +6054,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6171,12 +6120,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Metadatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6203,12 +6149,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::Metadatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6272,12 +6215,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6304,12 +6244,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6373,12 +6310,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6405,12 +6339,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6466,12 +6397,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_getValue(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6507,12 +6435,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_value(PyObject *self, PyObject *args) { { try { result = (Exiv2::Value *) &((Exiv2::Metadatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6546,12 +6471,9 @@ SWIGINTERN PyObject *_wrap_Metadatum___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Metadatum___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/preview_wrap.cxx b/src/swig-0_27_4/preview_wrap.cxx index 5caf5bc8..4385db0d 100644 --- a/src/swig-0_27_4/preview_wrap.cxx +++ b/src/swig-0_27_4/preview_wrap.cxx @@ -4317,6 +4317,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + namespace swig { template struct noconst_traits { @@ -5739,12 +5772,9 @@ SWIGINTERN int _wrap_new_PreviewProperties(PyObject *self, PyObject *args, PyObj { try { result = (Exiv2::PreviewProperties *)new Exiv2::PreviewProperties(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5770,12 +5800,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewProperties(PyObject *self, PyObject *ar { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5809,12 +5836,9 @@ SWIGINTERN int _wrap_new_PreviewImage(PyObject *self, PyObject *args, PyObject * { try { result = (Exiv2::PreviewImage *)new Exiv2::PreviewImage((Exiv2::PreviewImage const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5840,12 +5864,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewImage(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5872,12 +5893,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::PreviewImage const *)arg1)->copy(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5971,12 +5989,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args { try { result = (long)((Exiv2::PreviewImage const *)arg1)->writeFile((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6145,12 +6160,9 @@ SWIGINTERN int _wrap_new_PreviewManager(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::PreviewManager *)new Exiv2::PreviewManager((Exiv2::Image const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6183,12 +6195,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewProperties(PyObject *self, P { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewProperties(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6228,12 +6237,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewImage(PyObject *self, PyObje { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewImage((Exiv2::PreviewProperties const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6259,12 +6265,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewManager(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/properties_wrap.cxx b/src/swig-0_27_4/properties_wrap.cxx index a8beb0fd..d0f0b4cb 100644 --- a/src/swig-0_27_4/properties_wrap.cxx +++ b/src/swig-0_27_4/properties_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* Py_IntEnum = NULL; @@ -4595,12 +4628,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_ns(PyObject *self, PyObject *args) { { try { result = Exiv2::XmpProperties::ns((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4636,12 +4666,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsDesc(PyObject *self, PyObject *args) { try { result = (char *)Exiv2::XmpProperties::nsDesc((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4677,12 +4704,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyList(PyObject *self, PyObject * { try { result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyList((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4720,12 +4744,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsInfo(PyObject *self, PyObject *args) { try { result = (Exiv2::XmpNsInfo *)Exiv2::XmpProperties::nsInfo((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4804,12 +4825,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registerNs(PyObject *self, PyObject *ar { try { Exiv2::XmpProperties::registerNs((std::string const &)*arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4844,12 +4862,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_0(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4869,12 +4884,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_1(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4926,12 +4938,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registeredNamespaces(PyObject *self, Py { try { Exiv2::XmpProperties::registeredNamespaces(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4974,12 +4983,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5026,12 +5032,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5065,12 +5068,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5285,12 +5285,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5319,12 +5316,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_ns(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->ns(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/tags_wrap.cxx b/src/swig-0_27_4/tags_wrap.cxx index 4ca2087e..05539f07 100644 --- a/src/swig-0_27_4/tags_wrap.cxx +++ b/src/swig-0_27_4/tags_wrap.cxx @@ -4137,6 +4137,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + class _TagListFct { private: Exiv2::TagListFct func; @@ -5010,12 +5043,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5057,12 +5087,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5094,12 +5121,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((Exiv2::ExifKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5390,12 +5414,9 @@ SWIGINTERN PyObject *_wrap_ExifKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifKey const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/types_wrap.cxx b/src/swig-0_27_4/types_wrap.cxx index c6ceb8d1..e4d495f3 100644 --- a/src/swig-0_27_4/types_wrap.cxx +++ b/src/swig-0_27_4/types_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan @@ -5308,12 +5341,9 @@ SWIGINTERN PyObject *_wrap__set_locale_dir(PyObject *self, PyObject *args) { { try { _set_locale_dir((char const *)arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5349,12 +5379,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeName(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::TypeInfo::typeName(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5388,12 +5415,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)Exiv2::TypeInfo::typeId((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5433,12 +5457,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeSize(PyObject *self, PyObject *args) { { try { result = (long)Exiv2::TypeInfo::typeSize(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5464,12 +5485,9 @@ SWIGINTERN PyObject *_wrap_delete_TypeInfo(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5490,12 +5508,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5522,12 +5537,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5560,12 +5572,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf((Exiv2::byte const *)arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5601,12 +5610,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5689,12 +5695,9 @@ SWIGINTERN PyObject *_wrap_delete_DataBuf(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5730,12 +5733,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_alloc(PyObject *self, PyObject *args) { { try { (arg1)->alloc(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5946,12 +5946,9 @@ SWIGINTERN PyObject *_wrap_DataBuf___getitem__(PyObject *self, PyObject *args) { { try { result = (PyObject *)Exiv2_DataBuf___getitem__(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6029,12 +6026,9 @@ SWIGINTERN PyObject *_wrap_exvGettext(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::exvGettext((char const *)arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6055,12 +6049,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6095,12 +6086,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6132,12 +6120,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >((std::pair< uint32_t,uint32_t > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6303,12 +6288,9 @@ SWIGINTERN PyObject *_wrap_delete_URational(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6329,12 +6311,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6369,12 +6348,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6406,12 +6382,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >((std::pair< int32_t,int32_t > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6577,12 +6550,9 @@ SWIGINTERN PyObject *_wrap_delete_Rational(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index 4873d60a..0023a0c3 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -4306,6 +4306,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -7427,12 +7460,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7478,12 +7508,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7563,12 +7590,9 @@ SWIGINTERN PyObject *_wrap_Value_setDataArea(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7626,12 +7650,9 @@ SWIGINTERN PyObject *_wrap_Value_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7705,12 +7726,9 @@ SWIGINTERN PyObject *_wrap_Value_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Value const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7789,12 +7807,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7829,12 +7844,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7898,12 +7910,9 @@ SWIGINTERN PyObject *_wrap_Value_toLong__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (long)((Exiv2::Value const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7930,12 +7939,9 @@ SWIGINTERN PyObject *_wrap_Value_toLong__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (long)((Exiv2::Value const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7999,12 +8005,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8031,12 +8034,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8100,12 +8100,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8132,12 +8129,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8193,12 +8187,9 @@ SWIGINTERN PyObject *_wrap_Value_sizeDataArea(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Value const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8225,12 +8216,9 @@ SWIGINTERN PyObject *_wrap_Value_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8292,12 +8280,9 @@ SWIGINTERN PyObject *_wrap_Value_create(PyObject *self, PyObject *args) { { try { result = Exiv2::Value::create(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8333,12 +8318,9 @@ SWIGINTERN PyObject *_wrap_Value___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Value___str__(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8381,12 +8363,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8455,12 +8434,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8545,12 +8521,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8596,12 +8569,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8665,12 +8635,9 @@ SWIGINTERN PyObject *_wrap_DataValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8737,12 +8704,9 @@ SWIGINTERN PyObject *_wrap_DataValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::DataValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8831,12 +8795,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8871,12 +8832,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DataValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8903,12 +8861,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DataValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8972,12 +8927,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9004,12 +8956,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9073,12 +9022,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9105,12 +9051,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9169,12 +9112,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new_Exiv2_DataValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9289,12 +9229,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_0(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9355,12 +9292,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_1(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9428,12 +9362,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::StringValueBase const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9500,12 +9431,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_copy(PyObject *self, PyObject *args) { try { result = (long)((Exiv2::StringValueBase const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9592,12 +9520,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toLong__SWIG_0(PyObject *self, Py_ssi { try { result = (long)((Exiv2::StringValueBase const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9624,12 +9549,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toLong__SWIG_1(PyObject *self, Py_ssi { try { result = (long)((Exiv2::StringValueBase const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9693,12 +9615,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_0(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9725,12 +9644,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_1(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9794,12 +9710,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_0(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9826,12 +9739,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_1(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9945,12 +9855,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9982,12 +9889,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10036,12 +9940,9 @@ SWIGINTERN PyObject *_wrap_StringValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::StringValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10073,12 +9974,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new_Exiv2_StringValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10141,12 +10039,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new Exiv2::AsciiValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10225,12 +10120,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10276,12 +10168,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10345,12 +10234,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::AsciiValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10384,12 +10270,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_1((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10421,12 +10304,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10489,12 +10369,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10526,12 +10403,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10593,12 +10467,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10659,12 +10530,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10732,12 +10600,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::CommentValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10804,12 +10669,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::CommentValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10855,12 +10717,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment((char const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10889,12 +10748,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10965,12 +10821,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_detectCharset(PyObject *self, PyObject * { try { result = (char *)((Exiv2::CommentValue const *)arg1)->detectCharset(*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10999,12 +10852,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_charsetId(PyObject *self, PyObject *args { try { result = (Exiv2::CommentValue::CharsetId)((Exiv2::CommentValue const *)arg1)->charsetId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11098,12 +10948,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new_Exiv2_CommentValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11283,12 +11130,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::XmpValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11474,12 +11318,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11525,12 +11366,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11608,12 +11446,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11645,12 +11480,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11711,12 +11543,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11762,12 +11591,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11831,12 +11657,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpTextValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11915,12 +11738,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toLong__SWIG_0(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::XmpTextValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11947,12 +11767,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toLong__SWIG_1(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::XmpTextValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12016,12 +11833,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12048,12 +11862,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12117,12 +11928,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12149,12 +11957,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12213,12 +12018,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new_Exiv2_XmpTextValue__SWIG_2((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12405,12 +12207,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12456,12 +12255,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12525,12 +12321,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpArrayValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12590,12 +12383,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12630,12 +12420,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toLong__SWIG_0(PyObject *self, Py_ssize { try { result = (long)((Exiv2::XmpArrayValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12662,12 +12449,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toLong__SWIG_1(PyObject *self, Py_ssize { try { result = (long)((Exiv2::XmpArrayValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12731,12 +12515,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12763,12 +12544,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12832,12 +12610,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12864,12 +12639,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12928,12 +12700,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_0((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12980,12 +12749,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_1(SWIG_STD_MOVE(arg1),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13022,12 +12788,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_2(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13192,12 +12955,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13229,12 +12989,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue((std::string const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13295,12 +13052,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13346,12 +13100,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13415,12 +13166,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::LangAltValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13478,12 +13226,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13523,12 +13268,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13602,12 +13344,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toLong__SWIG_0(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::LangAltValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13634,12 +13373,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toLong__SWIG_1(PyObject *self, Py_ssize_ { try { result = (long)((Exiv2::LangAltValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13703,12 +13439,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13735,12 +13468,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13804,12 +13534,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13836,12 +13563,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13899,12 +13623,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_2(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14145,12 +13866,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14253,12 +13971,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14301,12 +14016,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(arg1,arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14385,12 +14097,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14436,12 +14145,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14526,12 +14232,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setDate((Exiv2::DateValue::Date const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14558,12 +14261,9 @@ SWIGINTERN PyObject *_wrap_DateValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DateValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14630,12 +14330,9 @@ SWIGINTERN PyObject *_wrap_DateValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::DateValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14672,12 +14369,9 @@ SWIGINTERN PyObject *_wrap_DateValue_getDate(PyObject *self, PyObject *args) { { try { result = (Exiv2::DateValue::Date *) &((Exiv2::DateValue const *)arg1)->getDate(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14757,12 +14451,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DateValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14789,12 +14480,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::DateValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14858,12 +14546,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14890,12 +14575,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14959,12 +14641,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14991,12 +14670,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15066,12 +14742,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_2(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15121,12 +14794,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_DateValue_setDate__SWIG_1(arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15185,12 +14855,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15301,12 +14968,9 @@ SWIGINTERN int _wrap_new_Date(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::DateValue::Date *)new Exiv2::DateValue::Date(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15506,12 +15170,9 @@ SWIGINTERN PyObject *_wrap_delete_Date(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15534,12 +15195,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15613,12 +15271,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(arg1,arg2,arg3,arg4,arg5); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15697,12 +15352,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15748,12 +15400,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15842,12 +15491,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setTime((Exiv2::TimeValue::Time const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15874,12 +15520,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::TimeValue const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15946,12 +15589,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::TimeValue const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15988,12 +15628,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_getTime(PyObject *self, PyObject *args) { { try { result = (Exiv2::TimeValue::Time *) &((Exiv2::TimeValue const *)arg1)->getTime(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16074,12 +15711,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::TimeValue const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16106,12 +15740,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::TimeValue const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16175,12 +15806,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16207,12 +15835,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16276,12 +15901,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16308,12 +15930,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16387,12 +16006,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_2(*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16473,12 +16089,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_TimeValue_setTime__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16537,12 +16150,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_3((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16653,12 +16263,9 @@ SWIGINTERN int _wrap_new_Time(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::TimeValue::Time *)new Exiv2::TimeValue::Time(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16972,12 +16579,9 @@ SWIGINTERN PyObject *_wrap_delete_Time(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17018,12 +16622,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17087,12 +16688,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17145,12 +16743,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((unsigned short const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17180,12 +16775,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::ValueType< unsigned short > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17211,12 +16803,9 @@ SWIGINTERN PyObject *_wrap_delete_UShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17270,12 +16859,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17321,12 +16907,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17400,12 +16983,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17438,12 +17018,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17505,12 +17082,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17599,12 +17173,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17639,12 +17210,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17671,12 +17239,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17740,12 +17305,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17772,12 +17334,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17841,12 +17400,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17873,12 +17429,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17934,12 +17487,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = (long)((Exiv2::ValueType< uint16_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17966,12 +17516,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18004,12 +17551,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18038,12 +17582,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18295,12 +17836,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18364,12 +17902,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18422,12 +17957,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((unsigned int const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18457,12 +17989,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::ValueType< unsigned int > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18488,12 +18017,9 @@ SWIGINTERN PyObject *_wrap_delete_ULongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18547,12 +18073,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18598,12 +18121,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18677,12 +18197,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18715,12 +18232,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18782,12 +18296,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18876,12 +18387,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18916,12 +18424,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18948,12 +18453,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19017,12 +18519,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19049,12 +18548,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19118,12 +18614,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19150,12 +18643,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19211,12 +18701,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< uint32_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19243,12 +18730,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19281,12 +18765,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19315,12 +18796,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19572,12 +19050,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19641,12 +19116,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19702,12 +19174,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((std::pair< unsigned int,unsigned int > const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19739,12 +19208,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::ValueType< std::pair< unsigned int,unsigned int > > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19770,12 +19236,9 @@ SWIGINTERN PyObject *_wrap_delete_URationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19829,12 +19292,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_0(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19880,12 +19340,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_1(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19959,12 +19416,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_setDataArea(PyObject *self, PyObject * { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19997,12 +19451,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20064,12 +19515,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20158,12 +19606,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toString(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20198,12 +19643,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toLong__SWIG_0(PyObject *self, Py_ssiz { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20230,12 +19672,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toLong__SWIG_1(PyObject *self, Py_ssiz { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20299,12 +19738,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_0(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20331,12 +19767,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_1(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20400,12 +19833,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_0(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20432,12 +19862,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_1(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20493,12 +19920,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_sizeDataArea(PyObject *self, PyObject { try { result = (long)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20525,12 +19949,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_dataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20563,12 +19984,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20597,12 +20015,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20848,12 +20263,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20917,12 +20329,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20975,12 +20384,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((short const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21010,12 +20416,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::ValueType< short > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21041,12 +20444,9 @@ SWIGINTERN PyObject *_wrap_delete_ShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21100,12 +20500,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21151,12 +20548,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21230,12 +20624,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21268,12 +20659,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21335,12 +20723,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21429,12 +20814,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21469,12 +20851,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21501,12 +20880,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21570,12 +20946,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21602,12 +20975,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21671,12 +21041,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21703,12 +21070,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21764,12 +21128,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< int16_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21796,12 +21157,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21834,12 +21192,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21868,12 +21223,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22125,12 +21477,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22194,12 +21543,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22252,12 +21598,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((int const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22287,12 +21630,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::ValueType< int > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22318,12 +21658,9 @@ SWIGINTERN PyObject *_wrap_delete_LongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22377,12 +21714,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22428,12 +21762,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22507,12 +21838,9 @@ SWIGINTERN PyObject *_wrap_LongValue_setDataArea(PyObject *self, PyObject *args) { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22545,12 +21873,9 @@ SWIGINTERN PyObject *_wrap_LongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22612,12 +21937,9 @@ SWIGINTERN PyObject *_wrap_LongValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22706,12 +22028,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22746,12 +22065,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toLong__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22778,12 +22094,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toLong__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22847,12 +22160,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22879,12 +22189,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22948,12 +22255,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22980,12 +22284,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23041,12 +22342,9 @@ SWIGINTERN PyObject *_wrap_LongValue_sizeDataArea(PyObject *self, PyObject *args { try { result = (long)((Exiv2::ValueType< int32_t > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23073,12 +22371,9 @@ SWIGINTERN PyObject *_wrap_LongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23111,12 +22406,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23145,12 +22437,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23402,12 +22691,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23471,12 +22757,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23532,12 +22815,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((std::pair< int,int > const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23569,12 +22849,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::ValueType< std::pair< int,int > > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23600,12 +22877,9 @@ SWIGINTERN PyObject *_wrap_delete_RationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23659,12 +22933,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23710,12 +22981,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23789,12 +23057,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_setDataArea(PyObject *self, PyObject *a { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23827,12 +23092,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23894,12 +23156,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23988,12 +23247,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24028,12 +23284,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toLong__SWIG_0(PyObject *self, Py_ssize { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24060,12 +23313,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toLong__SWIG_1(PyObject *self, Py_ssize { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24129,12 +23379,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24161,12 +23408,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24230,12 +23474,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24262,12 +23503,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24323,12 +23561,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_sizeDataArea(PyObject *self, PyObject * { try { result = (long)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24355,12 +23590,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_dataArea(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24393,12 +23625,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24427,12 +23656,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24678,12 +23904,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24747,12 +23970,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24805,12 +24025,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((float const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24840,12 +24057,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::ValueType< float > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24871,12 +24085,9 @@ SWIGINTERN PyObject *_wrap_delete_FloatValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24930,12 +24141,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24981,12 +24189,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25060,12 +24265,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25098,12 +24300,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25165,12 +24364,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25259,12 +24455,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25299,12 +24492,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25331,12 +24521,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25400,12 +24587,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25432,12 +24616,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25501,12 +24682,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25533,12 +24711,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25594,12 +24769,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = (long)((Exiv2::ValueType< float > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25626,12 +24798,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25664,12 +24833,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25698,12 +24864,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25955,12 +25118,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26024,12 +25184,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26082,12 +25239,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((double const &)*arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26117,12 +25271,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::ValueType< double > const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26148,12 +25299,9 @@ SWIGINTERN PyObject *_wrap_delete_DoubleValue(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26207,12 +25355,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26258,12 +25403,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26337,12 +25479,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26375,12 +25514,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< double > const *)arg1)->clone(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26442,12 +25578,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26536,12 +25669,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26576,12 +25706,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toLong__SWIG_0(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26608,12 +25735,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toLong__SWIG_1(PyObject *self, Py_ssize_t { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26677,12 +25801,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26709,12 +25830,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26778,12 +25896,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26810,12 +25925,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26871,12 +25983,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = (long)((Exiv2::ValueType< double > const *)arg1)->sizeDataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26903,12 +26012,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->dataArea(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26941,12 +26047,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26975,12 +26078,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/version_wrap.cxx b/src/swig-0_27_4/version_wrap.cxx index d23f5d20..f7586faf 100644 --- a/src/swig-0_27_4/version_wrap.cxx +++ b/src/swig-0_27_4/version_wrap.cxx @@ -4118,6 +4118,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* versionInfo() { bool nls = false; bool bmff = false; @@ -4383,12 +4416,9 @@ SWIGINTERN PyObject *_wrap_versionInfo(PyObject *self, PyObject *args) { { try { result = (PyObject *)versionInfo(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4407,12 +4437,9 @@ SWIGINTERN PyObject *_wrap_versionNumber(PyObject *self, PyObject *args) { { try { result = (int)Exiv2::versionNumber(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4431,12 +4458,9 @@ SWIGINTERN PyObject *_wrap_versionString(PyObject *self, PyObject *args) { { try { result = Exiv2::versionString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4455,12 +4479,9 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args { try { result = Exiv2::versionNumberHexString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4479,12 +4500,9 @@ SWIGINTERN PyObject *_wrap_version(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::version(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4528,12 +4546,9 @@ SWIGINTERN PyObject *_wrap_testVersion(PyObject *self, PyObject *args) { { try { result = (bool)Exiv2::testVersion(arg1,arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_27_4/xmp_wrap.cxx b/src/swig-0_27_4/xmp_wrap.cxx index ce0a85e1..9da02582 100644 --- a/src/swig-0_27_4/xmp_wrap.cxx +++ b/src/swig-0_27_4/xmp_wrap.cxx @@ -4153,6 +4153,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + catch(Exiv2::AnyError const& e) { + + + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class XmpData_iterator_base { protected: @@ -5377,12 +5410,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_base___str__(PyObject *self, PyObjec { try { result = (arg1)->__str__(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5408,12 +5438,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator_base(PyObject *self, PyObject { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5448,12 +5475,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator___deref__(PyObject *self, PyObject * { try { result = (Exiv2::Xmpdatum *)((XmpData_iterator const *)arg1)->operator ->(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5479,12 +5503,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator(PyObject *self, PyObject *arg { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5518,12 +5539,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_0(PyObject *self, Py_ { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5563,12 +5581,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_1(PyObject *self, Py_ { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5599,12 +5614,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_2(PyObject *self, Py_ { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5712,12 +5724,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_copy(PyObject *self, PyObject *args) { try { result = (long)(*arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5754,12 +5763,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5786,12 +5792,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5818,12 +5821,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_groupName(PyObject *self, PyObject * { try { result = (*arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5850,12 +5850,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagName(PyObject *self, PyObject *ar { try { result = (*arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5882,12 +5879,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagLabel(PyObject *self, PyObject *a { try { result = (*arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5914,12 +5908,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5946,12 +5937,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeId(PyObject *self, PyObject *arg { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5982,12 +5970,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6014,12 +5999,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeSize(PyObject *self, PyObject *a { try { result = (long)(*arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6088,12 +6070,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6128,12 +6107,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_1(PyObject *self, Py_ { try { result = (*arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6197,12 +6173,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toLong__SWIG_0(PyObject *self, Py_ss { try { result = (long)(*arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6229,12 +6202,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toLong__SWIG_1(PyObject *self, Py_ss { try { result = (long)(*arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6298,12 +6268,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_0(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6330,12 +6297,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_1(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6399,12 +6363,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_0(PyObject *self, P { try { result = (*arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6431,12 +6392,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_1(PyObject *self, P { try { result = (*arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6492,12 +6450,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6546,12 +6501,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_1(PyObject *self, Py_ { try { result = Exiv2_Xmpdatum_getValue__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6616,12 +6568,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_0(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &(*arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6668,12 +6617,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_1(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6744,12 +6690,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_0(PyObject *self, Py_ss { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6776,12 +6719,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_1(PyObject *self, Py_ss { try { result = (*arg1)->print(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6850,12 +6790,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1,(Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6885,12 +6822,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6920,12 +6854,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::Xmpdatum const &)*arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6993,12 +6924,9 @@ SWIGINTERN PyObject *_wrap_delete_Xmpdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7032,12 +6960,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7077,12 +7002,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7144,12 +7066,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_copy(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->copy(arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7186,12 +7105,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->key(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7218,12 +7134,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->familyName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7250,12 +7163,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->groupName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7282,12 +7192,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7314,12 +7221,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagLabel(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7346,12 +7250,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Xmpdatum const *)arg1)->tag(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7378,12 +7279,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Xmpdatum const *)arg1)->typeId(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7414,12 +7312,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->typeName(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7446,12 +7341,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeSize(PyObject *self, PyObject *args) { { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->typeSize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7520,12 +7412,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7560,12 +7449,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7629,12 +7515,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toLong__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->toLong(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7661,12 +7544,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toLong__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (long)((Exiv2::Xmpdatum const *)arg1)->toLong(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7730,12 +7610,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7762,12 +7639,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7831,12 +7705,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_0(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7863,12 +7734,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_1(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7924,12 +7792,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->getValue(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7965,12 +7830,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &((Exiv2::Xmpdatum const *)arg1)->value(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8017,12 +7879,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Xmpdatum_getValue__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8100,12 +7959,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8170,12 +8026,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8245,12 +8098,9 @@ SWIGINTERN int _wrap_new_XmpData(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XmpData *)new Exiv2::XmpData(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8296,12 +8146,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::XmpKey const &)*arg2,(Exiv2::Value const *)arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8339,12 +8186,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::Xmpdatum const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8416,12 +8260,9 @@ SWIGINTERN PyObject *_wrap_XmpData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8469,12 +8310,9 @@ SWIGINTERN PyObject *_wrap_XmpData_eraseFamily(PyObject *self, PyObject *args) { { try { (arg1)->eraseFamily(*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8520,12 +8358,9 @@ SWIGINTERN PyObject *_wrap_XmpData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8625,12 +8460,9 @@ SWIGINTERN PyObject *_wrap_XmpData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::XmpKey const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8708,12 +8540,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_0(PyObject *self, Py_ssize_t { try { result = (bool)((Exiv2::XmpData const *)arg1)->usePacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8748,12 +8577,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_1(PyObject *self, Py_ssize_t { try { result = (bool)(arg1)->usePacket(arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8823,12 +8649,9 @@ SWIGINTERN PyObject *_wrap_XmpData_setPacket(PyObject *self, PyObject *args) { { try { (arg1)->setPacket((std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8857,12 +8680,9 @@ SWIGINTERN PyObject *_wrap_XmpData_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &((Exiv2::XmpData const *)arg1)->xmpPacket(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8904,12 +8724,9 @@ SWIGINTERN PyObject *_wrap_XmpData___getitem__(PyObject *self, PyObject *args) { { try { result = (Exiv2::Xmpdatum *) &Exiv2_XmpData___getitem__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8964,12 +8781,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_0(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9024,12 +8838,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_1(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9075,12 +8886,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_2(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9122,12 +8930,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_3(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9225,12 +9030,9 @@ SWIGINTERN PyObject *_wrap_XmpData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_XmpData___contains__(arg1,(std::string const &)*arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9258,12 +9060,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9305,12 +9104,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_0(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1,arg2); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9336,12 +9132,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_1(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9360,12 +9153,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_2(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9418,12 +9208,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_terminate(PyObject *self, PyObject *args) { { try { Exiv2::XmpParser::terminate(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9443,12 +9230,9 @@ SWIGINTERN int _wrap_new_XmpParser(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::XmpParser *)new Exiv2::XmpParser(); - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9474,12 +9258,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpParser(PyObject *self, PyObject *args) { { try { delete arg1; - - } catch(Exiv2::AnyError const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/basicio_wrap.cxx b/src/swig-0_28_0/basicio_wrap.cxx index 95229b12..4bf752e3 100644 --- a/src/swig-0_28_0/basicio_wrap.cxx +++ b/src/swig-0_28_0/basicio_wrap.cxx @@ -4128,6 +4128,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static int Exiv2_BasicIo_getbuff( PyObject* exporter, Py_buffer* view, int flags) { Exiv2::BasicIo* self = 0; @@ -4845,14 +4878,9 @@ SWIGINTERN PyObject *_wrap_delete_BasicIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4883,14 +4911,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4921,14 +4944,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4974,14 +4992,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5030,14 +5043,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_write__SWIG_1(PyObject *self, PyObject *args) result = (arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5115,14 +5123,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5162,14 +5165,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5231,14 +5229,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args) result = (arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5310,14 +5303,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5359,14 +5347,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5420,14 +5403,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5472,14 +5450,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5516,14 +5489,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5550,14 +5518,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_tell(PyObject *self, PyObject *args) { { try { result = ((Exiv2::BasicIo const *)arg1)->tell(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5584,14 +5547,9 @@ SWIGINTERN PyObject *_wrap_BasicIo_size(PyObject *self, PyObject *args) { { try { result = ((Exiv2::BasicIo const *)arg1)->size(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5724,14 +5682,9 @@ SWIGINTERN int _wrap_new_FileIo(PyObject *self, PyObject *args, PyObject *kwargs { try { result = (Exiv2::FileIo *)new Exiv2::FileIo((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5759,14 +5712,9 @@ SWIGINTERN PyObject *_wrap_delete_FileIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5811,14 +5759,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_0(PyObject *self, PyObject *args) { result = (int)(arg1)->open((std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5851,14 +5794,9 @@ SWIGINTERN PyObject *_wrap_FileIo_open__SWIG_1(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5924,14 +5862,9 @@ SWIGINTERN PyObject *_wrap_FileIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5977,14 +5910,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6033,14 +5961,9 @@ SWIGINTERN PyObject *_wrap_FileIo_write__SWIG_1(PyObject *self, PyObject *args) result = (arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6118,14 +6041,9 @@ SWIGINTERN PyObject *_wrap_FileIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6165,14 +6083,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_0(PyObject *self, PyObject *args) { result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6234,14 +6147,9 @@ SWIGINTERN PyObject *_wrap_FileIo_read__SWIG_1(PyObject *self, PyObject *args) { result = (arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6313,14 +6221,9 @@ SWIGINTERN PyObject *_wrap_FileIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6362,14 +6265,9 @@ SWIGINTERN PyObject *_wrap_FileIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6423,14 +6321,9 @@ SWIGINTERN PyObject *_wrap_FileIo_seek(PyObject *self, PyObject *args) { result = (int)(arg1)->seek(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6475,14 +6368,9 @@ SWIGINTERN PyObject *_wrap_FileIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6519,14 +6407,9 @@ SWIGINTERN PyObject *_wrap_FileIo_munmap(PyObject *self, PyObject *args) { result = (int)(arg1)->munmap(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6571,14 +6454,9 @@ SWIGINTERN PyObject *_wrap_FileIo_setPath(PyObject *self, PyObject *args) { { try { (arg1)->setPath((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6611,14 +6489,9 @@ SWIGINTERN PyObject *_wrap_FileIo_tell(PyObject *self, PyObject *args) { result = ((Exiv2::FileIo const *)arg1)->tell(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6649,14 +6522,9 @@ SWIGINTERN PyObject *_wrap_FileIo_size(PyObject *self, PyObject *args) { result = ((Exiv2::FileIo const *)arg1)->size(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6770,14 +6638,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6812,14 +6675,9 @@ SWIGINTERN int _wrap_new_MemIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::MemIo *)new Exiv2::MemIo((Exiv2::byte const *)arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6893,14 +6751,9 @@ SWIGINTERN PyObject *_wrap_delete_MemIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7103,14 +6956,9 @@ SWIGINTERN PyObject *_wrap_MemIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7272,14 +7120,9 @@ SWIGINTERN PyObject *_wrap_MemIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7321,14 +7164,9 @@ SWIGINTERN PyObject *_wrap_MemIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7607,14 +7445,9 @@ SWIGINTERN int _wrap_new_XPathIo(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XPathIo *)new Exiv2::XPathIo((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7642,14 +7475,9 @@ SWIGINTERN PyObject *_wrap_delete_XPathIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7691,14 +7519,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7736,14 +7559,9 @@ SWIGINTERN PyObject *_wrap_XPathIo_writeDataToFile(PyObject *self, PyObject *arg { try { result = Exiv2::XPathIo::writeDataToFile((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7767,14 +7585,9 @@ SWIGINTERN int _wrap_new_RemoteIo(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::RemoteIo *)new Exiv2::RemoteIo(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7800,14 +7613,9 @@ SWIGINTERN PyObject *_wrap_delete_RemoteIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7838,14 +7646,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_open(PyObject *self, PyObject *args) { result = (int)(arg1)->open(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7876,14 +7679,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_close(PyObject *self, PyObject *args) { result = (int)(arg1)->close(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7929,14 +7727,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_0(PyObject *self, PyObject *args result = (arg1)->write((Exiv2::byte const *)arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7985,14 +7778,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_write__SWIG_1(PyObject *self, PyObject *args result = (arg1)->write(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8070,14 +7858,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_putb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->putb(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8117,14 +7900,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_0(PyObject *self, PyObject *args) result = (arg1)->read(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8186,14 +7964,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_read__SWIG_1(PyObject *self, PyObject *args) result = (arg1)->read(arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8265,14 +8038,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_getb(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->getb(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8314,14 +8082,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_transfer(PyObject *self, PyObject *args) { (arg1)->transfer(*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8410,14 +8173,9 @@ SWIGINTERN PyObject *_wrap_RemoteIo_mmap(PyObject *self, PyObject *args) { result = (Exiv2::byte *)(arg1)->mmap(arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8628,14 +8386,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_0(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8676,14 +8429,9 @@ SWIGINTERN int _wrap_new_HttpIo__SWIG_1(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::HttpIo *)new Exiv2::HttpIo((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8745,14 +8493,9 @@ SWIGINTERN PyObject *_wrap_delete_HttpIo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/datasets_wrap.cxx b/src/swig-0_28_0/datasets_wrap.cxx index 5981c9ae..9b1bf263 100644 --- a/src/swig-0_28_0/datasets_wrap.cxx +++ b/src/swig-0_28_0/datasets_wrap.cxx @@ -4136,6 +4136,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #define SWIG_From_long PyInt_FromLong @@ -4737,14 +4770,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_dataSet(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::dataSet((std::string const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4860,14 +4888,9 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_recordId(PyObject *self, PyObject *args) { try { result = (uint16_t)Exiv2::IptcDataSets::recordId((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4928,14 +4951,9 @@ SWIGINTERN int _wrap_new_IptcKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::IptcKey *)new Exiv2::IptcKey(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/easyaccess_wrap.cxx b/src/swig-0_28_0/easyaccess_wrap.cxx index 943e8d2d..85b121cf 100644 --- a/src/swig-0_28_0/easyaccess_wrap.cxx +++ b/src/swig-0_28_0/easyaccess_wrap.cxx @@ -4105,6 +4105,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; + +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + #ifdef __cplusplus extern "C" { #endif @@ -4133,14 +4166,9 @@ SWIGINTERN PyObject *_wrap_orientation(PyObject *self, PyObject *args) { { try { result = Exiv2::orientation((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4182,14 +4210,9 @@ SWIGINTERN PyObject *_wrap_isoSpeed(PyObject *self, PyObject *args) { { try { result = Exiv2::isoSpeed((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4231,14 +4254,9 @@ SWIGINTERN PyObject *_wrap_dateTimeOriginal(PyObject *self, PyObject *args) { { try { result = Exiv2::dateTimeOriginal((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4280,14 +4298,9 @@ SWIGINTERN PyObject *_wrap_flashBias(PyObject *self, PyObject *args) { { try { result = Exiv2::flashBias((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4329,14 +4342,9 @@ SWIGINTERN PyObject *_wrap_exposureMode(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureMode((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4378,14 +4386,9 @@ SWIGINTERN PyObject *_wrap_sceneMode(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneMode((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4427,14 +4430,9 @@ SWIGINTERN PyObject *_wrap_macroMode(PyObject *self, PyObject *args) { { try { result = Exiv2::macroMode((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4476,14 +4474,9 @@ SWIGINTERN PyObject *_wrap_imageQuality(PyObject *self, PyObject *args) { { try { result = Exiv2::imageQuality((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4525,14 +4518,9 @@ SWIGINTERN PyObject *_wrap_whiteBalance(PyObject *self, PyObject *args) { { try { result = Exiv2::whiteBalance((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4574,14 +4562,9 @@ SWIGINTERN PyObject *_wrap_lensName(PyObject *self, PyObject *args) { { try { result = Exiv2::lensName((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4623,14 +4606,9 @@ SWIGINTERN PyObject *_wrap_saturation(PyObject *self, PyObject *args) { { try { result = Exiv2::saturation((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4672,14 +4650,9 @@ SWIGINTERN PyObject *_wrap_sharpness(PyObject *self, PyObject *args) { { try { result = Exiv2::sharpness((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4721,14 +4694,9 @@ SWIGINTERN PyObject *_wrap_contrast(PyObject *self, PyObject *args) { { try { result = Exiv2::contrast((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4770,14 +4738,9 @@ SWIGINTERN PyObject *_wrap_sceneCaptureType(PyObject *self, PyObject *args) { { try { result = Exiv2::sceneCaptureType((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4819,14 +4782,9 @@ SWIGINTERN PyObject *_wrap_meteringMode(PyObject *self, PyObject *args) { { try { result = Exiv2::meteringMode((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4868,14 +4826,9 @@ SWIGINTERN PyObject *_wrap_make(PyObject *self, PyObject *args) { { try { result = Exiv2::make((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4917,14 +4870,9 @@ SWIGINTERN PyObject *_wrap_model(PyObject *self, PyObject *args) { { try { result = Exiv2::model((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4966,14 +4914,9 @@ SWIGINTERN PyObject *_wrap_exposureTime(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureTime((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5015,14 +4958,9 @@ SWIGINTERN PyObject *_wrap_fNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::fNumber((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5064,14 +5002,9 @@ SWIGINTERN PyObject *_wrap_shutterSpeedValue(PyObject *self, PyObject *args) { { try { result = Exiv2::shutterSpeedValue((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5113,14 +5046,9 @@ SWIGINTERN PyObject *_wrap_apertureValue(PyObject *self, PyObject *args) { { try { result = Exiv2::apertureValue((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5162,14 +5090,9 @@ SWIGINTERN PyObject *_wrap_brightnessValue(PyObject *self, PyObject *args) { { try { result = Exiv2::brightnessValue((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5211,14 +5134,9 @@ SWIGINTERN PyObject *_wrap_exposureBiasValue(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureBiasValue((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5260,14 +5178,9 @@ SWIGINTERN PyObject *_wrap_maxApertureValue(PyObject *self, PyObject *args) { { try { result = Exiv2::maxApertureValue((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5309,14 +5222,9 @@ SWIGINTERN PyObject *_wrap_subjectDistance(PyObject *self, PyObject *args) { { try { result = Exiv2::subjectDistance((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5358,14 +5266,9 @@ SWIGINTERN PyObject *_wrap_lightSource(PyObject *self, PyObject *args) { { try { result = Exiv2::lightSource((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5407,14 +5310,9 @@ SWIGINTERN PyObject *_wrap_flash(PyObject *self, PyObject *args) { { try { result = Exiv2::flash((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5456,14 +5354,9 @@ SWIGINTERN PyObject *_wrap_serialNumber(PyObject *self, PyObject *args) { { try { result = Exiv2::serialNumber((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5505,14 +5398,9 @@ SWIGINTERN PyObject *_wrap_focalLength(PyObject *self, PyObject *args) { { try { result = Exiv2::focalLength((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5554,14 +5442,9 @@ SWIGINTERN PyObject *_wrap_subjectArea(PyObject *self, PyObject *args) { { try { result = Exiv2::subjectArea((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5603,14 +5486,9 @@ SWIGINTERN PyObject *_wrap_flashEnergy(PyObject *self, PyObject *args) { { try { result = Exiv2::flashEnergy((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5652,14 +5530,9 @@ SWIGINTERN PyObject *_wrap_exposureIndex(PyObject *self, PyObject *args) { { try { result = Exiv2::exposureIndex((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5701,14 +5574,9 @@ SWIGINTERN PyObject *_wrap_sensingMethod(PyObject *self, PyObject *args) { { try { result = Exiv2::sensingMethod((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5750,14 +5618,9 @@ SWIGINTERN PyObject *_wrap_afPoint(PyObject *self, PyObject *args) { { try { result = Exiv2::afPoint((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/exif_wrap.cxx b/src/swig-0_28_0/exif_wrap.cxx index 5f198e86..8e9b3d55 100644 --- a/src/swig-0_28_0/exif_wrap.cxx +++ b/src/swig-0_28_0/exif_wrap.cxx @@ -4150,6 +4150,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class ExifData_iterator_base { protected: @@ -5621,14 +5654,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5654,14 +5682,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5696,14 +5719,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Exifdatum *)((ExifData_iterator const *)arg1)->operator ->(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5729,14 +5747,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5770,14 +5783,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5817,14 +5825,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5855,14 +5858,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5953,14 +5951,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_setDataArea(PyObject *self, PyObjec { try { result = (int)(*arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5993,14 +5986,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6027,14 +6015,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6061,14 +6044,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6095,14 +6073,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6129,14 +6102,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6163,14 +6131,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tagDesc(PyObject *self, PyObject *a { try { result = (*arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6197,14 +6160,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6231,14 +6189,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_ifdName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->ifdName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6265,14 +6218,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_idx(PyObject *self, PyObject *args) { try { result = (int)(*arg1)->idx(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6332,14 +6280,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args { try { result = (*arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6376,14 +6319,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6414,14 +6352,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6448,14 +6381,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_typeSize(PyObject *self, PyObject * { try { result = (*arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6524,14 +6452,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6566,14 +6489,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6637,14 +6555,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toInt64__SWIG_0(PyObject *self, Py_ { try { result = (int64_t)(*arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6671,14 +6584,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toInt64__SWIG_1(PyObject *self, Py_ { try { result = (int64_t)(*arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6742,14 +6650,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6776,14 +6679,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6847,14 +6745,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6881,14 +6774,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6944,14 +6832,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7000,14 +6883,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Exifdatum_getValue__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7072,14 +6950,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7126,14 +6999,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1((Exiv2::Exifdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7196,14 +7064,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_sizeDataArea(PyObject *self, PyObje { try { result = (*arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7230,14 +7093,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_dataArea(PyObject *self, PyObject * { try { result = (*arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7275,14 +7133,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7309,14 +7162,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7380,14 +7228,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toUint32__SWIG_0(PyObject *self, Py { try { result = (uint32_t)(*arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7414,14 +7257,9 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_toUint32__SWIG_1(PyObject *self, Py { try { result = (uint32_t)(*arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7490,14 +7328,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1,(Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7527,14 +7360,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::ExifKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7564,14 +7392,9 @@ SWIGINTERN int _wrap_new_Exifdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Exifdatum *)new Exiv2::Exifdatum((Exiv2::Exifdatum const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7639,14 +7462,9 @@ SWIGINTERN PyObject *_wrap_delete_Exifdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7680,14 +7498,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7727,14 +7540,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7779,14 +7587,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setDataArea(PyObject *self, PyObject *args) { try { result = (int)((Exiv2::Exifdatum const *)arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7819,14 +7622,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7853,14 +7651,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7887,14 +7680,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7921,14 +7709,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7955,14 +7738,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7989,14 +7767,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8023,14 +7796,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Exifdatum const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8057,14 +7825,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_ifdName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->ifdName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8091,14 +7854,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_idx(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::Exifdatum const *)arg1)->idx(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8158,14 +7916,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8202,14 +7955,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Exifdatum const *)arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8240,14 +7988,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Exifdatum const *)arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8274,14 +8017,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_typeSize(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8350,14 +8088,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8392,14 +8125,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8463,14 +8191,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Exifdatum const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8497,14 +8220,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Exifdatum const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8568,14 +8286,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8602,14 +8315,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Exifdatum const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8673,14 +8381,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8707,14 +8410,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Exifdatum const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8770,14 +8468,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Exifdatum const *)arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8813,14 +8506,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Exifdatum const *)arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8854,14 +8542,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_sizeDataArea(PyObject *self, PyObject *args { try { result = ((Exiv2::Exifdatum const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8888,14 +8571,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Exifdatum const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8938,14 +8616,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Exifdatum_getValue__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9023,14 +8696,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Exifdatum_value__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9095,14 +8763,9 @@ SWIGINTERN PyObject *_wrap_Exifdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Exifdatum_setValue__SWIG_2(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9184,14 +8847,9 @@ SWIGINTERN int _wrap_new_ExifThumbC(PyObject *self, PyObject *args, PyObject *kw { try { result = (Exiv2::ExifThumbC *)new Exiv2::ExifThumbC((Exiv2::ExifData const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9218,14 +8876,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifThumbC const *)arg1)->copy(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9275,14 +8928,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_writeFile(PyObject *self, PyObject *args) { try { result = ((Exiv2::ExifThumbC const *)arg1)->writeFile((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9311,14 +8959,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_mimeType(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->mimeType(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9345,14 +8988,9 @@ SWIGINTERN PyObject *_wrap_ExifThumbC_extension(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::ExifThumbC const *)arg1)->extension(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9378,14 +9016,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumbC(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9419,14 +9052,9 @@ SWIGINTERN int _wrap_new_ExifThumb(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::ExifThumb *)new Exiv2::ExifThumb(*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9504,14 +9132,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_0(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2,arg3,arg4,arg5); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9581,14 +9204,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_1(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3,arg4,arg5,arg6); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9638,14 +9256,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_2(PyObject *self, Py { try { (arg1)->setJpegThumbnail((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9687,14 +9300,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_setJpegThumbnail__SWIG_3(PyObject *self, Py { try { (arg1)->setJpegThumbnail((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9781,14 +9389,9 @@ SWIGINTERN PyObject *_wrap_ExifThumb_erase(PyObject *self, PyObject *args) { { try { (arg1)->erase(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9814,14 +9417,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifThumb(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9868,14 +9466,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::ExifKey const &)*arg2,(Exiv2::Value const *)arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9912,14 +9505,9 @@ SWIGINTERN PyObject *_wrap_ExifData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { (arg1)->add((Exiv2::Exifdatum const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9989,14 +9577,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10060,14 +9643,9 @@ SWIGINTERN PyObject *_wrap_ExifData_erase__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (arg1)->erase(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10151,14 +9729,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10184,14 +9757,9 @@ SWIGINTERN PyObject *_wrap_ExifData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10291,14 +9859,9 @@ SWIGINTERN PyObject *_wrap_ExifData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::ExifKey const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10391,14 +9954,9 @@ SWIGINTERN PyObject *_wrap_ExifData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Exifdatum *) &Exiv2_ExifData___getitem__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10453,14 +10011,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10515,14 +10068,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10568,14 +10116,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10617,14 +10160,9 @@ SWIGINTERN PyObject *_wrap_ExifData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_ExifData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10722,14 +10260,9 @@ SWIGINTERN PyObject *_wrap_ExifData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_ExifData___contains__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10751,14 +10284,9 @@ SWIGINTERN int _wrap_new_ExifData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::ExifData *)new Exiv2::ExifData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10784,14 +10312,9 @@ SWIGINTERN PyObject *_wrap_delete_ExifData(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/image_wrap.cxx b/src/swig-0_28_0/image_wrap.cxx index a2544e88..603e64de 100644 --- a/src/swig-0_28_0/image_wrap.cxx +++ b/src/swig-0_28_0/image_wrap.cxx @@ -4162,6 +4162,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static bool enableBMFF(bool enable) { #ifdef EXV_ENABLE_BMFF return Exiv2::enableBMFF(enable); @@ -4831,14 +4864,9 @@ SWIGINTERN PyObject *_wrap_enableBMFF(PyObject *self, PyObject *args) { { try { result = (bool)enableBMFF(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4864,14 +4892,9 @@ SWIGINTERN PyObject *_wrap_delete_Image(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4901,14 +4924,9 @@ SWIGINTERN PyObject *_wrap_Image_readMetadata(PyObject *self, PyObject *args) { (arg1)->readMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4938,14 +4956,9 @@ SWIGINTERN PyObject *_wrap_Image_writeMetadata(PyObject *self, PyObject *args) { (arg1)->writeMetadata(); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4989,14 +5002,9 @@ SWIGINTERN PyObject *_wrap_Image_setExifData(PyObject *self, PyObject *args) { { try { (arg1)->setExifData((Exiv2::ExifData const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5022,14 +5030,9 @@ SWIGINTERN PyObject *_wrap_Image_clearExifData(PyObject *self, PyObject *args) { { try { (arg1)->clearExifData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5068,14 +5071,9 @@ SWIGINTERN PyObject *_wrap_Image_setIptcData(PyObject *self, PyObject *args) { { try { (arg1)->setIptcData((Exiv2::IptcData const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5101,14 +5099,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIptcData(PyObject *self, PyObject *args) { { try { (arg1)->clearIptcData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5149,14 +5142,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpPacket(PyObject *self, PyObject *args) { { try { (arg1)->setXmpPacket((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5184,14 +5172,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpPacket(PyObject *self, PyObject *args) { try { (arg1)->clearXmpPacket(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5230,14 +5213,9 @@ SWIGINTERN PyObject *_wrap_Image_setXmpData(PyObject *self, PyObject *args) { { try { (arg1)->setXmpData((Exiv2::XmpData const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5263,14 +5241,9 @@ SWIGINTERN PyObject *_wrap_Image_clearXmpData(PyObject *self, PyObject *args) { { try { (arg1)->clearXmpData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5311,14 +5284,9 @@ SWIGINTERN PyObject *_wrap_Image_setComment(PyObject *self, PyObject *args) { { try { (arg1)->setComment((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5346,14 +5314,9 @@ SWIGINTERN PyObject *_wrap_Image_clearComment(PyObject *self, PyObject *args) { { try { (arg1)->clearComment(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5406,14 +5369,9 @@ SWIGINTERN PyObject *_wrap_Image_setIccProfile(PyObject *self, PyObject *args) { { try { (arg1)->setIccProfile((Exiv2::DataBuf &&)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5439,14 +5397,9 @@ SWIGINTERN PyObject *_wrap_Image_clearIccProfile(PyObject *self, PyObject *args) { try { (arg1)->clearIccProfile(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5473,14 +5426,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfileDefined(PyObject *self, PyObject *arg { try { result = (bool)(arg1)->iccProfileDefined(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5507,14 +5455,9 @@ SWIGINTERN PyObject *_wrap_Image_iccProfile(PyObject *self, PyObject *args) { { try { result = (Exiv2::DataBuf *) &((Exiv2::Image const *)arg1)->iccProfile(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5558,14 +5501,9 @@ SWIGINTERN PyObject *_wrap_Image_setMetadata(PyObject *self, PyObject *args) { { try { (arg1)->setMetadata((Exiv2::Image const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5591,14 +5529,9 @@ SWIGINTERN PyObject *_wrap_Image_clearMetadata(PyObject *self, PyObject *args) { { try { (arg1)->clearMetadata(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5625,14 +5558,9 @@ SWIGINTERN PyObject *_wrap_Image_exifData(PyObject *self, PyObject *args) { { try { result = (Exiv2::ExifData *) &(arg1)->exifData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5664,14 +5592,9 @@ SWIGINTERN PyObject *_wrap_Image_iptcData(PyObject *self, PyObject *args) { { try { result = (Exiv2::IptcData *) &(arg1)->iptcData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5703,14 +5626,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpData(PyObject *self, PyObject *args) { { try { result = (Exiv2::XmpData *) &(arg1)->xmpData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5742,14 +5660,9 @@ SWIGINTERN PyObject *_wrap_Image_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &(arg1)->xmpPacket(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5783,14 +5696,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_0(PyObject *self, Py_s { try { (arg1)->writeXmpFromPacket(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5831,14 +5739,9 @@ SWIGINTERN PyObject *_wrap_Image_setByteOrder(PyObject *self, PyObject *args) { { try { (arg1)->setByteOrder(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5865,14 +5768,9 @@ SWIGINTERN PyObject *_wrap_Image_byteOrder(PyObject *self, PyObject *args) { { try { result = (Exiv2::ByteOrder)((Exiv2::Image const *)arg1)->byteOrder(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5903,14 +5801,9 @@ SWIGINTERN PyObject *_wrap_Image_good(PyObject *self, PyObject *args) { { try { result = (bool)((Exiv2::Image const *)arg1)->good(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5937,14 +5830,9 @@ SWIGINTERN PyObject *_wrap_Image_mimeType(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->mimeType(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5971,14 +5859,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelWidth(PyObject *self, PyObject *args) { { try { result = (uint32_t)((Exiv2::Image const *)arg1)->pixelWidth(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6005,14 +5888,9 @@ SWIGINTERN PyObject *_wrap_Image_pixelHeight(PyObject *self, PyObject *args) { { try { result = (uint32_t)((Exiv2::Image const *)arg1)->pixelHeight(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6039,14 +5917,9 @@ SWIGINTERN PyObject *_wrap_Image_comment(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Image const *)arg1)->comment(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6073,14 +5946,9 @@ SWIGINTERN PyObject *_wrap_Image_io(PyObject *self, PyObject *args) { { try { result = (Exiv2::BasicIo *) &((Exiv2::Image const *)arg1)->io(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6127,14 +5995,9 @@ SWIGINTERN PyObject *_wrap_Image_checkMode(PyObject *self, PyObject *args) { { try { result = (Exiv2::AccessMode)((Exiv2::Image const *)arg1)->checkMode(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6180,14 +6043,9 @@ SWIGINTERN PyObject *_wrap_Image_supportsMetadata(PyObject *self, PyObject *args { try { result = (bool)((Exiv2::Image const *)arg1)->supportsMetadata(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6214,14 +6072,9 @@ SWIGINTERN PyObject *_wrap_Image_writeXmpFromPacket__SWIG_1(PyObject *self, Py_s { try { result = (bool)((Exiv2::Image const *)arg1)->writeXmpFromPacket(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6298,14 +6151,9 @@ SWIGINTERN PyObject *_wrap_Image_setTypeSupported(PyObject *self, PyObject *args { try { (arg1)->setTypeSupported(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6332,14 +6180,9 @@ SWIGINTERN PyObject *_wrap_Image_imageType(PyObject *self, PyObject *args) { { try { result = (Exiv2::ImageType)((Exiv2::Image const *)arg1)->imageType(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6396,14 +6239,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_createIo(PyObject *self, PyObject *args) { try { result = Exiv2::ImageFactory::createIo((std::string const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6461,14 +6299,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_0(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((std::string const &)*arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6509,14 +6342,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_open__SWIG_1(PyObject *self, Py_ssize_t result = Exiv2::ImageFactory::open((unsigned char const *)arg1,SWIG_STD_MOVE(arg2)); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6623,14 +6451,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_0(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1,(std::string const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6670,14 +6493,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_create__SWIG_1(PyObject *self, Py_ssize_ result = Exiv2::ImageFactory::create(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6745,14 +6563,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_0(PyObject *self, Py_ssize { try { result = (Exiv2::ImageType)Exiv2::ImageFactory::getType((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6791,14 +6604,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_1(PyObject *self, Py_ssize { try { result = (Exiv2::ImageType)Exiv2::ImageFactory::getType((unsigned char const *)arg1,SWIG_STD_MOVE(arg2)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6846,14 +6654,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_getType__SWIG_2(PyObject *self, Py_ssize { try { result = (Exiv2::ImageType)Exiv2::ImageFactory::getType(*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6951,14 +6754,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkMode(PyObject *self, PyObject *args { try { result = (Exiv2::AccessMode)Exiv2::ImageFactory::checkMode(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7014,14 +6812,9 @@ SWIGINTERN PyObject *_wrap_ImageFactory_checkType(PyObject *self, PyObject *args { try { result = (bool)Exiv2::ImageFactory::checkType(arg1,*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7041,14 +6834,9 @@ SWIGINTERN int _wrap_new_ImageFactory(PyObject *self, PyObject *args, PyObject * { try { result = (Exiv2::ImageFactory *)new Exiv2::ImageFactory(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7074,14 +6862,9 @@ SWIGINTERN PyObject *_wrap_delete_ImageFactory(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/iptc_wrap.cxx b/src/swig-0_28_0/iptc_wrap.cxx index a8d6b1f3..53a866b1 100644 --- a/src/swig-0_28_0/iptc_wrap.cxx +++ b/src/swig-0_28_0/iptc_wrap.cxx @@ -4149,6 +4149,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class IptcData_iterator_base { protected: @@ -5537,14 +5570,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_base___str__(PyObject *self, PyObje { try { result = (arg1)->__str__(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5570,14 +5598,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator_base(PyObject *self, PyObjec { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5612,14 +5635,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator___deref__(PyObject *self, PyObject { try { result = (Exiv2::Iptcdatum *)((IptcData_iterator const *)arg1)->operator ->(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5645,14 +5663,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData_iterator(PyObject *self, PyObject *ar { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5686,14 +5699,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_0(PyObject *self, Py { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5733,14 +5741,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_1(PyObject *self, Py { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5771,14 +5774,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_setValue__SWIG_2(PyObject *self, Py { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5886,14 +5884,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args { try { result = (*arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5930,14 +5923,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5964,14 +5952,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_recordName(PyObject *self, PyObject { try { result = (*arg1)->recordName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5998,14 +5981,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_record(PyObject *self, PyObject *ar { try { result = (uint16_t)(*arg1)->record(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6032,14 +6010,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6066,14 +6039,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_groupName(PyObject *self, PyObject { try { result = (*arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6100,14 +6068,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagName(PyObject *self, PyObject *a { try { result = (*arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6134,14 +6097,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagLabel(PyObject *self, PyObject * { try { result = (*arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6168,14 +6126,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tagDesc(PyObject *self, PyObject *a { try { result = (*arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6202,14 +6155,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6236,14 +6184,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeId(PyObject *self, PyObject *ar { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6274,14 +6217,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeName(PyObject *self, PyObject * { try { result = (char *)(*arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6308,14 +6246,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_typeSize(PyObject *self, PyObject * { try { result = (*arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6384,14 +6317,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_0(PyObject *self, Py { try { result = (*arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6426,14 +6354,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toString__SWIG_1(PyObject *self, Py { try { result = (*arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6497,14 +6420,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toInt64__SWIG_0(PyObject *self, Py_ { try { result = (int64_t)(*arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6531,14 +6449,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toInt64__SWIG_1(PyObject *self, Py_ { try { result = (int64_t)(*arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6602,14 +6515,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_0(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6636,14 +6544,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toFloat__SWIG_1(PyObject *self, Py_ { try { result = (float)(*arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6707,14 +6610,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_0(PyObject *self, { try { result = (*arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6741,14 +6639,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toRational__SWIG_1(PyObject *self, { try { result = (*arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6804,14 +6697,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_0(PyObject *self, Py { try { result = (*arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6860,14 +6748,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_getValue__SWIG_1(PyObject *self, Py { try { result = Exiv2_Iptcdatum_getValue__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6932,14 +6815,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_0(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &(*arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6986,14 +6864,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_value__SWIG_1(PyObject *self, Py_ss { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1((Exiv2::Iptcdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7064,14 +6937,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_0(PyObject *self, Py_s { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7098,14 +6966,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator__print__SWIG_1(PyObject *self, Py_s { try { result = (*arg1)->print(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7169,14 +7032,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toUint32__SWIG_0(PyObject *self, Py { try { result = (uint32_t)(*arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7203,14 +7061,9 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_toUint32__SWIG_1(PyObject *self, Py { try { result = (uint32_t)(*arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7279,14 +7132,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1,(Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7316,14 +7164,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::IptcKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7353,14 +7196,9 @@ SWIGINTERN int _wrap_new_Iptcdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::Iptcdatum *)new Exiv2::Iptcdatum((Exiv2::Iptcdatum const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7428,14 +7266,9 @@ SWIGINTERN PyObject *_wrap_delete_Iptcdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7469,14 +7302,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7516,14 +7344,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7585,14 +7408,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7629,14 +7447,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7663,14 +7476,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_recordName(PyObject *self, PyObject *args) { try { result = ((Exiv2::Iptcdatum const *)arg1)->recordName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7697,14 +7505,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_record(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->record(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7731,14 +7534,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7765,14 +7563,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7799,14 +7592,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7833,14 +7621,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7867,14 +7650,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7901,14 +7679,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Iptcdatum const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7935,14 +7708,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Iptcdatum const *)arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7973,14 +7741,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Iptcdatum const *)arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8007,14 +7770,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_typeSize(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Iptcdatum const *)arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8083,14 +7841,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8125,14 +7878,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8196,14 +7944,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Iptcdatum const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8230,14 +7973,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Iptcdatum const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8301,14 +8039,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8335,14 +8068,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Iptcdatum const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8406,14 +8134,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8440,14 +8163,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Iptcdatum const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8503,14 +8221,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Iptcdatum const *)arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8546,14 +8259,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &((Exiv2::Iptcdatum const *)arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8600,14 +8308,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Iptcdatum_getValue__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8685,14 +8388,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_value__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (Exiv2::Value *) &Exiv2_Iptcdatum_value__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8757,14 +8455,9 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Iptcdatum_setValue__SWIG_2(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8860,14 +8553,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::IptcKey const &)*arg2,(Exiv2::Value const *)arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8905,14 +8593,9 @@ SWIGINTERN PyObject *_wrap_IptcData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (int)(arg1)->add((Exiv2::Iptcdatum const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8984,14 +8667,9 @@ SWIGINTERN PyObject *_wrap_IptcData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9046,14 +8724,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9079,14 +8752,9 @@ SWIGINTERN PyObject *_wrap_IptcData_sortByTag(PyObject *self, PyObject *args) { { try { (arg1)->sortByTag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9186,14 +8854,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::IptcKey const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9245,14 +8908,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9296,14 +8954,9 @@ SWIGINTERN PyObject *_wrap_IptcData_findId__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (arg1)->findId(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9410,14 +9063,9 @@ SWIGINTERN PyObject *_wrap_IptcData_size(PyObject *self, PyObject *args) { { try { result = ((Exiv2::IptcData const *)arg1)->size(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9444,14 +9092,9 @@ SWIGINTERN PyObject *_wrap_IptcData_detectCharset(PyObject *self, PyObject *args { try { result = (char *)((Exiv2::IptcData const *)arg1)->detectCharset(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9493,14 +9136,9 @@ SWIGINTERN PyObject *_wrap_IptcData___getitem__(PyObject *self, PyObject *args) { try { result = (Exiv2::Iptcdatum *) &Exiv2_IptcData___getitem__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9555,14 +9193,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_0(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9617,14 +9250,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_1(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9670,14 +9298,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_2(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9719,14 +9342,9 @@ SWIGINTERN PyObject *_wrap_IptcData___setitem____SWIG_3(PyObject *self, Py_ssize { try { result = (PyObject *)Exiv2_IptcData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9824,14 +9442,9 @@ SWIGINTERN PyObject *_wrap_IptcData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_IptcData___contains__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9853,14 +9466,9 @@ SWIGINTERN int _wrap_new_IptcData(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::IptcData *)new Exiv2::IptcData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9886,14 +9494,9 @@ SWIGINTERN PyObject *_wrap_delete_IptcData(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/metadatum_wrap.cxx b/src/swig-0_28_0/metadatum_wrap.cxx index ab296e2c..a63c214d 100644 --- a/src/swig-0_28_0/metadatum_wrap.cxx +++ b/src/swig-0_28_0/metadatum_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -5245,14 +5278,9 @@ SWIGINTERN PyObject *_wrap_delete_Key(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5279,14 +5307,9 @@ SWIGINTERN PyObject *_wrap_Key_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5313,14 +5336,9 @@ SWIGINTERN PyObject *_wrap_Key_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Key const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5347,14 +5365,9 @@ SWIGINTERN PyObject *_wrap_Key_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5381,14 +5394,9 @@ SWIGINTERN PyObject *_wrap_Key_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5415,14 +5423,9 @@ SWIGINTERN PyObject *_wrap_Key_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5449,14 +5452,9 @@ SWIGINTERN PyObject *_wrap_Key_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5483,14 +5481,9 @@ SWIGINTERN PyObject *_wrap_Key_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Key const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5517,14 +5510,9 @@ SWIGINTERN PyObject *_wrap_Key_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Key const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5553,14 +5541,9 @@ SWIGINTERN PyObject *_wrap_Key___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Key___str__(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5590,14 +5573,9 @@ SWIGINTERN PyObject *_wrap_delete_Metadatum(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5631,14 +5609,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5678,14 +5651,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5758,14 +5726,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print((Exiv2::ExifData const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5792,14 +5755,9 @@ SWIGINTERN PyObject *_wrap_Metadatum__print__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Metadatum const *)arg1)->print(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5888,14 +5846,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,14 +5885,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5966,14 +5914,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_familyName(PyObject *self, PyObject *args) { try { result = (char *)((Exiv2::Metadatum const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6000,14 +5943,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6034,14 +5972,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6068,14 +6001,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6102,14 +6030,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6136,14 +6059,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Metadatum const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6170,14 +6088,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Metadatum const *)arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6208,14 +6121,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Metadatum const *)arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6242,14 +6150,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_typeSize(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6276,14 +6179,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_count(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->count(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6310,14 +6208,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_size(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->size(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6344,14 +6237,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6386,14 +6274,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Metadatum const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6457,14 +6340,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Metadatum const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6491,14 +6369,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::Metadatum const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6562,14 +6435,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toUint32__SWIG_0(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::Metadatum const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6596,14 +6464,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toUint32__SWIG_1(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::Metadatum const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6667,14 +6530,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6701,14 +6559,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::Metadatum const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6772,14 +6625,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6806,14 +6654,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::Metadatum const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6869,14 +6712,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_getValue(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Metadatum const *)arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6912,14 +6750,9 @@ SWIGINTERN PyObject *_wrap_Metadatum_value(PyObject *self, PyObject *args) { { try { result = (Exiv2::Value *) &((Exiv2::Metadatum const *)arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6953,14 +6786,9 @@ SWIGINTERN PyObject *_wrap_Metadatum___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Metadatum___str__(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/preview_wrap.cxx b/src/swig-0_28_0/preview_wrap.cxx index 314c1a12..f2b5b90c 100644 --- a/src/swig-0_28_0/preview_wrap.cxx +++ b/src/swig-0_28_0/preview_wrap.cxx @@ -4317,6 +4317,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + namespace swig { template struct noconst_traits { @@ -5739,14 +5772,9 @@ SWIGINTERN int _wrap_new_PreviewProperties(PyObject *self, PyObject *args, PyObj { try { result = (Exiv2::PreviewProperties *)new Exiv2::PreviewProperties(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5772,14 +5800,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewProperties(PyObject *self, PyObject *ar { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5813,14 +5836,9 @@ SWIGINTERN int _wrap_new_PreviewImage(PyObject *self, PyObject *args, PyObject * { try { result = (Exiv2::PreviewImage *)new Exiv2::PreviewImage((Exiv2::PreviewImage const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5846,14 +5864,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewImage(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5880,14 +5893,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::PreviewImage const *)arg1)->copy(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5981,14 +5989,9 @@ SWIGINTERN PyObject *_wrap_PreviewImage_writeFile(PyObject *self, PyObject *args { try { result = ((Exiv2::PreviewImage const *)arg1)->writeFile((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6157,14 +6160,9 @@ SWIGINTERN int _wrap_new_PreviewManager(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::PreviewManager *)new Exiv2::PreviewManager((Exiv2::Image const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6197,14 +6195,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewProperties(PyObject *self, P { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewProperties(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6244,14 +6237,9 @@ SWIGINTERN PyObject *_wrap_PreviewManager_getPreviewImage(PyObject *self, PyObje { try { result = ((Exiv2::PreviewManager const *)arg1)->getPreviewImage((Exiv2::PreviewProperties const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6277,14 +6265,9 @@ SWIGINTERN PyObject *_wrap_delete_PreviewManager(PyObject *self, PyObject *args) { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/properties_wrap.cxx b/src/swig-0_28_0/properties_wrap.cxx index 9ab052c0..66ccf093 100644 --- a/src/swig-0_28_0/properties_wrap.cxx +++ b/src/swig-0_28_0/properties_wrap.cxx @@ -4139,6 +4139,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* Py_IntEnum = NULL; @@ -4595,14 +4628,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_ns(PyObject *self, PyObject *args) { { try { result = Exiv2::XmpProperties::ns((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4638,14 +4666,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsDesc(PyObject *self, PyObject *args) { try { result = (char *)Exiv2::XmpProperties::nsDesc((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4681,14 +4704,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_propertyList(PyObject *self, PyObject * { try { result = (Exiv2::XmpPropertyInfo *)Exiv2::XmpProperties::propertyList((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4726,14 +4744,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_nsInfo(PyObject *self, PyObject *args) { try { result = (Exiv2::XmpNsInfo *)Exiv2::XmpProperties::nsInfo((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4812,14 +4825,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registerNs(PyObject *self, PyObject *ar { try { Exiv2::XmpProperties::registerNs((std::string const &)*arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4854,14 +4862,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_0(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4881,14 +4884,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_unregisterNs__SWIG_1(PyObject *self, Py { try { Exiv2::XmpProperties::unregisterNs(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4940,14 +4938,9 @@ SWIGINTERN PyObject *_wrap_XmpProperties_registeredNamespaces(PyObject *self, Py { try { Exiv2::XmpProperties::registeredNamespaces(*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4978,14 +4971,9 @@ SWIGINTERN int _wrap_new_XmpProperties(PyObject *self, PyObject *args, PyObject { try { result = (Exiv2::XmpProperties *)new Exiv2::XmpProperties(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5017,14 +5005,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5071,14 +5054,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((std::string const &)*arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5112,14 +5090,9 @@ SWIGINTERN int _wrap_new_XmpKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObje { try { result = (Exiv2::XmpKey *)new Exiv2::XmpKey((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5313,14 +5286,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5368,14 +5336,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5404,14 +5367,9 @@ SWIGINTERN PyObject *_wrap_XmpKey_ns(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpKey const *)arg1)->ns(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/tags_wrap.cxx b/src/swig-0_28_0/tags_wrap.cxx index 7628f546..31533f9e 100644 --- a/src/swig-0_28_0/tags_wrap.cxx +++ b/src/swig-0_28_0/tags_wrap.cxx @@ -4137,6 +4137,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* Py_IntEnum = NULL; @@ -5134,14 +5167,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5183,14 +5211,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5222,14 +5245,9 @@ SWIGINTERN int _wrap_new_ExifKey__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::ExifKey *)new Exiv2::ExifKey((Exiv2::ExifKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5520,14 +5538,9 @@ SWIGINTERN PyObject *_wrap_ExifKey_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ExifKey const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/types_wrap.cxx b/src/swig-0_28_0/types_wrap.cxx index cb1b3001..5a73ec66 100644 --- a/src/swig-0_28_0/types_wrap.cxx +++ b/src/swig-0_28_0/types_wrap.cxx @@ -4138,6 +4138,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + #ifdef EXV_ENABLE_NLS #if defined _WIN32 && !defined __CYGWIN__ // Avoid needing to find libintl.h probably installed with Conan @@ -5344,14 +5377,9 @@ SWIGINTERN PyObject *_wrap__set_locale_dir(PyObject *self, PyObject *args) { { try { _set_locale_dir((char const *)arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5387,14 +5415,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeName(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::TypeInfo::typeName(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5428,14 +5451,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)Exiv2::TypeInfo::typeId((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5475,14 +5493,9 @@ SWIGINTERN PyObject *_wrap_TypeInfo_typeSize(PyObject *self, PyObject *args) { { try { result = Exiv2::TypeInfo::typeSize(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5502,14 +5515,9 @@ SWIGINTERN int _wrap_new_TypeInfo(PyObject *self, PyObject *args, PyObject *kwar { try { result = (Exiv2::TypeInfo *)new Exiv2::TypeInfo(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5535,14 +5543,9 @@ SWIGINTERN PyObject *_wrap_delete_TypeInfo(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5563,14 +5566,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5597,14 +5595,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5637,14 +5630,9 @@ SWIGINTERN int _wrap_new_DataBuf__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObj { try { result = (Exiv2::DataBuf *)new Exiv2::DataBuf((Exiv2::byte const *)arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5730,14 +5718,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_alloc(PyObject *self, PyObject *args) { { try { (arg1)->alloc(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5773,14 +5756,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_resize(PyObject *self, PyObject *args) { { try { (arg1)->resize(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5871,14 +5849,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_cmpBytes(PyObject *self, PyObject *args) { { try { result = (int)((Exiv2::DataBuf const *)arg1)->cmpBytes(arg2,(void const *)arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5934,14 +5907,9 @@ SWIGINTERN PyObject *_wrap_DataBuf_empty(PyObject *self, PyObject *args) { { try { result = (bool)((Exiv2::DataBuf const *)arg1)->empty(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5988,14 +5956,9 @@ SWIGINTERN PyObject *_wrap_delete_DataBuf(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6029,14 +5992,9 @@ SWIGINTERN PyObject *_wrap_exvGettext(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::exvGettext((char const *)arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6057,14 +6015,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6099,14 +6052,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6138,14 +6086,9 @@ SWIGINTERN int _wrap_new_URational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (std::pair< uint32_t,uint32_t > *)new std::pair< uint32_t,uint32_t >((std::pair< uint32_t,uint32_t > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6311,14 +6254,9 @@ SWIGINTERN PyObject *_wrap_delete_URational(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6339,14 +6277,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6381,14 +6314,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6420,14 +6348,9 @@ SWIGINTERN int _wrap_new_Rational__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (std::pair< int32_t,int32_t > *)new std::pair< int32_t,int32_t >((std::pair< int32_t,int32_t > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6593,14 +6516,9 @@ SWIGINTERN PyObject *_wrap_delete_Rational(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 7fe4462d..6feb0fa5 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -4306,6 +4306,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* _get_enum_list(int dummy, ...) { va_list args; @@ -7530,14 +7563,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7583,14 +7611,9 @@ SWIGINTERN PyObject *_wrap_Value_read__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7670,14 +7693,9 @@ SWIGINTERN PyObject *_wrap_Value_setDataArea(PyObject *self, PyObject *args) { { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7735,14 +7753,9 @@ SWIGINTERN PyObject *_wrap_Value_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7816,14 +7829,9 @@ SWIGINTERN PyObject *_wrap_Value_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7902,14 +7910,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7944,14 +7947,9 @@ SWIGINTERN PyObject *_wrap_Value_toString__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = ((Exiv2::Value const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8015,14 +8013,9 @@ SWIGINTERN PyObject *_wrap_Value_toInt64__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (int64_t)((Exiv2::Value const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8049,14 +8042,9 @@ SWIGINTERN PyObject *_wrap_Value_toInt64__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (int64_t)((Exiv2::Value const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8120,14 +8108,9 @@ SWIGINTERN PyObject *_wrap_Value_toUint32__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (uint32_t)((Exiv2::Value const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8154,14 +8137,9 @@ SWIGINTERN PyObject *_wrap_Value_toUint32__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (uint32_t)((Exiv2::Value const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8225,14 +8203,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8259,14 +8232,9 @@ SWIGINTERN PyObject *_wrap_Value_toFloat__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (float)((Exiv2::Value const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8330,14 +8298,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_0(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8364,14 +8327,9 @@ SWIGINTERN PyObject *_wrap_Value_toRational__SWIG_1(PyObject *self, Py_ssize_t n { try { result = ((Exiv2::Value const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8427,14 +8385,9 @@ SWIGINTERN PyObject *_wrap_Value_sizeDataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8461,14 +8414,9 @@ SWIGINTERN PyObject *_wrap_Value_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Value const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8530,14 +8478,9 @@ SWIGINTERN PyObject *_wrap_Value_create(PyObject *self, PyObject *args) { { try { result = Exiv2::Value::create(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8573,14 +8516,9 @@ SWIGINTERN PyObject *_wrap_Value___str__(PyObject *self, PyObject *args) { { try { result = Exiv2_Value___str__(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8623,14 +8561,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8699,14 +8632,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new Exiv2::DataValue((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8771,14 +8699,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8824,14 +8747,9 @@ SWIGINTERN PyObject *_wrap_DataValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8895,14 +8813,9 @@ SWIGINTERN PyObject *_wrap_DataValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8969,14 +8882,9 @@ SWIGINTERN PyObject *_wrap_DataValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9065,14 +8973,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DataValue const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9107,14 +9010,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::DataValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9141,14 +9039,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::DataValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9212,14 +9105,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toUint32__SWIG_0(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::DataValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9246,14 +9134,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toUint32__SWIG_1(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::DataValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9317,14 +9200,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9351,14 +9229,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DataValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9422,14 +9295,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9456,14 +9324,9 @@ SWIGINTERN PyObject *_wrap_DataValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DataValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9522,14 +9385,9 @@ SWIGINTERN int _wrap_new_DataValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DataValue *)new_Exiv2_DataValue__SWIG_2((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9644,14 +9502,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_0(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9712,14 +9565,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_read__SWIG_1(PyObject *self, Py_ssize { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9787,14 +9635,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::StringValueBase const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9861,14 +9704,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_copy(PyObject *self, PyObject *args) { try { result = ((Exiv2::StringValueBase const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9955,14 +9793,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toInt64__SWIG_0(PyObject *self, Py_ss { try { result = (int64_t)((Exiv2::StringValueBase const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9989,14 +9822,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toInt64__SWIG_1(PyObject *self, Py_ss { try { result = (int64_t)((Exiv2::StringValueBase const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10060,14 +9888,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toUint32__SWIG_0(PyObject *self, Py_s { try { result = (uint32_t)((Exiv2::StringValueBase const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10094,14 +9917,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toUint32__SWIG_1(PyObject *self, Py_s { try { result = (uint32_t)((Exiv2::StringValueBase const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10165,14 +9983,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_0(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10199,14 +10012,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toFloat__SWIG_1(PyObject *self, Py_ss { try { result = (float)((Exiv2::StringValueBase const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10270,14 +10078,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_0(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10304,14 +10107,9 @@ SWIGINTERN PyObject *_wrap_StringValueBase_toRational__SWIG_1(PyObject *self, Py { try { result = ((Exiv2::StringValueBase const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10445,14 +10243,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10484,14 +10277,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new Exiv2::StringValue((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10520,14 +10308,9 @@ SWIGINTERN PyObject *_wrap_StringValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::StringValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10559,14 +10342,9 @@ SWIGINTERN int _wrap_new_StringValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::StringValue *)new_Exiv2_StringValue__SWIG_2((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10649,14 +10427,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new Exiv2::AsciiValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10715,14 +10488,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10768,14 +10536,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10839,14 +10602,9 @@ SWIGINTERN PyObject *_wrap_AsciiValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::AsciiValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10880,14 +10638,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_1((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -10919,14 +10672,9 @@ SWIGINTERN int _wrap_new_AsciiValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::AsciiValue *)new_Exiv2_AsciiValue__SWIG_2((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11009,14 +10757,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11048,14 +10791,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new Exiv2::CommentValue((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11097,14 +10835,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11165,14 +10898,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11240,14 +10968,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::CommentValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11314,14 +11037,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::CommentValue const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11367,14 +11085,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment((char const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11403,14 +11116,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_comment__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::CommentValue const *)arg1)->comment(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11481,14 +11189,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_detectCharset(PyObject *self, PyObject * { try { result = (char *)((Exiv2::CommentValue const *)arg1)->detectCharset(*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11517,14 +11220,9 @@ SWIGINTERN PyObject *_wrap_CommentValue_charsetId(PyObject *self, PyObject *args { try { result = (Exiv2::CommentValue::CharsetId)((Exiv2::CommentValue const *)arg1)->charsetId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11618,14 +11316,9 @@ SWIGINTERN int _wrap_new_CommentValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::CommentValue *)new_Exiv2_CommentValue__SWIG_2((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -11825,14 +11518,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpValue const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12018,14 +11706,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_0(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12071,14 +11754,9 @@ SWIGINTERN PyObject *_wrap_XmpValue_read__SWIG_1(PyObject *self, Py_ssize_t nobj { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12156,14 +11834,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12195,14 +11868,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new Exiv2::XmpTextValue((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12263,14 +11931,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12316,14 +11979,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12387,14 +12045,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpTextValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12473,14 +12126,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toInt64__SWIG_0(PyObject *self, Py_ssize { try { result = (int64_t)((Exiv2::XmpTextValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12507,14 +12155,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toInt64__SWIG_1(PyObject *self, Py_ssize { try { result = (int64_t)((Exiv2::XmpTextValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12578,14 +12221,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toUint32__SWIG_0(PyObject *self, Py_ssiz { try { result = (uint32_t)((Exiv2::XmpTextValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12612,14 +12250,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toUint32__SWIG_1(PyObject *self, Py_ssiz { try { result = (uint32_t)((Exiv2::XmpTextValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12683,14 +12316,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12717,14 +12345,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::XmpTextValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12788,14 +12411,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12822,14 +12440,9 @@ SWIGINTERN PyObject *_wrap_XmpTextValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::XmpTextValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -12888,14 +12501,9 @@ SWIGINTERN int _wrap_new_XmpTextValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpTextValue *)new_Exiv2_XmpTextValue__SWIG_2((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13082,14 +12690,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13135,14 +12738,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13206,14 +12804,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::XmpArrayValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13273,14 +12866,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13315,14 +12903,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toInt64__SWIG_0(PyObject *self, Py_ssiz { try { result = (int64_t)((Exiv2::XmpArrayValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13349,14 +12932,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toInt64__SWIG_1(PyObject *self, Py_ssiz { try { result = (int64_t)((Exiv2::XmpArrayValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13420,14 +12998,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toUint32__SWIG_0(PyObject *self, Py_ssi { try { result = (uint32_t)((Exiv2::XmpArrayValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13454,14 +13027,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toUint32__SWIG_1(PyObject *self, Py_ssi { try { result = (uint32_t)((Exiv2::XmpArrayValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13525,14 +13093,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13559,14 +13122,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::XmpArrayValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13630,14 +13188,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13664,14 +13217,9 @@ SWIGINTERN PyObject *_wrap_XmpArrayValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::XmpArrayValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13730,14 +13278,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_0((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13784,14 +13327,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_1(SWIG_STD_MOVE(arg1),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -13828,14 +13366,9 @@ SWIGINTERN int _wrap_new_XmpArrayValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::XmpArrayValue *)new_Exiv2_XmpArrayValue__SWIG_2(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14000,14 +13533,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14039,14 +13567,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new Exiv2::LangAltValue((std::string const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14107,14 +13630,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14160,14 +13678,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14231,14 +13744,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::LangAltValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14296,14 +13804,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14343,14 +13846,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toString__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::LangAltValue const *)arg1)->toString((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14424,14 +13922,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toInt64__SWIG_0(PyObject *self, Py_ssize { try { result = (int64_t)((Exiv2::LangAltValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14458,14 +13951,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toInt64__SWIG_1(PyObject *self, Py_ssize { try { result = (int64_t)((Exiv2::LangAltValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14529,14 +14017,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toUint32__SWIG_0(PyObject *self, Py_ssiz { try { result = (uint32_t)((Exiv2::LangAltValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14563,14 +14046,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toUint32__SWIG_1(PyObject *self, Py_ssiz { try { result = (uint32_t)((Exiv2::LangAltValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14634,14 +14112,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_0(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14668,14 +14141,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toFloat__SWIG_1(PyObject *self, Py_ssize { try { result = (float)((Exiv2::LangAltValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14739,14 +14207,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_0(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14773,14 +14236,9 @@ SWIGINTERN PyObject *_wrap_LangAltValue_toRational__SWIG_1(PyObject *self, Py_ss { try { result = ((Exiv2::LangAltValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -14838,14 +14296,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_2(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15086,14 +14539,9 @@ SWIGINTERN int _wrap_new_LangAltValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::LangAltValue *)new_Exiv2_LangAltValue__SWIG_3((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15196,14 +14644,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15246,14 +14689,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new Exiv2::DateValue(arg1,arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15312,14 +14750,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15365,14 +14798,9 @@ SWIGINTERN PyObject *_wrap_DateValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15457,14 +14885,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setDate((Exiv2::DateValue::Date const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15491,14 +14914,9 @@ SWIGINTERN PyObject *_wrap_DateValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DateValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15565,14 +14983,9 @@ SWIGINTERN PyObject *_wrap_DateValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::DateValue const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15609,14 +15022,9 @@ SWIGINTERN PyObject *_wrap_DateValue_getDate(PyObject *self, PyObject *args) { { try { result = (Exiv2::DateValue::Date *) &((Exiv2::DateValue const *)arg1)->getDate(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15696,14 +15104,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::DateValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15730,14 +15133,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::DateValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15801,14 +15199,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toUint32__SWIG_0(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::DateValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15835,14 +15228,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toUint32__SWIG_1(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::DateValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15906,14 +15294,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -15940,14 +15323,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::DateValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16011,14 +15389,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16045,14 +15418,9 @@ SWIGINTERN PyObject *_wrap_DateValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::DateValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16122,14 +15490,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_2(*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16179,14 +15542,9 @@ SWIGINTERN PyObject *_wrap_DateValue_setDate__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_DateValue_setDate__SWIG_1(arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16245,14 +15603,9 @@ SWIGINTERN int _wrap_new_DateValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::DateValue *)new_Exiv2_DateValue__SWIG_3((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16557,14 +15910,9 @@ SWIGINTERN int _wrap_new_Date(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::DateValue::Date *)new Exiv2::DateValue::Date(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16590,14 +15938,9 @@ SWIGINTERN PyObject *_wrap_delete_Date(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16620,14 +15963,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16701,14 +16039,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new Exiv2::TimeValue(arg1,arg2,arg3,arg4,arg5); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16767,14 +16100,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16820,14 +16148,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16916,14 +16239,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setTime((Exiv2::TimeValue::Time const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -16950,14 +16268,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::TimeValue const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17024,14 +16337,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::TimeValue const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17068,14 +16376,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_getTime(PyObject *self, PyObject *args) { { try { result = (Exiv2::TimeValue::Time *) &((Exiv2::TimeValue const *)arg1)->getTime(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17156,14 +16459,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::TimeValue const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17190,14 +16488,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::TimeValue const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17261,14 +16554,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toUint32__SWIG_0(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::TimeValue const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17295,14 +16583,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toUint32__SWIG_1(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::TimeValue const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17366,14 +16649,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17400,14 +16678,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::TimeValue const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17471,14 +16744,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17505,14 +16773,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::TimeValue const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17586,14 +16849,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_2(*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17674,14 +16932,9 @@ SWIGINTERN PyObject *_wrap_TimeValue_setTime__SWIG_1(PyObject *self, Py_ssize_t { try { Exiv2_TimeValue_setTime__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -17740,14 +16993,9 @@ SWIGINTERN int _wrap_new_TimeValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::TimeValue *)new_Exiv2_TimeValue__SWIG_3((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18166,14 +17414,9 @@ SWIGINTERN int _wrap_new_Time(PyObject *self, PyObject *args, PyObject *kwargs) { try { result = (Exiv2::TimeValue::Time *)new Exiv2::TimeValue::Time(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18199,14 +17442,9 @@ SWIGINTERN PyObject *_wrap_delete_Time(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18229,14 +17467,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18300,14 +17533,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18360,14 +17588,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((unsigned short const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18397,14 +17620,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new Exiv2::ValueType< uint16_t >((Exiv2::ValueType< unsigned short > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18430,14 +17648,9 @@ SWIGINTERN PyObject *_wrap_delete_UShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18491,14 +17704,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18544,14 +17752,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18625,14 +17828,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18665,14 +17863,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18734,14 +17927,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18830,14 +18018,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18872,14 +18055,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toInt64__SWIG_0(PyObject *self, Py_ssize_ { try { result = (int64_t)((Exiv2::ValueType< uint16_t > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18906,14 +18084,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toInt64__SWIG_1(PyObject *self, Py_ssize_ { try { result = (int64_t)((Exiv2::ValueType< uint16_t > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -18977,14 +18150,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toUint32__SWIG_0(PyObject *self, Py_ssize { try { result = (uint32_t)((Exiv2::ValueType< uint16_t > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19011,14 +18179,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toUint32__SWIG_1(PyObject *self, Py_ssize { try { result = (uint32_t)((Exiv2::ValueType< uint16_t > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19082,14 +18245,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19116,14 +18274,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< uint16_t > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19187,14 +18340,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19221,14 +18369,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19284,14 +18427,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19318,14 +18456,9 @@ SWIGINTERN PyObject *_wrap_UShortValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< uint16_t > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19358,14 +18491,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19394,14 +18522,9 @@ SWIGINTERN int _wrap_new_UShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< uint16_t > *)new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19626,14 +18749,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19697,14 +18815,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19757,14 +18870,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((unsigned int const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19794,14 +18902,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new Exiv2::ValueType< uint32_t >((Exiv2::ValueType< unsigned int > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19827,14 +18930,9 @@ SWIGINTERN PyObject *_wrap_delete_ULongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19888,14 +18986,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -19941,14 +19034,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20022,14 +19110,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20062,14 +19145,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20131,14 +19209,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20227,14 +19300,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20269,14 +19337,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< uint32_t > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20303,14 +19366,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< uint32_t > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20374,14 +19432,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toUint32__SWIG_0(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< uint32_t > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20408,14 +19461,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toUint32__SWIG_1(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< uint32_t > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20479,14 +19527,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20513,14 +19556,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< uint32_t > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20584,14 +19622,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20618,14 +19651,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20681,14 +19709,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20715,14 +19738,9 @@ SWIGINTERN PyObject *_wrap_ULongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< uint32_t > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20755,14 +19773,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -20791,14 +19804,9 @@ SWIGINTERN int _wrap_new_ULongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< uint32_t > *)new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21023,14 +20031,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21094,14 +20097,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21157,14 +20155,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((std::pair< unsigned int,unsigned int > const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21196,14 +20189,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new Exiv2::ValueType< Exiv2::URational >((Exiv2::ValueType< std::pair< unsigned int,unsigned int > > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21229,14 +20217,9 @@ SWIGINTERN PyObject *_wrap_delete_URationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21290,14 +20273,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_0(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21343,14 +20321,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_read__SWIG_1(PyObject *self, Py_ssize_ { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21424,14 +20397,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_setDataArea(PyObject *self, PyObject * { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21464,14 +20432,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_clone(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21533,14 +20496,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21629,14 +20587,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toString(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21671,14 +20624,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toInt64__SWIG_0(PyObject *self, Py_ssi { try { result = (int64_t)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21705,14 +20653,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toInt64__SWIG_1(PyObject *self, Py_ssi { try { result = (int64_t)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21776,14 +20719,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toUint32__SWIG_0(PyObject *self, Py_ss { try { result = (uint32_t)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21810,14 +20748,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toUint32__SWIG_1(PyObject *self, Py_ss { try { result = (uint32_t)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21881,14 +20814,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_0(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21915,14 +20843,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toFloat__SWIG_1(PyObject *self, Py_ssi { try { result = (float)((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -21986,14 +20909,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_0(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22020,14 +20938,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_toRational__SWIG_1(PyObject *self, Py_ { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22083,14 +20996,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_sizeDataArea(PyObject *self, PyObject { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22117,14 +21025,9 @@ SWIGINTERN PyObject *_wrap_URationalValue_dataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< Exiv2::URational > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22157,14 +21060,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22193,14 +21091,9 @@ SWIGINTERN int _wrap_new_URationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs { try { result = (Exiv2::ValueType< Exiv2::URational > *)new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22419,14 +21312,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22490,14 +21378,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22550,14 +21433,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((short const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22587,14 +21465,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new Exiv2::ValueType< int16_t >((Exiv2::ValueType< short > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22620,14 +21493,9 @@ SWIGINTERN PyObject *_wrap_delete_ShortValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22681,14 +21549,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22734,14 +21597,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22815,14 +21673,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22855,14 +21708,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -22924,14 +21772,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23020,14 +21863,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23062,14 +21900,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< int16_t > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23096,14 +21929,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< int16_t > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23167,14 +21995,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toUint32__SWIG_0(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< int16_t > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23201,14 +22024,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toUint32__SWIG_1(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< int16_t > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23272,14 +22090,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23306,14 +22119,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int16_t > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23377,14 +22185,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23411,14 +22214,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23474,14 +22272,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23508,14 +22301,9 @@ SWIGINTERN PyObject *_wrap_ShortValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int16_t > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23548,14 +22336,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23584,14 +22367,9 @@ SWIGINTERN int _wrap_new_ShortValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< int16_t > *)new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23816,14 +22594,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23887,14 +22660,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23947,14 +22715,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((int const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -23984,14 +22747,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new Exiv2::ValueType< int32_t >((Exiv2::ValueType< int > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24017,14 +22775,9 @@ SWIGINTERN PyObject *_wrap_delete_LongValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24078,14 +22831,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24131,14 +22879,9 @@ SWIGINTERN PyObject *_wrap_LongValue_read__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24212,14 +22955,9 @@ SWIGINTERN PyObject *_wrap_LongValue_setDataArea(PyObject *self, PyObject *args) { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24252,14 +22990,9 @@ SWIGINTERN PyObject *_wrap_LongValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24321,14 +23054,9 @@ SWIGINTERN PyObject *_wrap_LongValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24417,14 +23145,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24459,14 +23182,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< int32_t > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24493,14 +23211,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< int32_t > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24564,14 +23277,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toUint32__SWIG_0(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::ValueType< int32_t > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24598,14 +23306,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toUint32__SWIG_1(PyObject *self, Py_ssize_t { try { result = (uint32_t)((Exiv2::ValueType< int32_t > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24669,14 +23372,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24703,14 +23401,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< int32_t > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24774,14 +23467,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_0(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24808,14 +23496,9 @@ SWIGINTERN PyObject *_wrap_LongValue_toRational__SWIG_1(PyObject *self, Py_ssize { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24871,14 +23554,9 @@ SWIGINTERN PyObject *_wrap_LongValue_sizeDataArea(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24905,14 +23583,9 @@ SWIGINTERN PyObject *_wrap_LongValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< int32_t > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24945,14 +23618,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -24981,14 +23649,9 @@ SWIGINTERN int _wrap_new_LongValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, PyO { try { result = (Exiv2::ValueType< int32_t > *)new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25213,14 +23876,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25284,14 +23942,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25347,14 +24000,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((std::pair< int,int > const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25386,14 +24034,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new Exiv2::ValueType< Exiv2::Rational >((Exiv2::ValueType< std::pair< int,int > > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25419,14 +24062,9 @@ SWIGINTERN PyObject *_wrap_delete_RationalValue(PyObject *self, PyObject *args) { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25480,14 +24118,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25533,14 +24166,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_read__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25614,14 +24242,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_setDataArea(PyObject *self, PyObject *a { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25654,14 +24277,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25723,14 +24341,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25819,14 +24432,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toString(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25861,14 +24469,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toInt64__SWIG_0(PyObject *self, Py_ssiz { try { result = (int64_t)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25895,14 +24498,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toInt64__SWIG_1(PyObject *self, Py_ssiz { try { result = (int64_t)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -25966,14 +24564,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toUint32__SWIG_0(PyObject *self, Py_ssi { try { result = (uint32_t)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26000,14 +24593,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toUint32__SWIG_1(PyObject *self, Py_ssi { try { result = (uint32_t)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26071,14 +24659,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_0(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26105,14 +24688,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toFloat__SWIG_1(PyObject *self, Py_ssiz { try { result = (float)((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26176,14 +24754,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_0(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26210,14 +24783,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_toRational__SWIG_1(PyObject *self, Py_s { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26273,14 +24841,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_sizeDataArea(PyObject *self, PyObject * { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26307,14 +24870,9 @@ SWIGINTERN PyObject *_wrap_RationalValue_dataArea(PyObject *self, PyObject *args { try { result = ((Exiv2::ValueType< Exiv2::Rational > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26347,14 +24905,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26383,14 +24936,9 @@ SWIGINTERN int _wrap_new_RationalValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, { try { result = (Exiv2::ValueType< Exiv2::Rational > *)new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26609,14 +25157,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26680,14 +25223,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26740,14 +25278,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((float const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26777,14 +25310,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new Exiv2::ValueType< float >((Exiv2::ValueType< float > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26810,14 +25338,9 @@ SWIGINTERN PyObject *_wrap_delete_FloatValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26871,14 +25394,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_0(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -26924,14 +25442,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_read__SWIG_1(PyObject *self, Py_ssize_t no { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27005,14 +25518,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_setDataArea(PyObject *self, PyObject *args { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27045,14 +25553,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27114,14 +25617,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27210,14 +25708,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toString(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27252,14 +25745,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toInt64__SWIG_0(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< float > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27286,14 +25774,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toInt64__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int64_t)((Exiv2::ValueType< float > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27357,14 +25840,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toUint32__SWIG_0(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< float > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27391,14 +25869,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toUint32__SWIG_1(PyObject *self, Py_ssize_ { try { result = (uint32_t)((Exiv2::ValueType< float > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27462,14 +25935,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_0(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27496,14 +25964,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toFloat__SWIG_1(PyObject *self, Py_ssize_t { try { result = (float)((Exiv2::ValueType< float > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27567,14 +26030,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_0(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27601,14 +26059,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_toRational__SWIG_1(PyObject *self, Py_ssiz { try { result = ((Exiv2::ValueType< float > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27664,14 +26117,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_sizeDataArea(PyObject *self, PyObject *arg { try { result = ((Exiv2::ValueType< float > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27698,14 +26146,9 @@ SWIGINTERN PyObject *_wrap_FloatValue_dataArea(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< float > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27738,14 +26181,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -27774,14 +26212,9 @@ SWIGINTERN int _wrap_new_FloatValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, Py { try { result = (Exiv2::ValueType< float > *)new_Exiv2_ValueType_Sl_float_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28006,14 +26439,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_0(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28077,14 +26505,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_1(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::byte const *)arg1,arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28137,14 +26560,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_2(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((double const &)*arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28174,14 +26592,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_3(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new Exiv2::ValueType< double >((Exiv2::ValueType< double > const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28207,14 +26620,9 @@ SWIGINTERN PyObject *_wrap_delete_DoubleValue(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28268,14 +26676,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((Exiv2::byte const *)arg2,arg3,arg4); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28321,14 +26724,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_read__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int)(arg1)->read((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28402,14 +26800,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_setDataArea(PyObject *self, PyObject *arg { try { result = (int)(arg1)->setDataArea((Exiv2::byte const *)arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28442,14 +26835,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_clone(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< double > const *)arg1)->clone(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28511,14 +26899,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::ValueType< double > const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28607,14 +26990,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toString(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28649,14 +27027,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toInt64__SWIG_0(PyObject *self, Py_ssize_ { try { result = (int64_t)((Exiv2::ValueType< double > const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28683,14 +27056,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toInt64__SWIG_1(PyObject *self, Py_ssize_ { try { result = (int64_t)((Exiv2::ValueType< double > const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28754,14 +27122,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toUint32__SWIG_0(PyObject *self, Py_ssize { try { result = (uint32_t)((Exiv2::ValueType< double > const *)arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28788,14 +27151,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toUint32__SWIG_1(PyObject *self, Py_ssize { try { result = (uint32_t)((Exiv2::ValueType< double > const *)arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28859,14 +27217,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_0(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28893,14 +27246,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toFloat__SWIG_1(PyObject *self, Py_ssize_ { try { result = (float)((Exiv2::ValueType< double > const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28964,14 +27312,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_0(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -28998,14 +27341,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_toRational__SWIG_1(PyObject *self, Py_ssi { try { result = ((Exiv2::ValueType< double > const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -29061,14 +27399,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_sizeDataArea(PyObject *self, PyObject *ar { try { result = ((Exiv2::ValueType< double > const *)arg1)->sizeDataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -29095,14 +27428,9 @@ SWIGINTERN PyObject *_wrap_DoubleValue_dataArea(PyObject *self, PyObject *args) { try { result = ((Exiv2::ValueType< double > const *)arg1)->dataArea(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -29135,14 +27463,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_4(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_4((Exiv2::Value const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -29171,14 +27494,9 @@ SWIGINTERN int _wrap_new_DoubleValue__SWIG_5(PyObject *self, Py_ssize_t nobjs, P { try { result = (Exiv2::ValueType< double > *)new_Exiv2_ValueType_Sl_double_Sg___SWIG_5(SWIG_STD_MOVE(arg1)); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/version_wrap.cxx b/src/swig-0_28_0/version_wrap.cxx index 2624ed5b..790908f9 100644 --- a/src/swig-0_28_0/version_wrap.cxx +++ b/src/swig-0_28_0/version_wrap.cxx @@ -4118,6 +4118,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + static PyObject* versionInfo() { bool nls = false; bool bmff = false; @@ -4387,14 +4420,9 @@ SWIGINTERN PyObject *_wrap_versionInfo(PyObject *self, PyObject *args) { { try { result = (PyObject *)versionInfo(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4413,14 +4441,9 @@ SWIGINTERN PyObject *_wrap_versionNumber(PyObject *self, PyObject *args) { { try { result = (uint32_t)Exiv2::versionNumber(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4439,14 +4462,9 @@ SWIGINTERN PyObject *_wrap_versionString(PyObject *self, PyObject *args) { { try { result = Exiv2::versionString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4465,14 +4483,9 @@ SWIGINTERN PyObject *_wrap_versionNumberHexString(PyObject *self, PyObject *args { try { result = Exiv2::versionNumberHexString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4491,14 +4504,9 @@ SWIGINTERN PyObject *_wrap_version(PyObject *self, PyObject *args) { { try { result = (char *)Exiv2::version(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -4542,14 +4550,9 @@ SWIGINTERN PyObject *_wrap_testVersion(PyObject *self, PyObject *args) { { try { result = (bool)Exiv2::testVersion(arg1,arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } diff --git a/src/swig-0_28_0/xmp_wrap.cxx b/src/swig-0_28_0/xmp_wrap.cxx index 22dc7207..06aa67c7 100644 --- a/src/swig-0_28_0/xmp_wrap.cxx +++ b/src/swig-0_28_0/xmp_wrap.cxx @@ -4153,6 +4153,39 @@ static PyObject* PyExc_Exiv2Error = NULL; static PyObject* exiv2_module = NULL; +static void _set_python_exception() { + try { + throw; + } + + + + catch(Exiv2::Error const& e) { + + PyErr_SetString(PyExc_Exiv2Error, e.what()); + } + /*@SWIG:/usr/local/share/swig/4.2.0/typemaps/exception.swg,59,SWIG_CATCH_STDEXCEPT@*/ /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +/*@SWIG@*/ +fail: + return; +}; + + // Base class implements all methods except dereferencing class XmpData_iterator_base { protected: @@ -5539,14 +5572,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_base___str__(PyObject *self, PyObjec { try { result = (arg1)->__str__(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5572,14 +5600,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator_base(PyObject *self, PyObject { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5614,14 +5637,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator___deref__(PyObject *self, PyObject * { try { result = (Exiv2::Xmpdatum *)((XmpData_iterator const *)arg1)->operator ->(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5647,14 +5665,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData_iterator(PyObject *self, PyObject *arg { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5688,14 +5701,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_0(PyObject *self, Py_ { try { (*arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5735,14 +5743,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_1(PyObject *self, Py_ { try { result = (int)(*arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5773,14 +5776,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_setValue__SWIG_2(PyObject *self, Py_ { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5888,14 +5886,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_copy(PyObject *self, PyObject *args) { try { result = (*arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5932,14 +5925,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_key(PyObject *self, PyObject *args) { try { result = (*arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -5966,14 +5954,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_familyName(PyObject *self, PyObject { try { result = (char *)(*arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6000,14 +5983,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_groupName(PyObject *self, PyObject * { try { result = (*arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6034,14 +6012,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagName(PyObject *self, PyObject *ar { try { result = (*arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6068,14 +6041,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagLabel(PyObject *self, PyObject *a { try { result = (*arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6102,14 +6070,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tagDesc(PyObject *self, PyObject *ar { try { result = (*arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6136,14 +6099,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_tag(PyObject *self, PyObject *args) { try { result = (uint16_t)(*arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6170,14 +6128,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeId(PyObject *self, PyObject *arg { try { result = (Exiv2::TypeId)(*arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6208,14 +6161,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeName(PyObject *self, PyObject *a { try { result = (char *)(*arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6242,14 +6190,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_typeSize(PyObject *self, PyObject *a { try { result = (*arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6318,14 +6261,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6360,14 +6298,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toString__SWIG_1(PyObject *self, Py_ { try { result = (*arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6431,14 +6364,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toInt64__SWIG_0(PyObject *self, Py_s { try { result = (int64_t)(*arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6465,14 +6393,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toInt64__SWIG_1(PyObject *self, Py_s { try { result = (int64_t)(*arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6536,14 +6459,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_0(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6570,14 +6488,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toFloat__SWIG_1(PyObject *self, Py_s { try { result = (float)(*arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6641,14 +6554,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_0(PyObject *self, P { try { result = (*arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6675,14 +6583,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toRational__SWIG_1(PyObject *self, P { try { result = (*arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6738,14 +6641,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_0(PyObject *self, Py_ { try { result = (*arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6794,14 +6692,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_getValue__SWIG_1(PyObject *self, Py_ { try { result = Exiv2_Xmpdatum_getValue__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6866,14 +6759,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_0(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &(*arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6920,14 +6808,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_value__SWIG_1(PyObject *self, Py_ssi { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1((Exiv2::Xmpdatum*)(arg1)->operator ->(),arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -6998,14 +6881,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_0(PyObject *self, Py_ss { try { result = (*arg1)->print((Exiv2::ExifData const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7032,14 +6910,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator__print__SWIG_1(PyObject *self, Py_ss { try { result = (*arg1)->print(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7103,14 +6976,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toUint32__SWIG_0(PyObject *self, Py_ { try { result = (uint32_t)(*arg1)->toUint32(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7137,14 +7005,9 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_toUint32__SWIG_1(PyObject *self, Py_ { try { result = (uint32_t)(*arg1)->toUint32(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7213,14 +7076,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1,(Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7250,14 +7108,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::XmpKey const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7287,14 +7140,9 @@ SWIGINTERN int _wrap_new_Xmpdatum__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyOb { try { result = (Exiv2::Xmpdatum *)new Exiv2::Xmpdatum((Exiv2::Xmpdatum const &)*arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7362,14 +7210,9 @@ SWIGINTERN PyObject *_wrap_delete_Xmpdatum(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7403,14 +7246,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_0(PyObject *self, Py_ssize_t { try { (arg1)->setValue((Exiv2::Value const *)arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7450,14 +7288,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = (int)(arg1)->setValue((std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7519,14 +7352,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_copy(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->copy(arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7563,14 +7391,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_key(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->key(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7597,14 +7420,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_familyName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->familyName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7631,14 +7449,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_groupName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->groupName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7665,14 +7478,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagName(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7699,14 +7507,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagLabel(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagLabel(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7733,14 +7536,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tagDesc(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->tagDesc(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7767,14 +7565,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_tag(PyObject *self, PyObject *args) { { try { result = (uint16_t)((Exiv2::Xmpdatum const *)arg1)->tag(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7801,14 +7594,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeId(PyObject *self, PyObject *args) { { try { result = (Exiv2::TypeId)((Exiv2::Xmpdatum const *)arg1)->typeId(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7839,14 +7627,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeName(PyObject *self, PyObject *args) { { try { result = (char *)((Exiv2::Xmpdatum const *)arg1)->typeName(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7873,14 +7656,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_typeSize(PyObject *self, PyObject *args) { { try { result = ((Exiv2::Xmpdatum const *)arg1)->typeSize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7949,14 +7727,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -7991,14 +7764,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toString__SWIG_1(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->toString(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8062,14 +7830,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toInt64__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (int64_t)((Exiv2::Xmpdatum const *)arg1)->toInt64(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8096,14 +7859,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toInt64__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (int64_t)((Exiv2::Xmpdatum const *)arg1)->toInt64(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8167,14 +7925,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_0(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8201,14 +7954,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toFloat__SWIG_1(PyObject *self, Py_ssize_t n { try { result = (float)((Exiv2::Xmpdatum const *)arg1)->toFloat(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8272,14 +8020,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_0(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8306,14 +8049,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_toRational__SWIG_1(PyObject *self, Py_ssize_ { try { result = ((Exiv2::Xmpdatum const *)arg1)->toRational(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8369,14 +8107,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_0(PyObject *self, Py_ssize_t { try { result = ((Exiv2::Xmpdatum const *)arg1)->getValue(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8412,14 +8145,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_0(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &((Exiv2::Xmpdatum const *)arg1)->value(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8466,14 +8194,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_getValue__SWIG_1(PyObject *self, Py_ssize_t { try { result = Exiv2_Xmpdatum_getValue__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8551,14 +8274,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_value__SWIG_1(PyObject *self, Py_ssize_t nob { try { result = (Exiv2::Value *) &Exiv2_Xmpdatum_value__SWIG_1(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8623,14 +8341,9 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_setValue__SWIG_2(PyObject *self, Py_ssize_t { try { result = (PyObject *)Exiv2_Xmpdatum_setValue__SWIG_2(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8700,14 +8413,9 @@ SWIGINTERN int _wrap_new_XmpData(PyObject *self, PyObject *args, PyObject *kwarg { try { result = (Exiv2::XmpData *)new Exiv2::XmpData(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8753,14 +8461,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_0(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::XmpKey const &)*arg2,(Exiv2::Value const *)arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8798,14 +8501,9 @@ SWIGINTERN PyObject *_wrap_XmpData_add__SWIG_1(PyObject *self, Py_ssize_t nobjs, { try { result = (int)(arg1)->add((Exiv2::Xmpdatum const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8877,14 +8575,9 @@ SWIGINTERN PyObject *_wrap_XmpData_erase(PyObject *self, PyObject *args) { { try { result = (arg1)->erase(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8932,14 +8625,9 @@ SWIGINTERN PyObject *_wrap_XmpData_eraseFamily(PyObject *self, PyObject *args) { { try { (arg1)->eraseFamily(*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -8985,14 +8673,9 @@ SWIGINTERN PyObject *_wrap_XmpData_sortByKey(PyObject *self, PyObject *args) { { try { (arg1)->sortByKey(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9092,14 +8775,9 @@ SWIGINTERN PyObject *_wrap_XmpData_findKey(PyObject *self, PyObject *args) { { try { result = (arg1)->findKey((Exiv2::XmpKey const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9177,14 +8855,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_0(PyObject *self, Py_ssize_t { try { result = (bool)((Exiv2::XmpData const *)arg1)->usePacket(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9219,14 +8892,9 @@ SWIGINTERN PyObject *_wrap_XmpData_usePacket__SWIG_1(PyObject *self, Py_ssize_t { try { result = (bool)(arg1)->usePacket(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9293,14 +8961,9 @@ SWIGINTERN PyObject *_wrap_XmpData_setPacket(PyObject *self, PyObject *args) { { try { (arg1)->setPacket(arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9327,14 +8990,9 @@ SWIGINTERN PyObject *_wrap_XmpData_xmpPacket(PyObject *self, PyObject *args) { { try { result = (std::string *) &((Exiv2::XmpData const *)arg1)->xmpPacket(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9376,14 +9034,9 @@ SWIGINTERN PyObject *_wrap_XmpData___getitem__(PyObject *self, PyObject *args) { { try { result = (Exiv2::Xmpdatum *) &Exiv2_XmpData___getitem__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9438,14 +9091,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_0(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_0(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9500,14 +9148,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_1(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_1(arg1,(std::string const &)*arg2,(std::string const &)*arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9553,14 +9196,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_2(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_2(arg1,(std::string const &)*arg2,arg3); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9602,14 +9240,9 @@ SWIGINTERN PyObject *_wrap_XmpData___setitem____SWIG_3(PyObject *self, Py_ssize_ { try { result = (PyObject *)Exiv2_XmpData___setitem____SWIG_3(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9707,14 +9340,9 @@ SWIGINTERN PyObject *_wrap_XmpData___contains__(PyObject *self, PyObject *args) { try { result = (bool)Exiv2_XmpData___contains__(arg1,(std::string const &)*arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9742,14 +9370,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpData(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9791,14 +9414,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_0(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1,arg2); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9824,14 +9442,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_1(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(arg1); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9850,14 +9463,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_initialize__SWIG_2(PyObject *self, Py_ssize { try { result = (bool)Exiv2::XmpParser::initialize(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9910,14 +9518,9 @@ SWIGINTERN PyObject *_wrap_XmpParser_terminate(PyObject *self, PyObject *args) { { try { Exiv2::XmpParser::terminate(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9937,14 +9540,9 @@ SWIGINTERN int _wrap_new_XmpParser(PyObject *self, PyObject *args, PyObject *kwa { try { result = (Exiv2::XmpParser *)new Exiv2::XmpParser(); - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } @@ -9970,14 +9568,9 @@ SWIGINTERN PyObject *_wrap_delete_XmpParser(PyObject *self, PyObject *args) { { try { delete arg1; - - - - } catch(Exiv2::Error const& e) { - PyErr_SetString(PyExc_Exiv2Error, e.what()); - SWIG_fail; - } catch(std::exception const& e) { - PyErr_SetString(PyExc_RuntimeError, e.what()); + } + catch(std::exception const& e) { + _set_python_exception(); SWIG_fail; } } From 4c41531ad679d99fdf3c623699eaab6bb9029b84 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Fri, 12 Jan 2024 10:04:57 +0000 Subject: [PATCH 11/12] Update a deprecation date (Found the first deprecation commit while looking for something else.) --- src/interface/value.i | 2 +- src/swig-0_27_0/value_wrap.cxx | 34 +++++++++++++++++----------------- src/swig-0_27_4/value_wrap.cxx | 34 +++++++++++++++++----------------- src/swig-0_28_0/value_wrap.cxx | 34 +++++++++++++++++----------------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/interface/value.i b/src/interface/value.i index 2f607914..03fc14c0 100644 --- a/src/interface/value.i +++ b/src/interface/value.i @@ -193,7 +193,7 @@ DEPRECATED_ENUM(XmpValue, XmpStruct, "XMP structure indicator.", %noexception type_name::size; %extend type_name { part_name(const Exiv2::Value& value) { - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '" #type_name ".clone()' to copy value", 1); type_name* pv = dynamic_cast< type_name* >(value.clone().release()); diff --git a/src/swig-0_27_0/value_wrap.cxx b/src/swig-0_27_0/value_wrap.cxx index 0023a0c3..ca2771f3 100644 --- a/src/swig-0_27_0/value_wrap.cxx +++ b/src/swig-0_27_0/value_wrap.cxx @@ -5860,7 +5860,7 @@ SWIGINTERNINLINE PyObject* SWIGINTERN std::string Exiv2_Value___str__(Exiv2::Value *self){return self->toString();} SWIGINTERN Exiv2::DataValue *new_Exiv2_DataValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DataValue" ".clone()' to copy value", 1); Exiv2::DataValue* pv = dynamic_cast< Exiv2::DataValue* >(value.clone().release()); @@ -5888,7 +5888,7 @@ SWIGINTERN char const *Exiv2_StringValueBase_data(Exiv2::StringValueBase *self){ return self->value_.data(); } SWIGINTERN Exiv2::StringValue *new_Exiv2_StringValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::StringValue" ".clone()' to copy value", 1); Exiv2::StringValue* pv = dynamic_cast< Exiv2::StringValue* >(value.clone().release()); @@ -5912,7 +5912,7 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_1(std::string const &bu return self; } SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::AsciiValue" ".clone()' to copy value", 1); Exiv2::AsciiValue* pv = dynamic_cast< Exiv2::AsciiValue* >(value.clone().release()); @@ -6007,7 +6007,7 @@ static PyObject* py_from_enum(Exiv2::ByteOrder value) { } SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::CommentValue" ".clone()' to copy value", 1); Exiv2::CommentValue* pv = dynamic_cast< Exiv2::CommentValue* >(value.clone().release()); @@ -6126,7 +6126,7 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpStruct value) { } SWIGINTERN Exiv2::XmpTextValue *new_Exiv2_XmpTextValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpTextValue" ".clone()' to copy value", 1); Exiv2::XmpTextValue* pv = dynamic_cast< Exiv2::XmpTextValue* >(value.clone().release()); @@ -6154,7 +6154,7 @@ SWIGINTERN char const *Exiv2_XmpTextValue_data(Exiv2::XmpTextValue *self){ return self->value_.data(); } SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_0(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpArrayValue" ".clone()' to copy value", 1); Exiv2::XmpArrayValue* pv = dynamic_cast< Exiv2::XmpArrayValue* >(value.clone().release()); @@ -6571,7 +6571,7 @@ SWIGINTERN bool Exiv2_LangAltValue___contains__(Exiv2::LangAltValue *self,std::s return self->value_.find(key) != self->value_.end(); } SWIGINTERN Exiv2::LangAltValue *new_Exiv2_LangAltValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::LangAltValue" ".clone()' to copy value", 1); Exiv2::LangAltValue* pv = dynamic_cast< Exiv2::LangAltValue* >(value.clone().release()); @@ -6602,7 +6602,7 @@ SWIGINTERN void Exiv2_DateValue_setDate__SWIG_1(Exiv2::DateValue *self,int year, self->setDate(date); } SWIGINTERN Exiv2::DateValue *new_Exiv2_DateValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DateValue" ".clone()' to copy value", 1); Exiv2::DateValue* pv = dynamic_cast< Exiv2::DateValue* >(value.clone().release()); @@ -6651,7 +6651,7 @@ SWIGINTERN void Exiv2_TimeValue_setTime__SWIG_1(Exiv2::TimeValue *self,int32_t h self->setTime(time); } SWIGINTERN Exiv2::TimeValue *new_Exiv2_TimeValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::TimeValue" ".clone()' to copy value", 1); Exiv2::TimeValue* pv = dynamic_cast< Exiv2::TimeValue* >(value.clone().release()); @@ -6756,7 +6756,7 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) } SWIGINTERN Exiv2::ValueType< uint16_t > *new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6853,7 +6853,7 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) } SWIGINTERN Exiv2::ValueType< uint32_t > *new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6936,7 +6936,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_uint32_t_Sg__append(Exiv2::ValueType< uint32_ } SWIGINTERN Exiv2::ValueType< Exiv2::URational > *new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6998,7 +6998,7 @@ SWIG_AsVal_short (PyObject * obj, short *val) } SWIGINTERN Exiv2::ValueType< int16_t > *new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7071,7 +7071,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int16_t_Sg__append(Exiv2::ValueType< int16_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< int32_t > *new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7117,7 +7117,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int32_t_Sg__append(Exiv2::ValueType< int32_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< Exiv2::Rational > *new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7219,7 +7219,7 @@ SWIG_AsVal_float (PyObject * obj, float *val) } SWIGINTERN Exiv2::ValueType< float > *new_Exiv2_ValueType_Sl_float_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7285,7 +7285,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_float_Sg__append(Exiv2::ValueType< float > *s self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< double > *new_Exiv2_ValueType_Sl_double_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); diff --git a/src/swig-0_27_4/value_wrap.cxx b/src/swig-0_27_4/value_wrap.cxx index 0023a0c3..ca2771f3 100644 --- a/src/swig-0_27_4/value_wrap.cxx +++ b/src/swig-0_27_4/value_wrap.cxx @@ -5860,7 +5860,7 @@ SWIGINTERNINLINE PyObject* SWIGINTERN std::string Exiv2_Value___str__(Exiv2::Value *self){return self->toString();} SWIGINTERN Exiv2::DataValue *new_Exiv2_DataValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DataValue" ".clone()' to copy value", 1); Exiv2::DataValue* pv = dynamic_cast< Exiv2::DataValue* >(value.clone().release()); @@ -5888,7 +5888,7 @@ SWIGINTERN char const *Exiv2_StringValueBase_data(Exiv2::StringValueBase *self){ return self->value_.data(); } SWIGINTERN Exiv2::StringValue *new_Exiv2_StringValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::StringValue" ".clone()' to copy value", 1); Exiv2::StringValue* pv = dynamic_cast< Exiv2::StringValue* >(value.clone().release()); @@ -5912,7 +5912,7 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_1(std::string const &bu return self; } SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::AsciiValue" ".clone()' to copy value", 1); Exiv2::AsciiValue* pv = dynamic_cast< Exiv2::AsciiValue* >(value.clone().release()); @@ -6007,7 +6007,7 @@ static PyObject* py_from_enum(Exiv2::ByteOrder value) { } SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::CommentValue" ".clone()' to copy value", 1); Exiv2::CommentValue* pv = dynamic_cast< Exiv2::CommentValue* >(value.clone().release()); @@ -6126,7 +6126,7 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpStruct value) { } SWIGINTERN Exiv2::XmpTextValue *new_Exiv2_XmpTextValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpTextValue" ".clone()' to copy value", 1); Exiv2::XmpTextValue* pv = dynamic_cast< Exiv2::XmpTextValue* >(value.clone().release()); @@ -6154,7 +6154,7 @@ SWIGINTERN char const *Exiv2_XmpTextValue_data(Exiv2::XmpTextValue *self){ return self->value_.data(); } SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_0(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpArrayValue" ".clone()' to copy value", 1); Exiv2::XmpArrayValue* pv = dynamic_cast< Exiv2::XmpArrayValue* >(value.clone().release()); @@ -6571,7 +6571,7 @@ SWIGINTERN bool Exiv2_LangAltValue___contains__(Exiv2::LangAltValue *self,std::s return self->value_.find(key) != self->value_.end(); } SWIGINTERN Exiv2::LangAltValue *new_Exiv2_LangAltValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::LangAltValue" ".clone()' to copy value", 1); Exiv2::LangAltValue* pv = dynamic_cast< Exiv2::LangAltValue* >(value.clone().release()); @@ -6602,7 +6602,7 @@ SWIGINTERN void Exiv2_DateValue_setDate__SWIG_1(Exiv2::DateValue *self,int year, self->setDate(date); } SWIGINTERN Exiv2::DateValue *new_Exiv2_DateValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DateValue" ".clone()' to copy value", 1); Exiv2::DateValue* pv = dynamic_cast< Exiv2::DateValue* >(value.clone().release()); @@ -6651,7 +6651,7 @@ SWIGINTERN void Exiv2_TimeValue_setTime__SWIG_1(Exiv2::TimeValue *self,int32_t h self->setTime(time); } SWIGINTERN Exiv2::TimeValue *new_Exiv2_TimeValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::TimeValue" ".clone()' to copy value", 1); Exiv2::TimeValue* pv = dynamic_cast< Exiv2::TimeValue* >(value.clone().release()); @@ -6756,7 +6756,7 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) } SWIGINTERN Exiv2::ValueType< uint16_t > *new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6853,7 +6853,7 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) } SWIGINTERN Exiv2::ValueType< uint32_t > *new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6936,7 +6936,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_uint32_t_Sg__append(Exiv2::ValueType< uint32_ } SWIGINTERN Exiv2::ValueType< Exiv2::URational > *new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6998,7 +6998,7 @@ SWIG_AsVal_short (PyObject * obj, short *val) } SWIGINTERN Exiv2::ValueType< int16_t > *new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7071,7 +7071,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int16_t_Sg__append(Exiv2::ValueType< int16_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< int32_t > *new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7117,7 +7117,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int32_t_Sg__append(Exiv2::ValueType< int32_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< Exiv2::Rational > *new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7219,7 +7219,7 @@ SWIG_AsVal_float (PyObject * obj, float *val) } SWIGINTERN Exiv2::ValueType< float > *new_Exiv2_ValueType_Sl_float_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7285,7 +7285,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_float_Sg__append(Exiv2::ValueType< float > *s self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< double > *new_Exiv2_ValueType_Sl_double_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); diff --git a/src/swig-0_28_0/value_wrap.cxx b/src/swig-0_28_0/value_wrap.cxx index 6feb0fa5..c717612e 100644 --- a/src/swig-0_28_0/value_wrap.cxx +++ b/src/swig-0_28_0/value_wrap.cxx @@ -6030,7 +6030,7 @@ SWIGINTERNINLINE PyObject* SWIGINTERN std::string Exiv2_Value___str__(Exiv2::Value *self){return self->toString();} SWIGINTERN Exiv2::DataValue *new_Exiv2_DataValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DataValue" ".clone()' to copy value", 1); Exiv2::DataValue* pv = dynamic_cast< Exiv2::DataValue* >(value.clone().release()); @@ -6058,7 +6058,7 @@ SWIGINTERN char const *Exiv2_StringValueBase_data(Exiv2::StringValueBase *self){ return self->value_.data(); } SWIGINTERN Exiv2::StringValue *new_Exiv2_StringValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::StringValue" ".clone()' to copy value", 1); Exiv2::StringValue* pv = dynamic_cast< Exiv2::StringValue* >(value.clone().release()); @@ -6082,7 +6082,7 @@ SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_1(std::string const &bu return self; } SWIGINTERN Exiv2::AsciiValue *new_Exiv2_AsciiValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::AsciiValue" ".clone()' to copy value", 1); Exiv2::AsciiValue* pv = dynamic_cast< Exiv2::AsciiValue* >(value.clone().release()); @@ -6177,7 +6177,7 @@ static PyObject* py_from_enum(Exiv2::ByteOrder value) { } SWIGINTERN Exiv2::CommentValue *new_Exiv2_CommentValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::CommentValue" ".clone()' to copy value", 1); Exiv2::CommentValue* pv = dynamic_cast< Exiv2::CommentValue* >(value.clone().release()); @@ -6296,7 +6296,7 @@ static PyObject* py_from_enum(Exiv2::XmpValue::XmpStruct value) { } SWIGINTERN Exiv2::XmpTextValue *new_Exiv2_XmpTextValue__SWIG_2(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpTextValue" ".clone()' to copy value", 1); Exiv2::XmpTextValue* pv = dynamic_cast< Exiv2::XmpTextValue* >(value.clone().release()); @@ -6324,7 +6324,7 @@ SWIGINTERN char const *Exiv2_XmpTextValue_data(Exiv2::XmpTextValue *self){ return self->value_.data(); } SWIGINTERN Exiv2::XmpArrayValue *new_Exiv2_XmpArrayValue__SWIG_0(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::XmpArrayValue" ".clone()' to copy value", 1); Exiv2::XmpArrayValue* pv = dynamic_cast< Exiv2::XmpArrayValue* >(value.clone().release()); @@ -6741,7 +6741,7 @@ SWIGINTERN bool Exiv2_LangAltValue___contains__(Exiv2::LangAltValue *self,std::s return self->value_.find(key) != self->value_.end(); } SWIGINTERN Exiv2::LangAltValue *new_Exiv2_LangAltValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::LangAltValue" ".clone()' to copy value", 1); Exiv2::LangAltValue* pv = dynamic_cast< Exiv2::LangAltValue* >(value.clone().release()); @@ -6772,7 +6772,7 @@ SWIGINTERN void Exiv2_DateValue_setDate__SWIG_1(Exiv2::DateValue *self,int year, self->setDate(date); } SWIGINTERN Exiv2::DateValue *new_Exiv2_DateValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::DateValue" ".clone()' to copy value", 1); Exiv2::DateValue* pv = dynamic_cast< Exiv2::DateValue* >(value.clone().release()); @@ -6821,7 +6821,7 @@ SWIGINTERN void Exiv2_TimeValue_setTime__SWIG_1(Exiv2::TimeValue *self,int32_t h self->setTime(time); } SWIGINTERN Exiv2::TimeValue *new_Exiv2_TimeValue__SWIG_3(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::TimeValue" ".clone()' to copy value", 1); Exiv2::TimeValue* pv = dynamic_cast< Exiv2::TimeValue* >(value.clone().release()); @@ -6874,7 +6874,7 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) } SWIGINTERN Exiv2::ValueType< uint16_t > *new_Exiv2_ValueType_Sl_uint16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -6963,7 +6963,7 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) } SWIGINTERN Exiv2::ValueType< uint32_t > *new_Exiv2_ValueType_Sl_uint32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7039,7 +7039,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_uint32_t_Sg__append(Exiv2::ValueType< uint32_ } SWIGINTERN Exiv2::ValueType< Exiv2::URational > *new_Exiv2_ValueType_Sl_Exiv2_URational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7101,7 +7101,7 @@ SWIG_AsVal_short (PyObject * obj, short *val) } SWIGINTERN Exiv2::ValueType< int16_t > *new_Exiv2_ValueType_Sl_int16_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7174,7 +7174,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int16_t_Sg__append(Exiv2::ValueType< int16_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< int32_t > *new_Exiv2_ValueType_Sl_int32_t_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7220,7 +7220,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_int32_t_Sg__append(Exiv2::ValueType< int32_t self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< Exiv2::Rational > *new_Exiv2_ValueType_Sl_Exiv2_Rational_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7322,7 +7322,7 @@ SWIG_AsVal_float (PyObject * obj, float *val) } SWIGINTERN Exiv2::ValueType< float > *new_Exiv2_ValueType_Sl_float_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); @@ -7388,7 +7388,7 @@ SWIGINTERN void Exiv2_ValueType_Sl_float_Sg__append(Exiv2::ValueType< float > *s self->value_.push_back(value); } SWIGINTERN Exiv2::ValueType< double > *new_Exiv2_ValueType_Sl_double_Sg___SWIG_4(Exiv2::Value const &value){ - // deprecated since 2023-12-19 + // deprecated since 2022-12-28 PyErr_WarnEx(PyExc_DeprecationWarning, "Use '""Exiv2::ValueType" ".clone()' to copy value", 1); Exiv2::ValueType* pv = dynamic_cast< Exiv2::ValueType* >(value.clone().release()); From 6a9e56323f150a40757aa7e8990b6186c4aa0ca3 Mon Sep 17 00:00:00 2001 From: Jim Easterbrook Date: Fri, 12 Jan 2024 10:11:43 +0000 Subject: [PATCH 12/12] Test deprecation of int where enum is expected --- tests/test_value.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_value.py b/tests/test_value.py index 85369f02..6b339ef1 100644 --- a/tests/test_value.py +++ b/tests/test_value.py @@ -49,6 +49,8 @@ def do_common_tests(self, value, type_id, string, data, sequence=None): else: self.check_result(value.count(), int, len(data)) self.check_result(value.ok(), bool, True) + with self.assertWarns(DeprecationWarning): + result = exiv2.Value.create(int(type_id)) result = exiv2.Value.create(type_id) self.assertEqual(result.read(string), 0) self.assertEqual(str(result), string) @@ -112,6 +114,8 @@ def do_common_xmp_tests(self, value): exiv2.XmpValue.XmpArrayType.xaBag, exiv2.XmpValue.XmpArrayType.xaAlt, exiv2.XmpValue.XmpArrayType.xaNone): + with self.assertWarns(DeprecationWarning): + value.setXmpArrayType(int(type_)) value.setXmpArrayType(type_) self.check_result( value.xmpArrayType(), exiv2.XmpValue.XmpArrayType, type_)