From 1f25c6fd381b74f9fdcfca95786ea24a69ea70ed Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 18 May 2005 20:27:02 +0000 Subject: [PATCH] * src/ReadGedcom.py: grab description for birth and death events * src/WriteGedcom.py: export description for birth and death events * example/gedcom/sample.ged: add test case svn: r4617 --- gramps2/ChangeLog | 5 +++++ gramps2/example/gedcom/sample.ged | 2 +- gramps2/src/ReadGedcom.py | 4 ++++ gramps2/src/WriteGedcom.py | 10 ++++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 54d36e2aa..8fc14dc3c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-05-18 Don Allingham + * src/ReadGedcom.py: grab description for birth and death events + * src/WriteGedcom.py: export description for birth and death events + * example/gedcom/sample.ged: add test case + 2005-05-18 Martin Hawlisch * src/GrampsInMemDB.py: Emit the *-delete signals correctly. * src/GrampsDbBase.py: Emission of the *-update/*-add signals should not depend diff --git a/gramps2/example/gedcom/sample.ged b/gramps2/example/gedcom/sample.ged index 4bd0663a2..ed56d2f8b 100755 --- a/gramps2/example/gedcom/sample.ged +++ b/gramps2/example/gedcom/sample.ged @@ -62,7 +62,7 @@ 1 OBJE 2 FROM jpeg 2 FILE foo/O0.jpg -1 BIRT +1 BIRT Edwin Michael Smith's Birth event 2 DATE 24 MAY 1961 2 PLAC San Jose, Santa Clara Co., CA 1 OCCU diff --git a/gramps2/src/ReadGedcom.py b/gramps2/src/ReadGedcom.py index 4c7277988..f503ea984 100644 --- a/gramps2/src/ReadGedcom.py +++ b/gramps2/src/ReadGedcom.py @@ -1025,6 +1025,8 @@ class GedcomParser: self.person.add_address(addr) elif matches[1] == "BIRT": event = RelLib.Event() + if matches[2]: + event.set_description(matches[2]) self.db.add_event(event, self.trans) if self.person.get_birth_handle(): event.set_name("Alternate Birth") @@ -1043,6 +1045,8 @@ class GedcomParser: self.db.commit_event(event, self.trans) elif matches[1] == "DEAT": event = RelLib.Event() + if matches[2]: + event.set_description(matches[2]) self.db.add_event(event, self.trans) if self.person.get_death_handle(): event.set_name("Alternate Death") diff --git a/gramps2/src/WriteGedcom.py b/gramps2/src/WriteGedcom.py index bf927eb69..e8709fa66 100644 --- a/gramps2/src/WriteGedcom.py +++ b/gramps2/src/WriteGedcom.py @@ -793,14 +793,20 @@ class GedcomWriter: birth = self.db.get_event_from_handle(birth_handle) if birth_handle and not (self.private and birth.get_privacy()): if not birth.get_date_object().is_empty() or birth.get_place_handle(): - self.writeln("1 BIRT") + if birth.get_description() != "": + self.writeln("1 BIRT %s" % birth.get_description()) + else: + self.writeln("1 BIRT") self.dump_event_stats(birth) death_handle = person.get_death_handle() death = self.db.get_event_from_handle(death_handle) if death_handle and not (self.private and death.get_privacy()): if not death.get_date_object().is_empty() or death.get_place_handle(): - self.writeln("1 DEAT") + if birth.get_description() != "": + self.writeln("1 DEAT %s" % death.get_description()) + else: + self.writeln("1 DEAT") self.dump_event_stats(death) ad = 0