From 91bfec54c04deeedf99c3cf78ae106b4ff7db675 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 25 Sep 2001 22:45:22 +0000 Subject: [PATCH] Fixed gedcom read/write for URL and RESI problems svn: r429 --- src/plugins/ReadGedcom.py | 4 +++- src/plugins/WriteGedcom.py | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/plugins/ReadGedcom.py b/src/plugins/ReadGedcom.py index 0a97934a6..f51ada303 100644 --- a/src/plugins/ReadGedcom.py +++ b/src/plugins/ReadGedcom.py @@ -752,7 +752,9 @@ class GedcomParser: self.barf(level+1) if form == "url": - url = Url(file,title) + url = Url() + url.set_path(file) + url.set_description(title) self.person.addUrl(url) elif form in photo_types: path = find_file(file,self.dir_path) diff --git a/src/plugins/WriteGedcom.py b/src/plugins/WriteGedcom.py index e3477dc64..1325bb407 100644 --- a/src/plugins/WriteGedcom.py +++ b/src/plugins/WriteGedcom.py @@ -245,18 +245,21 @@ def sortById(first,second): def write_long_text(g,tag,level,note): prefix = "%d %s" % (level,tag) textlines = string.split(note,'\n') - for line in textlines: - while len(line) > 0: - if len(line) > 70: - g.write("%s %s\n" % (prefix,line[0:70])) - line = line[70:] - else: - g.write("%s %s\n" % (prefix,line)) - line = "" - if len(line) > 0: - prefix = "%d CONC" % (level + 1) - else: - prefix = "%d CONT" % (level + 1) + if len(note) == 0: + g.write("%s\n" % prefix) + else: + for line in textlines: + while len(line) > 0: + if len(line) > 70: + g.write("%s %s\n" % (prefix,line[0:70])) + line = line[70:] + else: + g.write("%s %s\n" % (prefix,line)) + line = "" + if len(line) > 0: + prefix = "%d CONC" % (level + 1) + else: + prefix = "%d CONT" % (level + 1) #------------------------------------------------------------------------- #