4849: Prevent errors in gramplets that depend on the pyexiv2 module when this module is not available
svn: r17186
This commit is contained in:
@@ -16,14 +16,14 @@ pkgdata_PYTHON = \
|
||||
Children.py \
|
||||
DescendGramplet.py \
|
||||
Events.py \
|
||||
Exif.py \
|
||||
FanChartGramplet.py \
|
||||
FaqGramplet.py \
|
||||
Filter.py \
|
||||
Filter.py \
|
||||
Gallery.py \
|
||||
GivenNameGramplet.py \
|
||||
gramplet.gpr.py \
|
||||
MediaPreview.py \
|
||||
MetadataViewer.py \
|
||||
Notes.py \
|
||||
PedigreeGramplet.py \
|
||||
PersonDetails.py \
|
||||
|
@@ -63,7 +63,7 @@ if not pyexiv2_req_install:
|
||||
Min_VERSION_str, _DOWNLOAD_LINK, PrefVersion_str)
|
||||
).encode(sys.getfilesystemencoding()) )
|
||||
|
||||
class Exif(Gramplet):
|
||||
class MetadataViewer(Gramplet):
|
||||
"""
|
||||
Displays the exif tags of an image.
|
||||
"""
|
@@ -77,20 +77,27 @@ register(GRAMPLET,
|
||||
gramplet_title=_("Preview"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id = "Exif Viewer Gramplet",
|
||||
name = _("Exif Viewer Gramplet"),
|
||||
description = _("Gramplet showing exif tags for a media object"),
|
||||
version = "1.0.0",
|
||||
gramps_target_version = "3.4",
|
||||
status = STABLE,
|
||||
fname = "Exif.py",
|
||||
height = 200,
|
||||
gramplet = 'Exif',
|
||||
gramplet_title = _("Exif"),
|
||||
authors = ["Rob G. Healey"],
|
||||
authors_email = ["robhealey1@gmail.com"],
|
||||
)
|
||||
try:
|
||||
import pyexiv2
|
||||
available = True
|
||||
except:
|
||||
print _("WARNING: pyexiv2 module not loaded. "
|
||||
"Image metadata functionality will not be available.")
|
||||
available = False
|
||||
|
||||
if available:
|
||||
register(GRAMPLET,
|
||||
id = "Metadata Viewer Gramplet",
|
||||
name = _("Metadata Viewer Gramplet"),
|
||||
description = _("Gramplet showing metadata for a media object"),
|
||||
version = "1.0.0",
|
||||
gramps_target_version = "3.4",
|
||||
status = STABLE,
|
||||
fname = "MetadataViewer.py",
|
||||
height = 200,
|
||||
gramplet = 'MetadataViewer',
|
||||
gramplet_title = _("Image Metadata"),
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Person Residence Gramplet",
|
||||
|
@@ -425,8 +425,8 @@ class MediaView(ListView):
|
||||
"""
|
||||
return (("Media Filter Gramplet",),
|
||||
("Media Preview Gramplet",
|
||||
"Exif Viewer Gramplet",
|
||||
"Media Sources Gramplet",
|
||||
"Media Notes Gramplet",
|
||||
"Media Attributes Gramplet",
|
||||
"Metadata Viewer Gramplet",
|
||||
"Media Backlinks Gramplet"))
|
||||
|
Reference in New Issue
Block a user