From 3b91e4461c151526b0d02e2effaae869de33a96c Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 8 Apr 2009 09:34:27 +0200 Subject: Dictionary-like del for all tags. --- src/pyexiv2.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pyexiv2.py b/src/pyexiv2.py index 014b58f..782bd44 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -1163,8 +1163,15 @@ class ImageMetadata(object): raise NotImplementedError() def __delitem__(self, key): - # TODO - raise NotImplementedError() + """ + Delete a metadata tag with a given key. + DOCME. + """ + family = key.split('.')[0].lower() + try: + return getattr(self, '_delete_%s_tag' % family)(key) + except AttributeError: + raise KeyError(key) class Image(libexiv2python.Image): -- cgit