* src/ReportUtils.py (insert_images): Warn about non existing files
svn: r5153
This commit is contained in:
parent
8c2906ef6e
commit
f8f6f500ef
@ -1,3 +1,6 @@
|
||||
2005-08-31 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/ReportUtils.py (insert_images): Warn about non existing files
|
||||
|
||||
2005-08-30 Alex Roitman <shura@gramps-project.org>
|
||||
* src/po/ru.po: Translation update for 2.0.7.
|
||||
|
||||
|
@ -30,7 +30,9 @@ import Date
|
||||
import DateHandler
|
||||
import RelLib
|
||||
from NameDisplay import displayer as _nd
|
||||
from QuestionDialog import WarningDialog
|
||||
import time
|
||||
import os
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -486,7 +488,11 @@ def insert_images(database, doc, person, w_cm=4.0, h_cm=4.0):
|
||||
mime_type = media_object.get_mime_type()
|
||||
if mime_type and mime_type.startswith("image"):
|
||||
filename = media_object.get_path()
|
||||
doc.add_media_object(filename,"row",w_cm,h_cm)
|
||||
if os.path.exists(filename):
|
||||
doc.add_media_object(filename,"row",w_cm,h_cm)
|
||||
else:
|
||||
WarningDialog(_("Could not add photo to page"),
|
||||
"%s: %s" % (filename, _('File does not exist')))
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user