Revert of 215589 because of changes in the GTK package for Win

svn: r21581
This commit is contained in:
Helge Herz 2013-03-07 23:26:43 +00:00
parent a5b4759f40
commit 47b8dc8131

View File

@ -21,13 +21,6 @@
# #
# $Id$ # $Id$
# #
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
import sys
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# GNOME modules # GNOME modules
@ -35,7 +28,6 @@ import sys
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GExiv2 from gi.repository import GExiv2
from gramps.gen.constfunc import win
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -180,18 +172,7 @@ class MetadataView(Gtk.TreeView):
""" """
self.sections = {} self.sections = {}
self.model.clear() 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: try:
metadata = GExiv2.Metadata(full_path) metadata = GExiv2.Metadata(full_path)
except: except:
@ -200,14 +181,9 @@ class MetadataView(Gtk.TreeView):
get_human = metadata.get_exif_tag_interpreted_string get_human = metadata.get_exif_tag_interpreted_string
for section, key, key2, func in TAGS: 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(): if not key in metadata.get_exif_tags():
continue continue
if func is not None: if func is not None:
if key2 is None: if key2 is None:
human_value = func(metadata[key]) human_value = func(metadata[key])