preserve full path for photos after import
svn: r1497
This commit is contained in:
parent
59f87c9487
commit
a1374f76dc
@ -988,13 +988,12 @@ class GrampsImportParser(GrampsParser):
|
|||||||
src = attrs["src"]
|
src = attrs["src"]
|
||||||
if src:
|
if src:
|
||||||
if src[0] != '/':
|
if src[0] != '/':
|
||||||
self.object.setPath("%s/%s" % (self.base,src))
|
self.object.setPath("%s/%s" % (self.db.getSavePath(),src))
|
||||||
self.object.setLocal(1)
|
self.object.setLocal(1)
|
||||||
else:
|
else:
|
||||||
self.object.setPath(src)
|
self.object.setPath(src)
|
||||||
self.object.setLocal(0)
|
self.object.setLocal(0)
|
||||||
|
|
||||||
|
|
||||||
def append_value(orig,val):
|
def append_value(orig,val):
|
||||||
if orig:
|
if orig:
|
||||||
return "%s, %s" % (orig,val)
|
return "%s, %s" % (orig,val)
|
||||||
|
@ -121,7 +121,7 @@ def importData(database, filename, callback):
|
|||||||
oldfile = ObjectMap[NewMediaID].getPath()
|
oldfile = ObjectMap[NewMediaID].getPath()
|
||||||
oldpath = os.path.dirname(oldfile)
|
oldpath = os.path.dirname(oldfile)
|
||||||
(junk,oldext) = os.path.splitext(os.path.basename(oldfile))
|
(junk,oldext) = os.path.splitext(os.path.basename(oldfile))
|
||||||
ObjectMap[NewMediaID].setPath(NewMediaID + oldext)
|
ObjectMap[NewMediaID].setLocal(1)
|
||||||
if NewMediaID != OldMediaID:
|
if NewMediaID != OldMediaID:
|
||||||
newfile = os.path.join( basefile, NewMediaID + oldext )
|
newfile = os.path.join( basefile, NewMediaID + oldext )
|
||||||
os.rename(oldfile,newfile)
|
os.rename(oldfile,newfile)
|
||||||
|
@ -2372,9 +2372,6 @@ class GrampsDB(Persistent):
|
|||||||
"""adds a Place instance to the database, assigning it a gramps'
|
"""adds a Place instance to the database, assigning it a gramps'
|
||||||
ID number"""
|
ID number"""
|
||||||
|
|
||||||
# import traceback
|
|
||||||
# traceback.print_stack()
|
|
||||||
|
|
||||||
index = self.pprefix % self.lmapIndex
|
index = self.pprefix % self.lmapIndex
|
||||||
while self.placeMap.has_key(index):
|
while self.placeMap.has_key(index):
|
||||||
self.lmapIndex = self.lmapIndex + 1
|
self.lmapIndex = self.lmapIndex + 1
|
||||||
|
@ -134,7 +134,7 @@ class ReadPkg:
|
|||||||
self.callback(1)
|
self.callback(1)
|
||||||
|
|
||||||
def progress(self,val):
|
def progress(self,val):
|
||||||
self.progress_bar.set_value(val*100.0)
|
self.progress_bar.set_fraction(val)
|
||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.mainiteration()
|
gtk.mainiteration()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user