* src/plugins/IndivComplete.py (write_person): Catch missing image files.

svn: r7397
This commit is contained in:
Martin Hawlisch 2006-10-11 19:40:08 +00:00
parent 764d88ed61
commit f645ec1ac2
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2006-10-11 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/IndivComplete.py (write_person): Catch missing image
files.
2006-10-11 Alex Roitman <shura@gramps-project.org> 2006-10-11 Alex Roitman <shura@gramps-project.org>
* src/GrampsDisplay.py (help): Rename gramps-manual to gramps. * src/GrampsDisplay.py (help): Rename gramps-manual to gramps.

View File

@ -50,6 +50,7 @@ from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \ from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
from NameDisplay import displayer as _nd from NameDisplay import displayer as _nd
from QuestionDialog import WarningDialog
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
@ -428,10 +429,14 @@ class IndivCompleteReport(Report):
object = self.database.get_object_from_handle(object_handle) object = self.database.get_object_from_handle(object_handle)
mime_type = object.get_mime_type() mime_type = object.get_mime_type()
if mime_type and mime_type.startswith("image"): if mime_type and mime_type.startswith("image"):
file = object.get_path() filename = object.get_path()
self.doc.start_paragraph("IDS-Normal") if os.path.exists(filename):
self.doc.add_media_object(file,"row",4.0,4.0) self.doc.start_paragraph("IDS-Normal")
self.doc.end_paragraph() self.doc.add_media_object(filename,"row",4.0,4.0)
self.doc.end_paragraph()
else:
WarningDialog(_("Could not add photo to page"),
"%s: %s" % (filename, _('File does not exist')))
self.doc.start_table("one","IDS-IndTable") self.doc.start_table("one","IDS-IndTable")