From d70cf37db7778ad0dedfb2789cfb33b76110e9e6 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 6 May 2003 02:55:54 +0000 Subject: [PATCH] preserve full path for photos after import svn: r1497 --- gramps2/src/GrampsParser.py | 3 +-- gramps2/src/ReadXML.py | 2 +- gramps2/src/RelLib.py | 3 --- gramps2/src/plugins/ReadPkg.py | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gramps2/src/GrampsParser.py b/gramps2/src/GrampsParser.py index ec2bd1123..cc8d05a7d 100644 --- a/gramps2/src/GrampsParser.py +++ b/gramps2/src/GrampsParser.py @@ -988,13 +988,12 @@ class GrampsImportParser(GrampsParser): src = attrs["src"] if src: if src[0] != '/': - self.object.setPath("%s/%s" % (self.base,src)) + self.object.setPath("%s/%s" % (self.db.getSavePath(),src)) self.object.setLocal(1) else: self.object.setPath(src) self.object.setLocal(0) - def append_value(orig,val): if orig: return "%s, %s" % (orig,val) diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py index f24930ac9..50ed9ba33 100644 --- a/gramps2/src/ReadXML.py +++ b/gramps2/src/ReadXML.py @@ -121,7 +121,7 @@ def importData(database, filename, callback): oldfile = ObjectMap[NewMediaID].getPath() oldpath = os.path.dirname(oldfile) (junk,oldext) = os.path.splitext(os.path.basename(oldfile)) - ObjectMap[NewMediaID].setPath(NewMediaID + oldext) + ObjectMap[NewMediaID].setLocal(1) if NewMediaID != OldMediaID: newfile = os.path.join( basefile, NewMediaID + oldext ) os.rename(oldfile,newfile) diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index 6bc431c5c..c4d2557cb 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -2372,9 +2372,6 @@ class GrampsDB(Persistent): """adds a Place instance to the database, assigning it a gramps' ID number""" -# import traceback -# traceback.print_stack() - index = self.pprefix % self.lmapIndex while self.placeMap.has_key(index): self.lmapIndex = self.lmapIndex + 1 diff --git a/gramps2/src/plugins/ReadPkg.py b/gramps2/src/plugins/ReadPkg.py index 875c24e1c..cefc089cc 100644 --- a/gramps2/src/plugins/ReadPkg.py +++ b/gramps2/src/plugins/ReadPkg.py @@ -134,7 +134,7 @@ class ReadPkg: self.callback(1) def progress(self,val): - self.progress_bar.set_value(val*100.0) + self.progress_bar.set_fraction(val) while gtk.events_pending(): gtk.mainiteration()