aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2007-03-30 22:57:31 +0200
committerOlivier Tilloy <olivier@tilloy.net>2007-03-30 22:57:31 +0200
commit875b5a6e2c3e37f4107f563485f6063f395315f7 (patch)
tree2fedb828a5ec8ccb4365ff4fba7594c7a06d0c1d /src
parentffb6b75a2b3229a97e40f7dea223520d29c608bc (diff)
downloadpyexiv2-875b5a6e2c3e37f4107f563485f6063f395315f7.tar.gz
Internally renamed methods getAvailableExifTags() and getAvailableIptcTags() to exifKeys() and iptcKeys().
Changed the type of exception raised when trying to get a value corresponding to an invalid IPTC key (TypeError, to comply with http://docs.python.org/ref/sequence-types.html).
Diffstat (limited to 'src')
-rw-r--r--src/libpyexiv2.cpp8
-rw-r--r--src/libpyexiv2.hpp4
-rw-r--r--src/libpyexiv2_wrapper.cpp8
3 files changed, 12 insertions, 8 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp
index 93b0f02..4bd515e 100644
--- a/src/libpyexiv2.cpp
+++ b/src/libpyexiv2.cpp
@@ -74,7 +74,7 @@ namespace LibPyExiv2
throw Exiv2::Error(METADATA_NOT_READ);
}
- boost::python::list Image::getAvailableExifTags()
+ boost::python::list Image::exifKeys()
{
boost::python::list list;
if(_dataRead)
@@ -176,7 +176,7 @@ namespace LibPyExiv2
throw Exiv2::Error(METADATA_NOT_READ);
}
- boost::python::list Image::getAvailableIptcTags()
+ boost::python::list Image::iptcKeys()
{
boost::python::list list;
if(_dataRead)
@@ -394,12 +394,12 @@ namespace LibPyExiv2
case 37:
PyErr_SetString(PyExc_IOError, message);
break;
+ case 4:
+ case 5:
case 6:
case 7:
PyErr_SetString(PyExc_IndexError, message);
break;
- case 4:
- case 5:
case 8:
case 22:
case 24:
diff --git a/src/libpyexiv2.hpp b/src/libpyexiv2.hpp
index 7178886..736d1cf 100644
--- a/src/libpyexiv2.hpp
+++ b/src/libpyexiv2.hpp
@@ -54,7 +54,7 @@ namespace LibPyExiv2
// Return a list of all the keys of available EXIF tags set in the
// image.
- boost::python::list getAvailableExifTags();
+ boost::python::list exifKeys();
// Return a tuple containing the type (as a string) and the value
// (as a string as well) of the required EXIF tag.
@@ -83,7 +83,7 @@ namespace LibPyExiv2
// Returns a list of all the keys of available IPTC tags set in the
// image. This list has no duplicates: each of its items is unique,
// even if a tag is present more than once.
- boost::python::list getAvailableIptcTags();
+ boost::python::list iptcKeys();
// Return a list of tuples, each containing the type (as a string) and
// the value (as a string as well) of the required IPTC tag.
diff --git a/src/libpyexiv2_wrapper.cpp b/src/libpyexiv2_wrapper.cpp
index f78236e..dc9152f 100644
--- a/src/libpyexiv2_wrapper.cpp
+++ b/src/libpyexiv2_wrapper.cpp
@@ -39,17 +39,21 @@ BOOST_PYTHON_MODULE(libpyexiv2)
// Exported method names prefixed by "_Image__" are going to be "private"
// and are not meant to be used directly
class_<Image>("Image", init<std::string>())
+
.def("readMetadata", &Image::readMetadata)
.def("writeMetadata", &Image::writeMetadata)
- .def("exifKeys", &Image::getAvailableExifTags)
+
+ .def("exifKeys", &Image::exifKeys)
.def("_Image__getExifTag", &Image::getExifTag)
.def("_Image__getExifTagToString", &Image::getExifTagToString)
.def("_Image__setExifTag", &Image::setExifTag)
.def("_Image__deleteExifTag", &Image::deleteExifTag)
- .def("iptcKeys", &Image::getAvailableIptcTags)
+
+ .def("iptcKeys", &Image::iptcKeys)
.def("_Image__getIptcTag", &Image::getIptcTag)
.def("_Image__setIptcTag", &Image::setIptcTag)
.def("_Image__deleteIptcTag", &Image::deleteIptcTag)
+
.def("getThumbnailData", &Image::getThumbnailData)
.def("setThumbnailData", &Image::setThumbnailData)
.def("deleteThumbnail", &Image::deleteThumbnail)