Fixed error in setting None values

svn: r9381
This commit is contained in:
Doug Blank 2007-11-21 15:11:14 +00:00
parent 5975600e6a
commit d692868ce0
2 changed files with 17 additions and 5 deletions

View File

@ -542,9 +542,18 @@ class Date:
Sets the year, month, and day values by offset Sets the year, month, and day values by offset
""" """
dv = list(self.dateval) dv = list(self.dateval)
dv[Date._POS_YR] += year if dv[Date._POS_YR]:
dv[Date._POS_MON] += month dv[Date._POS_YR] += year
dv[Date._POS_DAY] += day 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.dateval = tuple(dv)
self._calc_sort_value() self._calc_sort_value()

View File

@ -69,8 +69,11 @@ class LivingProxyDb(ProxyDbBase):
""" """
ProxyDbBase.__init__(self, db) ProxyDbBase.__init__(self, db)
self.mode = mode self.mode = mode
self.current_date = Date() if current_year != None:
self.current_date.set_year(current_year) self.current_date = Date()
self.current_date.set_year(current_year)
else:
self.current_date = None
self.years_after_death = years_after_death self.years_after_death = years_after_death
def get_person_from_handle(self, handle): def get_person_from_handle(self, handle):