* various: remove set_date/get_date removal to be replaced by

DateHandler calls


svn: r5031
This commit is contained in:
Don Allingham
2005-08-06 02:57:37 +00:00
parent 42534975c3
commit d3a5f623a6
26 changed files with 191 additions and 111 deletions

View File

@@ -51,6 +51,7 @@ import Utils
import BaseDoc
import OpenSpreadSheet
import const
import DateHandler
from QuestionDialog import WarningDialog
#------------------------------------------------------------------------
@@ -323,7 +324,7 @@ class DisplayChart:
bplace = ""
if birth_handle:
birth = self.db.get_event_from_handle(birth_handle)
bdate = birth.get_date()
bdate = DateHandler.get_date(birth)
bplace_handle = birth.get_place_handle()
if bplace_handle:
bplace = self.db.get_place_from_handle(bplace_handle).get_title()
@@ -332,7 +333,7 @@ class DisplayChart:
dplace = ""
if death_handle:
death = self.db.get_event_from_handle(death_handle)
ddate = death.get_date()
ddate = DateHandler.get_date(death)
dplace_handle = death.get_place_handle()
if dplace_handle:
dplace = self.db.get_place_from_handle(dplace_handle).get_title()
@@ -365,7 +366,7 @@ class DisplayChart:
place = ""
if event_handle:
event = self.db.get_event_from_handle(event_handle)
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.db.get_place_from_handle(place_handle).get_title()

View File

@@ -46,7 +46,7 @@ import Report
import BaseDoc
import ReportOptions
import const
from DateHandler import displayer as _dd
import DateHandler
#------------------------------------------------------------------------
#
@@ -179,7 +179,7 @@ class FamilyGroup(Report.Report):
bplace = ""
if birth_handle:
birth = self.database.get_event_from_handle(birth_handle)
bdate = birth.get_date()
bdate = DateHandler.get_date(birth)
bplace_handle = birth.get_place_handle()
if bplace_handle:
bplace = self.database.get_place_from_handle(bplace_handle).get_title()
@@ -189,7 +189,7 @@ class FamilyGroup(Report.Report):
dplace = ""
if death_handle:
death = self.database.get_event_from_handle(death_handle)
ddate = death.get_date()
ddate = DateHandler.get_date(death)
dplace_handle = death.get_place_handle()
if dplace_handle:
dplace = self.database.get_place_from_handle(dplace_handle).get_title()
@@ -274,7 +274,7 @@ class FamilyGroup(Report.Report):
date = ""
place = ""
if event:
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title()

View File

@@ -38,7 +38,7 @@ import Report
import BaseDoc
import RelLib
import ReportOptions
from DateHandler import displayer as dd
import DateHandler
import const
import ReportUtils
@@ -152,8 +152,9 @@ class FtmAncestorReport(Report.Report):
self.doc.start_paragraph('FTA-Endnotes',"%d." % key)
self.doc.write_text(base.get_title())
for item in [ base.get_author(), base.get_publication_info(), base.get_abbreviation(),
dd.display(srcref.get_date_object()),]:
for item in [ base.get_author(), base.get_publication_info(),
base.get_abbreviation(),
DateHandler.get_date(srcref),]:
if item:
self.doc.write_text('; %s' % item)
@@ -233,7 +234,7 @@ class FtmAncestorReport(Report.Report):
for event_handle in person.get_event_list():
event = self.database.get_event_from_handle(event_handle)
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title()
@@ -294,7 +295,7 @@ class FtmAncestorReport(Report.Report):
else:
return
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title()

View File

@@ -42,7 +42,7 @@ import BaseDoc
import RelLib
import ReportUtils
import ReportOptions
from DateHandler import displayer as dd
import DateHandler
import const
#------------------------------------------------------------------------
@@ -182,8 +182,9 @@ class FtmDescendantReport(Report.Report):
self.doc.start_paragraph('FTD-Endnotes',"%d." % key)
self.doc.write_text(base.get_title())
for item in [ base.get_author(), base.get_publication_info(), base.get_abbreviation(),
dd.display(srcref.get_date_object()),]:
for item in [ base.get_author(), base.get_publication_info(),
base.get_abbreviation(),
DateHandler.get_date(srcref),]:
if item:
self.doc.write_text('; %s' % item)
@@ -267,7 +268,7 @@ class FtmDescendantReport(Report.Report):
if not event_handle:
continue
event = self.database.get_event_from_handle(event_handle)
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle)
@@ -323,7 +324,7 @@ class FtmDescendantReport(Report.Report):
if not event_handle:
continue
event = self.database.get_event_from_handle(event_handle)
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle)

View File

@@ -49,6 +49,7 @@ import ReportOptions
import GenericFilter
import const
import RelLib
import DateHandler
from BaseDoc import PAPER_LANDSCAPE
from latin_utf8 import utf8_to_latin
from QuestionDialog import ErrorDialog
@@ -370,7 +371,7 @@ class GraphViz:
if self.just_years:
return '%i' % event.get_date_object().get_year()
else:
return event.get_date()
return DateHandler.get_date(event)
elif self.placecause:
place_handle = event.get_place_handle()
place = self.database.get_place_from_handle(place_handle)

