aboutsummaryrefslogtreecommitdiffstats
path: root/src/pyexiv2.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-01-12 20:34:21 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-01-12 20:34:21 +0100
commitcd660c12a72782ff6e9d919bda51db5de0e440ed (patch)
treea856f19a2102d7905c3c6921abf6d96b81ca087a /src/pyexiv2.py
parent3528a5f69b6f16c00673e2e0c9966a6d88fb0163 (diff)
downloadpyexiv2-cd660c12a72782ff6e9d919bda51db5de0e440ed.tar.gz
Retrieve XMP tag values (without python type conversion atm).
Diffstat (limited to 'src/pyexiv2.py')
-rw-r--r--src/pyexiv2.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 801711e..a013c1f 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -416,7 +416,7 @@ class ExifTag(MetadataTag):
def __str__(self):
"""
- Return a string representation of the metadata tag.
+ Return a string representation of the EXIF tag.
"""
r = MetadataTag.__str__(self)
r += os.linesep + 'Formatted value = ' + self.fvalue
@@ -454,7 +454,35 @@ class IptcTag(MetadataTag):
def __str__(self):
"""
- Return a string representation of the metadata tag.
+ Return a string representation of the IPTC tag.
+ """
+ r = MetadataTag.__str__(self)
+ return r.replace('Raw value = ', 'Raw values = ')
+
+
+class XmpTag(MetadataTag):
+
+ """
+ An XMP metadata tag can have several values.
+ """
+
+ def __init__(self, key, name, label, description, type, values):
+ """
+ Constructor.
+ """
+ MetadataTag.__init__(self, key, name, label, description, type, values)
+ self.__convert_values_to_python_type()
+
+ def __convert_values_to_python_type(self):
+ """
+ Convert the stored values from strings to the matching Python type.
+ """
+ # TODO!
+ pass
+
+ def __str__(self):
+ """
+ Return a string representation of the XMP tag.
"""
r = MetadataTag.__str__(self)
return r.replace('Raw value = ', 'Raw values = ')