From 014ea4f3a1410b52053e049efbeefc0c2ac7ca8f Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 15 Oct 2001 04:19:17 +0000 Subject: [PATCH] Fixed path stripping in WriteXML svn: r474 --- gramps/src/WriteXML.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py index 8c8437a21..a141b817c 100644 --- a/gramps/src/WriteXML.py +++ b/gramps/src/WriteXML.py @@ -34,6 +34,7 @@ except: gzip_ok = 0 fileroot = "" +strip_photo = 0 #------------------------------------------------------------------------- # @@ -55,7 +56,7 @@ def sortById(first,second): # #------------------------------------------------------------------------- def fix(line): - l = string.strip(line) + l = string.stripline) l = string.replace(l,'&','&') l = string.replace(l,'>','>') l = string.replace(l,'<','<') @@ -336,10 +337,13 @@ def write_object(g,object): id = object.getId() type = object.getMimeType() path = object.getPath() - l = len(fileroot) - if len(path) >= l: - if fileroot == path[0:l]: - path = path[l+1:] + if strip_photo: + path = os.path.basename(path) + else: + l = len(fileroot) + if len(path) >= l: + if fileroot == path[0:l]: + path = path[l+1:] g.write('