preserve full path for photos after import
svn: r1497
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
        
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user