From d692868ce0dcba0472c9d7ea7dcf694795bbe2ab Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 21 Nov 2007 15:11:14 +0000 Subject: [PATCH] Fixed error in setting None values svn: r9381 --- src/gen/lib/date.py | 15 ++++++++++++--- src/gen/proxy/living.py | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index bc0ca564c..7f2db6fa3 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -542,9 +542,18 @@ class Date: Sets the year, month, and day values by offset """ dv = list(self.dateval) - dv[Date._POS_YR] += year - dv[Date._POS_MON] += month - dv[Date._POS_DAY] += day + if dv[Date._POS_YR]: + dv[Date._POS_YR] += year + elif year: + dv[Date._POS_YR] = year + if dv[Date._POS_MON]: + dv[Date._POS_MON] += month + elif month: + dv[Date._POS_MON] = month + if dv[Date._POS_DAY]: + dv[Date._POS_DAY] += day + elif day: + dv[Date._POS_DAY] = day self.dateval = tuple(dv) self._calc_sort_value() diff --git a/src/gen/proxy/living.py b/src/gen/proxy/living.py index 94add64a6..41eaad3b1 100644 --- a/src/gen/proxy/living.py +++ b/src/gen/proxy/living.py @@ -69,8 +69,11 @@ class LivingProxyDb(ProxyDbBase): """ ProxyDbBase.__init__(self, db) self.mode = mode - self.current_date = Date() - self.current_date.set_year(current_year) + if current_year != None: + self.current_date = Date() + self.current_date.set_year(current_year) + else: + self.current_date = None self.years_after_death = years_after_death def get_person_from_handle(self, handle):