diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-01-12 20:34:21 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-01-12 20:34:21 +0100 |
commit | cd660c12a72782ff6e9d919bda51db5de0e440ed (patch) | |
tree | a856f19a2102d7905c3c6921abf6d96b81ca087a /src/pyexiv2.py | |
parent | 3528a5f69b6f16c00673e2e0c9966a6d88fb0163 (diff) | |
download | pyexiv2-cd660c12a72782ff6e9d919bda51db5de0e440ed.tar.gz |
Retrieve XMP tag values (without python type conversion atm).
Diffstat (limited to 'src/pyexiv2.py')
-rw-r--r-- | src/pyexiv2.py | 32 |
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 = ') |