* 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
This commit is contained in:
Alex Roitman 2003-08-01 01:58:51 +00:00
parent 0f923ca48f
commit 0933db5820
2 changed files with 23 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2003-07-31 Alex Roitman <shura@alex.neuro.umn.edu>
* 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 <dallingham@users.sourceforge.net> 2003-07-31 Don Allingham <dallingham@users.sourceforge.net>
* src/Plugins.py: fixed call in _textdoc.append (typo) * src/Plugins.py: fixed call in _textdoc.append (typo)
* src/plugins/Makefile.am: Add WriteFtree.py * src/plugins/Makefile.am: Add WriteFtree.py

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # 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""" """Gets the temple assocated with the LDS ordinance"""
return self.temple return self.temple
def are_equal(self,other): def isEmpty(self):
"""returns 1 if the spdcified ordinance is the same as the instance""" """Returns 1 if the LDS ordidance is actually empty"""
if other == None: if (self.famc or
(self.date and not self.date.isEmpty()) or
self.temple or
self.status or
self.place):
return 0 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 if (self.famc != other.famc or
self.place != other.place or self.place != other.place or
self.temple != other.temple or self.temple != other.temple or