From 0aefbc706ab88c6744cb05c31c8f7a7aaa0d5578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Charette?= Date: Sat, 3 Nov 2007 05:43:12 +0000 Subject: [PATCH] issue #1340, don't display mime-type svn: r9290 --- ChangeLog | 4 ++++ src/plugins/NarrativeWeb.py | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1ab38391..9ef1e5146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-11-02 Stéphane Charette + * src/plugins/NarrativeWeb.py: issue #1340, do not display mime-types + in NarrativeWeb for image/* + 2007-11-01 Martin Hawlisch * configure.in: We have a runtime check for Python 2.5. Do the same here by using AM_PATH_PYTHON(2.5) diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index c49b6aa6f..cfe7fd954 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -79,6 +79,7 @@ import Errors import Utils import ThumbNails import GrampsLocale +import Mime from QuestionDialog import ErrorDialog, WarningDialog from BasicUtils import name_displayer as _nd from DateHandler import displayer as _dd @@ -1066,9 +1067,9 @@ class MediaPage(BasePage): BasePage.__init__(self, title, options, archive, media_list, photo.gramps_id) of = self.create_link_file(handle,"img") - + mime_type = photo.get_mime_type() - + if mime_type: note_only = False newpath = self.copy_source_file(handle, photo) @@ -1078,11 +1079,11 @@ class MediaPage(BasePage): target_exists = False self.copy_thumbnail(handle, photo) - + self.page_title = photo.get_description() self.display_header(of,db, "%s - %s" % (_('Gallery'), title), get_researcher().get_name(),up=True) - + of.write('
\n') of.write('

%s

\n' % self.page_title.strip()) @@ -1147,10 +1148,10 @@ class MediaPage(BasePage): of.write('%s\n' % _('GRAMPS ID')) of.write('%s\n' % photo.gramps_id) of.write('\n') - if not note_only: + if not note_only and not mime_type.startswith("image/"): of.write('\n') of.write('%s\n' % _('File type')) - of.write('%s\n' % photo.mime) + of.write('%s\n' % Mime.get_description(mime_type)) of.write('\n') date = _dd.display(photo.get_date_object()) if date != "":