From 8e82ce6149ba64ff03bb4e3d891d4b5f92325b66 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Thu, 29 Sep 2005 13:13:51 +0000 Subject: [PATCH] * src/plugins/ImportGeneWeb.py: convert witout using latin_utf8.py * src/plugins/ImportvCard.py: remove unused latin_utf8.py include * src/plugins/TestcaseGenerator.py: remove unused latin_utf8.py include svn: r5251 --- gramps2/ChangeLog | 5 +++++ gramps2/src/plugins/ImportGeneWeb.py | 21 +++++++++------------ gramps2/src/plugins/ImportvCard.py | 1 - gramps2/src/plugins/TestcaseGenerator.py | 1 - 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 6207d6862..f081258f9 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-09-29 Martin Hawlisch + * src/plugins/ImportGeneWeb.py: convert witout using latin_utf8.py + * src/plugins/ImportvCard.py: remove unused latin_utf8.py include + * src/plugins/TestcaseGenerator.py: remove unused latin_utf8.py include + 2005-09-28 Don Allingham * src/NameDisplay.py: Add display_formal * src/Report.py: remove generation strings diff --git a/gramps2/src/plugins/ImportGeneWeb.py b/gramps2/src/plugins/ImportGeneWeb.py index 892b4c422..1c89d10c6 100644 --- a/gramps2/src/plugins/ImportGeneWeb.py +++ b/gramps2/src/plugins/ImportGeneWeb.py @@ -47,7 +47,6 @@ import gtk.glade #------------------------------------------------------------------------- import Errors import RelLib -import latin_utf8 import Utils import const from QuestionDialog import ErrorDialog @@ -100,7 +99,7 @@ class GeneWebParser: self.lineno += 1 line = self.f.readline() if line: - line = line.strip() + line = unicode( line.strip()) else: line = None return line @@ -282,7 +281,7 @@ class GeneWebParser: if not self.current_family: print "Unknown family of child in line %d!" % self.lineno return None - self.current_family.set_note(self.cnv(line)) + self.current_family.set_note(line) self.db.commit_family(self.current_family,self.trans) return None @@ -301,9 +300,9 @@ class GeneWebParser: continue else: if note_txt: - note_txt = note_txt + "\n" + self.cnv(line) + note_txt = note_txt + "\n" + line else: - note_txt = note_txt + self.cnv(line) + note_txt = note_txt + line if note_txt: person.set_note(note_txt) self.db.commit_person(person,self.trans) @@ -327,7 +326,8 @@ class GeneWebParser: #Alex: this failed when fields[idx] was an empty line. Fixed. #while idx < len(fields) and not fields[idx][0] == "+": while idx < len(fields) and not (fields[idx] and fields[idx][0] == "+"): - print "Unknown field: '%s' in line %d!" %(fields[idx],self.lineno) + if fields[idx]: + print "Unknown field: '%s' in line %d!" %(fields[idx],self.lineno) idx = idx + 1 while idx < len(fields) and mariageDataRe.match(fields[idx]): @@ -403,11 +403,11 @@ class GeneWebParser: if not idx < len(fields): print "Missing firstname of person in line %d!" % self.lineno return (idx,None) - firstname = self.decode(self.cnv(fields[idx])) + firstname = self.decode(fields[idx]) idx = idx + 1 if idx < len(fields) and father_surname: noSurnameRe = re.compile("^[({\[~>