* src/ImageSelect.py: Display GRAMPS ID, not DB handle

* src/WriteGedcom.py: handle image file problems when exporting


svn: r3508
This commit is contained in:
Don Allingham 2004-08-25 03:25:23 +00:00
parent 3b7c81fbe7
commit b85614c491
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
2004-08-24 Don Allingham <dallingham@users.sourceforge.net>
* src/ReadXML.py: Fix file copy problem, handle copy failure
* src/src/ImageSelect.py: Display GRAMPS ID, not DB handle
* src/ImageSelect.py: Display GRAMPS ID, not DB handle
* src/WriteGedcom.py: handle image file problems when exporting
2004-08-24 Martin Hawlisch <loshawlos@users.sourceforge.net>
* src/plugins/WebPage.py: web page enhancements, including

View File

@ -1029,17 +1029,21 @@ class GedcomWriter:
photo_obj_id = photo.get_reference_handle()
photo_obj = self.db.get_object_from_handle(photo_obj_id)
if photo_obj and photo_obj.get_mime_type() == "image/jpeg":
path = photo_obj.get_path ()
print path
if not os.path.isfile(path):
continue
self.writeln('1 OBJE')
self.writeln('2 FORM jpeg')
path = photo_obj.get_path ()
dirname = os.path.join (self.dirname, self.images_path)
basename = os.path.basename (path)
self.writeln('2 FILE %s' % os.path.join(self.images_path,
basename))
try:
os.mkdir (dirname)
if not os.path.isdir(dirname):
os.mkdir (dirname)
except:
pass
continue
dest = os.path.join (dirname, basename)
try:
os.link (path, dest)