From 0933db5820e7f0f6034b30957314ab51372e3059 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 1 Aug 2003 01:58:51 +0000 Subject: [PATCH] * src/RelLib.py (LdsOrd.are_equal): Correctly handle the case when the new object is None and the old is empty. (LdsOrd.isEmpty): Add function. svn: r1945 --- gramps2/ChangeLog | 5 +++++ gramps2/src/RelLib.py | 22 ++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b1264a320..dd890ab56 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2003-07-31 Alex Roitman + * src/RelLib.py (LdsOrd.are_equal): Correctly handle the case when + the new object is None and the old is empty. + (LdsOrd.isEmpty): Add function. + 2003-07-31 Don Allingham * src/Plugins.py: fixed call in _textdoc.append (typo) * src/plugins/Makefile.am: Add WriteFtree.py diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index 6d0b2cfa3..395cc4258 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000 Donald N. Allingham +# Copyright (C) 2000-2003 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -218,10 +218,24 @@ class LdsOrd(SourceNote): """Gets the temple assocated with the LDS ordinance""" return self.temple - def are_equal(self,other): - """returns 1 if the spdcified ordinance is the same as the instance""" - if other == None: + def isEmpty(self): + """Returns 1 if the LDS ordidance is actually empty""" + if (self.famc or + (self.date and not self.date.isEmpty()) or + self.temple or + self.status or + self.place): return 0 + else: + return 1 + + def are_equal(self,other): + """returns 1 if the specified ordinance is the same as the instance""" + if other == None: + if self.isEmpty(): + return 1 + else: + return 0 if (self.famc != other.famc or self.place != other.place or self.temple != other.temple or