preserve full path for photos after import

svn: r1497
This commit is contained in:
Don Allingham 2003-05-06 02:55:54 +00:00
parent 59f87c9487
commit a1374f76dc
4 changed files with 3 additions and 7 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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()