changeset 221:64d438ab8272

text_x_arnica.get_exif_info: refactored exception
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 01 Sep 2008 17:51:46 +0200
parents 362a85e8a378
children 873b2bb15da8
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Mon Sep 01 17:40:19 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Mon Sep 01 17:51:46 2008 +0200
@@ -138,7 +138,6 @@
         @key: cache key for file_name
         """
         date = "--"
-        rawExif = None
         if not (Image and ExifTags):
             # in that case no hint about a missing module
             return date
@@ -150,14 +149,13 @@
                 cache_date = caching.CacheEntry(self.request, cache.cache_arena, date_key+'.data',
                                        cache.cache_scope, do_locking=False)
                 return cache_date.content()
-            # ToDo simplify try, except, else
+
             try:
                 im = Image.open(file_name)
                 rawExif = im._getexif().items()
             except (IOError, AttributeError, KeyError):
                 pass
-
-            if rawExif:
+            else:
                 for key, value in rawExif:
                     if ExifTags.TAGS.get(key) == 'DateTimeOriginal':
                         date = str(value)