From cca1c0aff9e550e6f840c7a8ea95fc90d07e4177 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 14 Oct 2001 20:57:47 +0000 Subject: [PATCH] Fixed writing a gramps package svn: r472 --- gramps/src/plugins/WritePkg.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gramps/src/plugins/WritePkg.py b/gramps/src/plugins/WritePkg.py index 2bfe8439e..8210e5fef 100644 --- a/gramps/src/plugins/WritePkg.py +++ b/gramps/src/plugins/WritePkg.py @@ -82,36 +82,40 @@ def exportData(database, filename): for f in database.getPersonMap().values(): for p in f.getPhotoList(): - base = os.path.basename(p.getPath()) + object = p.getReference() + base = os.path.basename(object.getPath()) try: - g = open(p.getPath(),"rb") + g = open(object.getPath(),"rb") t.add_file(base,mtime,g) g.close() except: pass for f in database.getFamilyMap().values(): for p in f.getPhotoList(): - base = os.path.basename(p.getPath()) + object = p.getReference() + base = os.path.basename(object.getPath()) try: - g = open(p.getPath(),"rb") + g = open(object.getPath(),"rb") t.add_file(base,mtime,g) g.close() except: pass for f in database.getSourceMap().values(): for p in f.getPhotoList(): - base = os.path.basename(p.getPath()) + object = p.getReference() + base = os.path.basename(object.getPath()) try: - g = open(p.getPath(),"rb") + g = open(object.getPath(),"rb") t.add_file(base,mtime,g) g.close() except: pass for f in database.getPlaceMap().values(): for p in f.getPhotoList(): - base = os.path.basename(p.getPath()) + object = p.getReference() + base = os.path.basename(object.getPath()) try: - g = open(p.getPath(),"rb") + g = open(object.getPath(),"rb") t.add_file(base,mtime,g) g.close() except: