* src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no

surname (bug #1603)

2008-01-15  Douglas S. Blank  <dblank@cs.brynmawr.edu>


svn: r9823
This commit is contained in:
Doug Blank 2008-01-15 18:34:09 +00:00
parent a453da4b6c
commit d1bc327764
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no
surname (bug #1603)
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/DefaultGramplets.py (TopSurnamesGramplet.main): make
clicking on data easier by clicking on entire line (bug #1594)

View File

@ -425,13 +425,13 @@ class CSVParser:
# if this person already exists, don't create them
person = self.lookup("person", person_ref)
if person == None:
if surname == None and firstname == "":
print "Error: need both firstname and surname for new person on line %d" % line_number
continue # need a name if it is a new person
if surname == None:
print "Warning: empty surname for new person on line %d" % line_number
surname = ""
# new person
person = self.create_person(firstname, surname)
name = gen.lib.Name()
name.set_type( gen.lib.NameType(gen.lib.NameType.BIRTH))
name.set_type(gen.lib.NameType(gen.lib.NameType.BIRTH))
name.set_first_name(firstname)
name.set_surname(surname)
person.set_primary_name(name)