* src/plugins/ImportGeneWeb.py: handle people with no firstname
or lastname, if encoding fails, attempt and iso-8859-1 conversion svn: r5998
This commit is contained in:
parent
0043572c35
commit
94056f3602
@ -1,3 +1,7 @@
|
|||||||
|
2006-02-26 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/plugins/ImportGeneWeb.py: handle people with no firstname
|
||||||
|
or lastname, if encoding fails, attempt and iso-8859-1 conversion
|
||||||
|
|
||||||
2006-02-26 Alex Roitman <shura@gramps-project.org>
|
2006-02-26 Alex Roitman <shura@gramps-project.org>
|
||||||
* gramps.sh.in: Update copyright year.
|
* gramps.sh.in: Update copyright year.
|
||||||
* src/po/Makefile.am (.po.mo): Avoid using temp file as it breaks
|
* src/po/Makefile.am (.po.mo): Avoid using temp file as it breaks
|
||||||
|
@ -113,7 +113,10 @@ class GeneWebParser:
|
|||||||
self.lineno += 1
|
self.lineno += 1
|
||||||
line = self.f.readline()
|
line = self.f.readline()
|
||||||
if line:
|
if line:
|
||||||
|
try:
|
||||||
line = unicode(line.strip())
|
line = unicode(line.strip())
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
line = unicode(line.strip(),'iso-8859-1')
|
||||||
else:
|
else:
|
||||||
line = None
|
line = None
|
||||||
return line
|
return line
|
||||||
@ -260,8 +263,6 @@ class GeneWebParser:
|
|||||||
else:
|
else:
|
||||||
(idx,child) = self.parse_person(fields,1,RelLib.Person.UNKNOWN,father_surname)
|
(idx,child) = self.parse_person(fields,1,RelLib.Person.UNKNOWN,father_surname)
|
||||||
|
|
||||||
print child.get_gender(),":",fields[1], child.get_primary_name().get_name()
|
|
||||||
|
|
||||||
if child:
|
if child:
|
||||||
self.current_family.add_child_handle(child.get_handle())
|
self.current_family.add_child_handle(child.get_handle())
|
||||||
self.db.commit_family(self.current_family,self.trans)
|
self.db.commit_family(self.current_family,self.trans)
|
||||||
@ -304,7 +305,7 @@ class GeneWebParser:
|
|||||||
def read_notes_lines(self,line,fields):
|
def read_notes_lines(self,line,fields):
|
||||||
(idx,person) = self.parse_person(fields,1,None,None)
|
(idx,person) = self.parse_person(fields,1,None,None)
|
||||||
note_txt = ""
|
note_txt = ""
|
||||||
while 1:
|
while True:
|
||||||
line = self.get_next_line()
|
line = self.get_next_line()
|
||||||
if line == None:
|
if line == None:
|
||||||
break
|
break
|
||||||
@ -404,7 +405,8 @@ class GeneWebParser:
|
|||||||
if not father_surname:
|
if not father_surname:
|
||||||
if not idx < len(fields):
|
if not idx < len(fields):
|
||||||
print "Missing surname of person in line %d!" % self.lineno
|
print "Missing surname of person in line %d!" % self.lineno
|
||||||
return (idx,None)
|
surname =""
|
||||||
|
else:
|
||||||
surname = self.decode(fields[idx])
|
surname = self.decode(fields[idx])
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
else:
|
else:
|
||||||
@ -412,7 +414,8 @@ class GeneWebParser:
|
|||||||
|
|
||||||
if not idx < len(fields):
|
if not idx < len(fields):
|
||||||
print "Missing firstname of person in line %d!" % self.lineno
|
print "Missing firstname of person in line %d!" % self.lineno
|
||||||
return (idx,None)
|
firstname = ""
|
||||||
|
else:
|
||||||
firstname = self.decode(fields[idx])
|
firstname = self.decode(fields[idx])
|
||||||
idx = idx + 1
|
idx = idx + 1
|
||||||
if idx < len(fields) and father_surname:
|
if idx < len(fields) and father_surname:
|
||||||
|
Loading…
Reference in New Issue
Block a user