From 47b8dc8131c895d9413be4828bcfb9ab08de5718 Mon Sep 17 00:00:00 2001 From: Helge Herz Date: Thu, 7 Mar 2013 23:26:43 +0000 Subject: [PATCH] Revert of 215589 because of changes in the GTK package for Win svn: r21581 --- gramps/plugins/lib/libmetadata.py | 60 ++++++++++--------------------- 1 file changed, 18 insertions(+), 42 deletions(-) diff --git a/gramps/plugins/lib/libmetadata.py b/gramps/plugins/lib/libmetadata.py index e8c056a08..d3f82edc7 100644 --- a/gramps/plugins/lib/libmetadata.py +++ b/gramps/plugins/lib/libmetadata.py @@ -21,13 +21,6 @@ # # $Id$ # -#------------------------------------------------------------------------- -# -# Python modules -# -#------------------------------------------------------------------------- -import sys - #------------------------------------------------------------------------- # # GNOME modules @@ -35,7 +28,6 @@ import sys #------------------------------------------------------------------------- from gi.repository import Gtk from gi.repository import GExiv2 -from gramps.gen.constfunc import win #------------------------------------------------------------------------- # @@ -180,46 +172,30 @@ class MetadataView(Gtk.TreeView): """ self.sections = {} self.model.clear() - if (sys.version_info[0] < 3) and win(): - #May be it's also necessary for lin and sys.version_info[0] < 3 - #if so, remove 'and win()' - #currently it's tested for Win only - metadata = GExiv2.Metadata.new() - try: - if not metadata.open_path(full_path): - return False - except: - # may be wrong file name - return False - else: - try: - metadata = GExiv2.Metadata(full_path) - except: - return False + + try: + metadata = GExiv2.Metadata(full_path) + except: + return False get_human = metadata.get_exif_tag_interpreted_string for section, key, key2, func in TAGS: - if (sys.version_info[0] < 3) and win(): - #May be it's also necessary for lin and sys.version_info[0] < 3 - #if so, remove 'and win()' - #currently it's tested for Win only - human_value = get_human(key) - else: - if not key in metadata.get_exif_tags(): - continue - if func is not None: - if key2 is None: - human_value = func(metadata[key]) - else: - if key2 in metadata.get_exif_tags(): - human_value = func(metadata[key], metadata[key2]) - else: - human_value = func(metadata[key], None) + if not key in metadata.get_exif_tags(): + continue + + if func is not None: + if key2 is None: + human_value = func(metadata[key]) else: - human_value = get_human(key) if key2 in metadata.get_exif_tags(): - human_value += ' ' + get_human(key2) + human_value = func(metadata[key], metadata[key2]) + else: + human_value = func(metadata[key], None) + else: + human_value = get_human(key) + if key2 in metadata.get_exif_tags(): + human_value += ' ' + get_human(key2) label = metadata.get_exif_tag_label(key) node = self.__add_section(section)