From dc9b63f76b056a9ed4c10c701511f50da4491e09 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 4 Feb 2009 20:20:53 +0100 Subject: XMP Integer to string conversion + unit tests. --- src/pyexiv2.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pyexiv2.py b/src/pyexiv2.py index 1b54782..a24492c 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -608,6 +608,7 @@ class XmpTag(MetadataTag): elif xtype == 'Locale': # TODO + # See RFC 3066 raise NotImplementedError('XMP conversion for type [%s]' % xtype) elif xtype == 'MIMEType': @@ -633,7 +634,6 @@ class XmpTag(MetadataTag): raise NotImplementedError('XMP conversion for type [%s]' % xtype) elif xtype in ('URI', 'URL'): - # TODO: use urlparse? return value elif xtype == 'XPath': @@ -660,6 +660,12 @@ class XmpTag(MetadataTag): if xtype == 'Boolean' and type(value) is bool: return str(value) + elif xtype == 'Integer': + if type(value) in (int, long): + return str(value) + else: + raise XmpValueError(value, xtype) + elif xtype == 'Text': if type(value) is unicode: try: -- cgit