View File

@@ -46,6 +46,7 @@ import BaseDoc
import Report
import GenericFilter
import ReportOptions
import DateHandler
#------------------------------------------------------------------------
#
@@ -113,7 +114,7 @@ class IndivCompleteReport(Report.Report):
if event == None:
return
name = _(event.get_name())
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title()

View File

@@ -47,6 +47,7 @@ import const
import BaseDoc
import Report
import ReportOptions
import DateHandler
import const
#------------------------------------------------------------------------
@@ -94,7 +95,7 @@ class IndivSummary(Report.Report):
if event == None:
return
name = const.display_event(event.get_name())
date = event.get_date()
date = DateHandler.get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place_obj = self.database.get_place_from_handle(place_handle)

View File

@@ -47,6 +47,7 @@ import Utils
import NameDisplay
import ListModel
import PluginMgr
import DateHandler
#-------------------------------------------------------------------------
#
@@ -103,7 +104,7 @@ class RelCalc:
continue
bh = p.get_birth_handle()
if bh:
bdate = self.db.get_event_from_handle(bh).get_date()
bdate = DateHandler.get_date(self.db.get_event_from_handle(bh))
else:
bdate = ""
name = p.get_primary_name()

View File

@@ -47,6 +47,7 @@ from gnome import help_display
#-------------------------------------------------------------------------
import const
import TreeTips
import DateHandler
from DdTargets import DdTargets
@@ -136,7 +137,7 @@ class ScratchPadAddress(ScratchPadGrampsTypeWrapper):
def __init__(self,model,obj):
ScratchPadGrampsTypeWrapper.__init__(self,model,obj)
self._type = _("Address")
self._title = self._obj.get_date()
self._title = DateHandler.get_date(self._obj)
self._value = "%s %s %s %s" % (self._obj.get_street(),self._obj.get_city(),
self._obj.get_state(),self._obj.get_country())
@@ -153,7 +154,7 @@ class ScratchPadAddress(ScratchPadGrampsTypeWrapper):
"\t\t%s\n"\
"\t<b>%s:</b>\t%s\n" % (
_("Address"),
_("Date"), escape(self._obj.get_date()),
_("Date"), escape(DateHandler.get_date(self._obj)),
_("Location"),
escape(self._obj.get_street()),
escape(self._obj.get_city()),
@@ -197,7 +198,7 @@ class ScratchPadEvent(ScratchPadGrampsTypeWrapper):
"\t<b>%s:</b>\t%s\n" % (
_("Event"),
_("Type"),escape(const.display_pevent(self._obj.get_name())),
_("Date"),escape(self._obj.get_date()),
_("Date"),escape(DateHander.get_date(self._obj)),
_("Place"),escape(place_title(self._db,self._obj)),
_("Cause"),escape(self._obj.get_cause()),
_("Description"), escape(self._obj.get_description()))
@@ -239,7 +240,7 @@ class ScratchPadFamilyEvent(ScratchPadGrampsTypeWrapper):
"\t<b>%s:</b>\t%s\n" % (
_("Family Event"),
_("Type"),escape(const.display_fevent(self._obj.get_name())),
_("Date"),escape(self._obj.get_date()),
_("Date"),escape(DateHander.get_date(self._obj)),
_("Place"),escape(place_title(self.db,self._obj)),
_("Cause"),escape(self._obj.get_cause()),
_("Description"), escape(self._obj.get_description()))
@@ -465,8 +466,9 @@ class ScratchPersonLink(ScratchPadWrapper):
birth_handle = person.get_birth_handle()
if birth_handle:
birth = self._db.get_event_from_handle(birth_handle)
if birth.get_date() and birth.get_date() != "":
self._value = escape(birth.get_date())
date_str = DateHandler.get_date(birth)
if date_str != "":
self._value = escape(date_str)
def tooltip(self):

View File

@@ -58,7 +58,7 @@ import Report
import ReportUtils
import ReportOptions
import GenericFilter
from DateHandler import displayer as _dd
import DateHandler
#------------------------------------------------------------------------
#
@@ -190,7 +190,7 @@ class Extract:
if date:
month = date.get_month()
if month:
return [_dd._months[month]]
return [DateHandler.displayer._months[month]]
return [_("Date(s) missing")]
def get_cause(self, event):

View File

@@ -47,6 +47,7 @@ import Utils
import RelLib
import const
import Report
import DateHandler
#------------------------------------------------------------------------
#
@@ -95,7 +96,7 @@ def build_report(database,person):
birth_handle = person.get_birth_handle()
if birth_handle:
birth = database.get_event_from_handle(birth_handle)
if not birth.get_date():
if not DateHandler.get_date(birth):
missing_bday = missing_bday + 1
else:
missing_bday = missing_bday + 1