Changes to imports - part 2

svn: r20486
This commit is contained in:
Nick Hall 2012-10-02 19:34:37 +00:00
parent 2f87a2d38a
commit 6b5318fa18
59 changed files with 193 additions and 193 deletions

View File

@ -49,7 +49,7 @@ from gi.repository import GdkPixbuf
from gen.const import IMAGE_DIR, URL_MANUAL_PAGE
from gen.config import config
import gen.lib
import gen.datehandler
from gramps.gen.datehandler import get_date
from gui.display import display_help
from gui.managedwindow import ManagedWindow
from gen.ggettext import sgettext as _
@ -297,7 +297,7 @@ class ClipAddress(ClipObjWrapper):
def refresh(self):
if self._obj:
self._title = gen.datehandler.get_date(self._obj)
self._title = get_date(self._obj)
self._value = "%s %s %s %s" % (self._obj.get_street(),
self._obj.get_city(),
self._obj.get_state(),

View File

@ -49,7 +49,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gen.config import config
from gen.const import HOME_DIR
import gen.datehandler
from gramps.gen.datehandler import get_date_formats
from gen.display.name import displayer as _nd
from gen.display.name import NameDisplayError
from gen.utils.file import get_unicode_path_from_file_chooser
@ -946,7 +946,7 @@ class GrampsPreferences(ConfigureDialog):
# Date format:
obox = Gtk.ComboBoxText()
formats = gen.datehandler.get_date_formats()
formats = get_date_formats()
map(obox.append_text, formats)
active = config.get('preferences.date-format')
if active >= len(formats):

View File

@ -36,7 +36,7 @@ from gi.repository import Gtk
# GRAMPS classes
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import get_date
#-------------------------------------------------------------------------
#
@ -56,7 +56,7 @@ class AddressModel(Gtk.ListStore):
self.db = dbase
for obj in obj_list:
self.append(row=[
gen.datehandler.get_date(obj),
get_date(obj),
obj.street,
obj.locality,
obj.city,

View File

@ -33,7 +33,7 @@ import cgi
# GRAMPS classes
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.display.name import displayer as name_displayer
from gen.utils.string import gender as gender_map
import gen.lib
@ -74,9 +74,9 @@ class ChildModel(Gtk.ListStore):
birth = get_birth_or_fallback(self.db, data)
if birth:
if birth.get_type() == gen.lib.EventType.BIRTH:
return gen.datehandler.get_date(birth)
return get_date(birth)
else:
return '<i>%s</i>' % cgi.escape(gen.datehandler.get_date(birth))
return '<i>%s</i>' % cgi.escape(get_date(birth))
else:
return u""
@ -97,9 +97,9 @@ class ChildModel(Gtk.ListStore):
death = get_death_or_fallback(self.db, data)
if death:
if death.get_type() == gen.lib.EventType.DEATH:
return gen.datehandler.get_date(death)
return get_date(death)
else:
return '<i>%s</i>' % cgi.escape(gen.datehandler.get_date(death))
return '<i>%s</i>' % cgi.escape(get_date(death))
else:
return u""

View File

@ -47,7 +47,7 @@ import cgi
#
#-------------------------------------------------------------------------
from gui.widgets.undoablebuffer import UndoableBuffer
import gen.datehandler
from gramps.gen.datehandler import get_date, get_date_valid
from gen.config import config
#-------------------------------------------------------------------------
@ -134,8 +134,8 @@ class EventRefModel(Gtk.TreeStore):
def column_date(self, event_ref):
event = self.db.get_event_from_handle(event_ref.ref)
retval = gen.datehandler.get_date(event)
if not gen.datehandler.get_date_valid(event):
retval = get_date(event)
if not get_date_valid(event):
return invalid_date_format % cgi.escape(retval)
else:
return retval

View File

@ -38,7 +38,7 @@ from gi.repository import Gtk
# GRAMPS classes
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.lds import TEMPLES
#-------------------------------------------------------------------------
@ -57,7 +57,7 @@ class LdsModel(Gtk.ListStore):
for lds_ord in lds_list:
self.append(row=[
lds_ord.type2str(),
gen.datehandler.get_date(lds_ord),
get_date(lds_ord),
lds_ord.status2str(),
TEMPLES.name(lds_ord.get_temple()),
self.column_place(lds_ord),

View File

@ -63,7 +63,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gen.ggettext import sgettext as _
from gen.lib.date import Date
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.const import URL_MANUAL_PAGE
from gui.display import display_help
from gui.managedwindow import ManagedWindow
@ -89,13 +89,13 @@ QUAL_TEXT = (
(Date.QUAL_CALCULATED, _('Calculated')) )
CAL_TO_MONTHS_NAMES = {
Date.CAL_GREGORIAN : gen.datehandler.displayer.short_months,
Date.CAL_JULIAN : gen.datehandler.displayer.short_months,
Date.CAL_HEBREW : gen.datehandler.displayer.hebrew,
Date.CAL_FRENCH : gen.datehandler.displayer.french,
Date.CAL_PERSIAN : gen.datehandler.displayer.persian,
Date.CAL_ISLAMIC : gen.datehandler.displayer.islamic,
Date.CAL_SWEDISH : gen.datehandler.displayer.swedish }
Date.CAL_GREGORIAN : displayer.short_months,
Date.CAL_JULIAN : displayer.short_months,
Date.CAL_HEBREW : displayer.hebrew,
Date.CAL_FRENCH : displayer.french,
Date.CAL_PERSIAN : displayer.persian,
Date.CAL_ISLAMIC : displayer.islamic,
Date.CAL_SWEDISH : displayer.swedish }
WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_1' % URL_MANUAL_PAGE
WIKI_HELP_SEC = _('manual|Editing_Dates')

View File

@ -65,7 +65,7 @@ from gen.display.name import displayer as name_displayer
import gen.lib
from gen.db import DbTxn
from gen.errors import WindowActiveError
import gen.datehandler
from gramps.gen.datehandler import displayer
from gui.glade import Glade
from editprimary import EditPrimary
@ -909,12 +909,12 @@ class EditFamily(EditPrimary):
if name_obj:
name_obj.set_text(name)
if birth:
birth_str = gen.datehandler.displayer.display(birth.get_date_object())
birth_str = displayer.display(birth.get_date_object())
else:
birth_str = ""
birth_obj.set_text(birth_str)
if death:
death_str = gen.datehandler.displayer.display(death.get_date_object())
death_str = displayer.display(death.get_date_object())
else:
death_str = ""
death_obj.set_text(death_str)

View File

@ -41,7 +41,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gui.managedwindow import ManagedWindow
import gen.datehandler
from gramps.gen.datehandler import displayer, parser
from gen.display.name import displayer as name_displayer
from gen.config import config
from gramps.gui.utils import is_right_click
@ -62,8 +62,8 @@ class EditPrimary(ManagedWindow, DbGUIElement):
Associate a person with the window.
"""
self.dp = gen.datehandler.parser
self.dd = gen.datehandler.displayer
self.dp = parser
self.dd = displayer
self.name_displayer = name_displayer
self.obj = obj
self.dbstate = state

View File

@ -43,7 +43,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gui import widgets
import gen.lib
import gen.datehandler
from gramps.gen.datehandler import displayer
from gui.filters import build_filter_model
from gui.filters.sidebar import SidebarFilter
from gen.filters import GenericFilter, rules
@ -122,8 +122,8 @@ class PersonSidebarFilter(SidebarFilter):
exdate2.set(gen.lib.Date.QUAL_NONE, gen.lib.Date.MOD_BEFORE,
gen.lib.Date.CAL_GREGORIAN, (0, 0, 1850, False))
msg1 = gen.datehandler.displayer.display(exdate1)
msg2 = gen.datehandler.displayer.display(exdate2)
msg1 = displayer.display(exdate1)
msg2 = displayer.display(exdate2)
self.add_text_entry(_('Name'), self.filter_name)
self.add_text_entry(_('ID'), self.filter_id)

View File

@ -34,7 +34,7 @@ from gen.ggettext import sgettext as _
from gen.const import URL_MANUAL_PAGE
from gui.display import display_help
from gui.managedwindow import ManagedWindow
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.string import confidence
from gen.merge import MergeCitationQuery
@ -82,8 +82,8 @@ class MergeCitation(ManagedWindow):
entry1 = self.get_widget("date1")
entry2 = self.get_widget("date2")
entry1.set_text(gen.datehandler.get_date(self.citation1))
entry2.set_text(gen.datehandler.get_date(self.citation2))
entry1.set_text(get_date(self.citation1))
entry2.set_text(get_date(self.citation2))
if entry1.get_text() == entry2.get_text():
for widget_name in ('date1', 'date2', 'date_btn1',
'date_btn2'):

View File

@ -33,7 +33,7 @@ from gen.ggettext import sgettext as _
from gen.const import URL_MANUAL_PAGE
from gui.display import display_help
from gui.managedwindow import ManagedWindow
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.db import get_participant_from_event
from gen.merge import MergeEventQuery
@ -81,8 +81,8 @@ class MergeEvent(ManagedWindow):
entry1 = self.get_widget("date1")
entry2 = self.get_widget("date2")
entry1.set_text(gen.datehandler.get_date(self.ev1))
entry2.set_text(gen.datehandler.get_date(self.ev2))
entry1.set_text(get_date(self.ev1))
entry2.set_text(get_date(self.ev2))
if entry1.get_text() == entry2.get_text():
for widget_name in ('date1', 'date2', 'date_btn1', 'date_btn2'):
self.get_widget(widget_name).set_sensitive(False)

View File

@ -33,7 +33,7 @@ from gen.ggettext import sgettext as _
from gen.const import URL_MANUAL_PAGE
from gui.display import display_help
from gui.managedwindow import ManagedWindow
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.merge import MergeMediaQuery
#-------------------------------------------------------------------------
@ -90,8 +90,8 @@ class MergeMedia(ManagedWindow):
entry1 = self.get_widget("date1")
entry2 = self.get_widget("date2")
entry1.set_text(gen.datehandler.get_date(self.mo1))
entry2.set_text(gen.datehandler.get_date(self.mo2))
entry1.set_text(get_date(self.mo1))
entry2.set_text(get_date(self.mo2))
if entry1.get_text() == entry2.get_text():
for widget_name in ('date1', 'date2', 'date_btn1', 'date_btn2'):
self.get_widget(widget_name).set_sensitive(False)

View File

@ -43,7 +43,7 @@ from gen.plug.report import utils as ReportUtils
from gen.display.name import displayer as name_displayer
from gen.const import URL_MANUAL_PAGE
from gui.display import display_help
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.errors import MergeError
from gui.dialog import ErrorDialog
from gui.managedwindow import ManagedWindow
@ -282,7 +282,7 @@ class MergePerson(ManagedWindow):
place = ""
if handle:
event = self.database.get_event_from_handle(handle)
date = gen.datehandler.get_date(event)
date = get_date(event)
place = self.place_name(event)
if date:
return ("%s, %s" % (date, place)) if place else date

View File

@ -39,7 +39,7 @@ LOG = logging.getLogger(".citation")
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import format_time, get_date, get_date_valid
import gen.lib
from gen.utils.string import confidence
from gen.config import config
@ -83,10 +83,10 @@ class CitationBaseModel(object):
if data[COLUMN_DATE]:
citation = gen.lib.Citation()
citation.unserialize(data)
date_str = gen.datehandler.get_date(citation)
date_str = get_date(citation)
if date_str != "":
retval = cgi.escape(date_str)
if not gen.datehandler.get_date_valid(citation):
if not get_date_valid(citation):
return INVALID_DATE_FORMAT % retval
else:
return retval
@ -97,7 +97,7 @@ class CitationBaseModel(object):
citation = gen.lib.Citation()
citation.unserialize(data)
retval = "%09d" % citation.get_date_object().get_sort_value()
if not gen.datehandler.get_date_valid(citation):
if not get_date_valid(citation):
return INVALID_DATE_FORMAT % retval
else:
return retval
@ -116,7 +116,7 @@ class CitationBaseModel(object):
return unicode(data[COLUMN_HANDLE])
def citation_change(self, data):
return gen.datehandler.format_time(data[COLUMN_CHANGE])
return format_time(data[COLUMN_CHANGE])
def citation_sort_change(self, data):
return "%012x" % data[COLUMN_CHANGE]
@ -168,7 +168,7 @@ class CitationBaseModel(object):
source_handle = data[COLUMN_SOURCE]
try:
source = self.db.get_source_from_handle(source_handle)
return gen.datehandler.format_time(source.change)
return format_time(source.change)
except:
return u''
@ -196,7 +196,7 @@ class CitationBaseModel(object):
return unicode(data[COLUMN2_PUBINFO])
def source_src_chan(self, data):
return gen.datehandler.format_time(data[COLUMN2_CHANGE])
return format_time(data[COLUMN2_CHANGE])
def source_sort2_change(self, data):
return "%012x" % data[COLUMN2_CHANGE]

View File

@ -40,7 +40,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import format_time, get_date, get_date_valid
import gen.lib
from gen.utils.db import get_participant_from_event
from gen.config import config
@ -134,10 +134,10 @@ class EventModel(FlatBaseModel):
if data[COLUMN_DATE]:
event = gen.lib.Event()
event.unserialize(data)
date_str = gen.datehandler.get_date(event)
date_str = get_date(event)
if date_str != "":
retval = cgi.escape(date_str)
if not gen.datehandler.get_date_valid(event):
if not get_date_valid(event):
return INVALID_DATE_FORMAT % retval
else:
return retval
@ -148,7 +148,7 @@ class EventModel(FlatBaseModel):
event = gen.lib.Event()
event.unserialize(data)
retval = "%09d" % event.get_date_object().get_sort_value()
if not gen.datehandler.get_date_valid(event):
if not get_date_valid(event):
return INVALID_DATE_FORMAT % retval
else:
return retval
@ -162,7 +162,7 @@ class EventModel(FlatBaseModel):
return "%012x" % data[COLUMN_CHANGE]
def column_change(self,data):
return gen.datehandler.format_time(data[COLUMN_CHANGE])
return format_time(data[COLUMN_CHANGE])
def column_tooltip(self,data):
return u'Event tooltip'

View File

@ -41,7 +41,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import displayer, format_time, get_date_valid
from gen.display.name import displayer as name_displayer
from gen.lib import EventRoleType, FamilyRelType
from gui.views.treemodels.flatbasemodel import FlatBaseModel
@ -147,11 +147,11 @@ class FamilyModel(FlatBaseModel):
event = get_marriage_or_fallback(self.db, family, "<i>%s</i>")
if event:
if event.date.format:
return event.date.format % gen.datehandler.displayer.display(event.date)
elif not gen.datehandler.get_date_valid(event):
return invalid_date_format % gen.datehandler.displayer.display(event.date)
return event.date.format % displayer.display(event.date)
elif not get_date_valid(event):
return invalid_date_format % displayer.display(event.date)
else:
return "%s" % gen.datehandler.displayer.display(event.date)
return "%s" % displayer.display(event.date)
else:
return u''
@ -170,7 +170,7 @@ class FamilyModel(FlatBaseModel):
return "%012x" % data[12]
def column_change(self, data):
return gen.datehandler.format_time(data[12])
return format_time(data[12])
def column_tooltip(self, data):
return u'Family tooltip'

View File

@ -42,7 +42,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import displayer, format_time
import gen.lib
from gui.views.treemodels.flatbasemodel import FlatBaseModel
@ -131,7 +131,7 @@ class MediaModel(FlatBaseModel):
if data[9]:
date = gen.lib.Date()
date.unserialize(data[9])
return unicode(gen.datehandler.displayer.display(date))
return unicode(displayer.display(date))
return u''
def sort_date(self,data):
@ -150,7 +150,7 @@ class MediaModel(FlatBaseModel):
return "%012x" % data[8]
def column_change(self,data):
return gen.datehandler.format_time(data[8])
return format_time(data[8])
def column_tooltip(self,data):
return u'Media tooltip'

View File

@ -41,7 +41,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import format_time
from gui.views.treemodels.flatbasemodel import FlatBaseModel
from gen.lib import (Note, NoteType, StyledText)
@ -129,7 +129,7 @@ class NoteModel(FlatBaseModel):
return "%012x" % data[Note.POS_CHANGE]
def column_change(self,data):
return gen.datehandler.format_time(data[Note.POS_CHANGE])
return format_time(data[Note.POS_CHANGE])
def get_tag_name(self, tag_handle):
"""

View File

@ -58,7 +58,7 @@ _LOG = logging.getLogger(".")
#-------------------------------------------------------------------------
from gen.lib import Name, EventRef, EventType, EventRoleType
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import format_time, get_date, get_date_valid
from lru import LRU
from gui.views.treemodels.flatbasemodel import FlatBaseModel
from gui.views.treemodels.treebasemodel import TreeBaseModel
@ -243,7 +243,7 @@ class PeopleBaseModel(object):
return "%012x" % data[COLUMN_CHANGE]
def column_change(self, data):
return gen.datehandler.format_time(data[COLUMN_CHANGE])
return format_time(data[COLUMN_CHANGE])
def column_gender(self, data):
return PeopleBaseModel._GENDER[data[COLUMN_GENDER]]
@ -273,10 +273,10 @@ class PeopleBaseModel(object):
if sort_mode:
retval = "%09d" % birth.get_date_object().get_sort_value()
else:
date_str = gen.datehandler.get_date(birth)
date_str = get_date(birth)
if date_str != "":
retval = cgi.escape(date_str)
if not gen.datehandler.get_date_valid(birth):
if not get_date_valid(birth):
return invalid_date_format % retval
else:
return retval
@ -288,7 +288,7 @@ class PeopleBaseModel(object):
er.unserialize(event_ref)
event = self.db.get_event_from_handle(er.ref)
etype = event.get_type()
date_str = gen.datehandler.get_date(event)
date_str = get_date(event)
if (etype in [EventType.BAPTISM, EventType.CHRISTEN]
and er.get_role() == EventRoleType.PRIMARY
and date_str != ""):
@ -296,7 +296,7 @@ class PeopleBaseModel(object):
retval = "%09d" % event.get_date_object().get_sort_value()
else:
retval = "<i>%s</i>" % cgi.escape(date_str)
if not gen.datehandler.get_date_valid(event):
if not get_date_valid(event):
return invalid_date_format % retval
else:
return retval
@ -328,10 +328,10 @@ class PeopleBaseModel(object):
if sort_mode:
retval = "%09d" % event.get_date_object().get_sort_value()
else:
date_str = gen.datehandler.get_date(event)
date_str = get_date(event)
if date_str != "":
retval = cgi.escape(date_str)
if not gen.datehandler.get_date_valid(event):
if not get_date_valid(event):
return invalid_date_format % retval
else:
return retval
@ -343,7 +343,7 @@ class PeopleBaseModel(object):
er.unserialize(event_ref)
event = self.db.get_event_from_handle(er.ref)
etype = event.get_type()
date_str = gen.datehandler.get_date(event)
date_str = get_date(event)
if (etype in [EventType.BURIAL,
EventType.CREMATION,
EventType.CAUSE_DEATH]
@ -353,7 +353,7 @@ class PeopleBaseModel(object):
retval = "%09d" % event.get_date_object().get_sort_value()
else:
retval = "<i>%s</i>" % cgi.escape(date_str)
if not gen.datehandler.get_date_valid(event):
if not get_date_valid(event):
return invalid_date_format % retval
else:
return retval

View File

@ -46,7 +46,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import format_time
from gen.utils.place import conv_lat_lon
from gui.views.treemodels.flatbasemodel import FlatBaseModel
from gui.views.treemodels.treebasemodel import TreeBaseModel
@ -222,7 +222,7 @@ class PlaceBaseModel(object):
return "%012x" % data[11]
def column_change(self, data):
return gen.datehandler.format_time(data[11])
return format_time(data[11])
def column_tooltip(self, data):
return u'Place tooltip'

View File

@ -40,7 +40,7 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
import gen.lib
import gen.datehandler
from gramps.gen.datehandler import format_time
from gui.views.treemodels.flatbasemodel import FlatBaseModel
#-------------------------------------------------------------------------
@ -231,4 +231,4 @@ class RepositoryModel(FlatBaseModel):
return "%012x" % data[7]
def column_change(self,data):
return gen.datehandler.format_time(data[7])
return format_time(data[7])

View File

@ -39,7 +39,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import gen.datehandler
from gramps.gen.datehandler import format_time
from gui.views.treemodels.flatbasemodel import FlatBaseModel
#-------------------------------------------------------------------------
@ -107,7 +107,7 @@ class SourceModel(FlatBaseModel):
return unicode(data[4])
def column_change(self,data):
return gen.datehandler.format_time(data[8])
return format_time(data[8])
def sort_change(self,data):
return "%012x" % data[8]

View File

@ -53,7 +53,7 @@ from gi.repository import Pango
#-------------------------------------------------------------------------
from gen.ggettext import gettext as _
from gui.autocomp import StandardCustomSelector, fill_entry
import gen.datehandler
from gramps.gen.datehandler import displayer, parser
from gen.lib.date import Date, NextYear
from gen.errors import ValidationError
@ -621,7 +621,7 @@ class MonitoredDate(object):
self.text_obj.connect('content-changed', self.set_date)
self.button_obj.connect('clicked', self.invoke_date_editor)
self.text_obj.set_text(gen.datehandler.displayer.display(self.date_obj))
self.text_obj.set_text(displayer.display(self.date_obj))
self.text_obj.validate()
self.text_obj.set_editable(not readonly)
@ -631,7 +631,7 @@ class MonitoredDate(object):
"""
Parse date from text entry to date object
"""
date = gen.datehandler.parser.parse(unicode(self.text_obj.get_text()))
date = parser.parse(unicode(self.text_obj.get_text()))
self.date_obj.copy(date)
def validate(self, widget, data):
@ -663,7 +663,7 @@ class MonitoredDate(object):
if date_obj:
# first we set the text entry, that emits 'content-changed'
# signal thus the date object gets updated too
self.text_obj.set_text(gen.datehandler.displayer.display(date_obj))
self.text_obj.set_text(displayer.display(date_obj))
self.text_obj.validate()
#-------------------------------------------------------------------------

View File

@ -55,7 +55,7 @@ from gen.plug.menu import (BooleanOption, NumberOption, EnumeratedListOption,
from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gramps.gen.datehandler import displayer, parser
#------------------------------------------------------------------------
#
@ -192,7 +192,7 @@ def draw_legend(doc, start_x, start_y, data, title, label_style):
start_y += size * 1.3
_t = time.localtime(time.time())
_TODAY = gen.datehandler.parser.parse("%04d-%02d-%02d" % _t[:3])
_TODAY = parser.parse("%04d-%02d-%02d" % _t[:3])
def estimate_age(db, person, end_handle=None, start_handle=None, today=_TODAY):
"""
@ -410,7 +410,7 @@ class Extract(object):
if date:
month = date.get_month()
if month:
return [gen.datehandler.displayer.long_months[month]]
return [displayer.long_months[month]]
return [_("Date(s) missing")]
def get_place(self, event):

View File

@ -53,7 +53,7 @@ import gen.lib
from gen.lib.eventroletype import EventRoleType
from gui.plug.export import WriterOptionBox
from gen.utils.string import gender as gender_map
import gen.datehandler
from gramps.gen.datehandler import get_date
from gui.glade import Glade
#-------------------------------------------------------------------------
@ -519,4 +519,4 @@ class CSVWriter(object):
return True
def format_date(self, date):
return gen.datehandler.get_date(date)
return get_date(date)

View File

@ -36,7 +36,7 @@ on a particular date.
#------------------------------------------------------------------------
from gen.plug import Gramplet
from gen.ggettext import sgettext as _
import gen.datehandler
from gramps.gen.datehandler import parser
from gui.plug.quick import run_quick_report_by_name
#------------------------------------------------------------------------
@ -94,7 +94,7 @@ class AgeOnDateGramplet(Gramplet):
and then handed to the quick report.
"""
text = self.entry.get_text()
date = gen.datehandler.parser.parse(text)
date = parser.parse(text)
run_quick_report_by_name(self.gui.dbstate,
self.gui.uistate,
'ageondate',

View File

@ -25,7 +25,7 @@ from gen.plug import Gramplet
from gen.ggettext import gettext as _
from gen.display.name import displayer as name_displayer
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.errors import WindowActiveError
from gi.repository import Gtk
@ -48,7 +48,7 @@ class Children(Gramplet):
event_place = ''
event_sort = '%012d' % 0
if event:
event_date = gen.datehandler.get_date(event)
event_date = get_date(event)
event_sort = '%012d' % event.get_date_object().get_sort_value()
handle = event.get_place_handle()
if handle:

View File

@ -40,7 +40,7 @@ from gen.ggettext import gettext as _
from gen.plug import Gramplet
from gen.plug.report import utils as ReportUtils
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
class DescendantGramplet(Gramplet):
@ -79,10 +79,10 @@ class DescendantGramplet(Gramplet):
death = get_death_or_fallback(self.dbstate.db, person)
if birth:
birth_date = gen.datehandler.get_date(birth)
birth_date = get_date(birth)
if death:
death_date = gen.datehandler.get_date(death)
death_date = get_date(death)
if birth or death:
self.append_text(' (')

View File

@ -24,7 +24,7 @@ from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet
from gen.ggettext import gettext as _
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.db import get_birth_or_fallback, get_marriage_or_fallback
from gen.errors import WindowActiveError
from gi.repository import Gtk
@ -66,7 +66,7 @@ class Events(Gramplet):
Add an event to the model.
"""
event = self.dbstate.db.get_event_from_handle(event_ref.ref)
event_date = gen.datehandler.get_date(event)
event_date = get_date(event)
event_sort = '%012d' % event.get_date_object().get_sort_value()
person_age = self.column_age(event)
person_age_sort = self.column_sort_age(event)

View File

@ -36,7 +36,7 @@ from gen.plug import Gramplet
from gen.ggettext import sgettext as _
from gen.ggettext import ngettext
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import get_date
import gen
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
@ -196,25 +196,25 @@ class PedigreeGramplet(Gramplet):
def info_string(self, person):
birth = get_birth_or_fallback(self.dbstate.db, person)
if birth and birth.get_type() != gen.lib.EventType.BIRTH:
sdate = gen.datehandler.get_date(birth)
sdate = get_date(birth)
if sdate:
bdate = "<i>%s</i>" % cgi.escape(sdate)
else:
bdate = ""
elif birth:
bdate = cgi.escape(gen.datehandler.get_date(birth))
bdate = cgi.escape(get_date(birth))
else:
bdate = ""
death = get_death_or_fallback(self.dbstate.db, person)
if death and death.get_type() != gen.lib.EventType.DEATH:
sdate = gen.datehandler.get_date(death)
sdate = get_date(death)
if sdate:
ddate = "<i>%s</i>" % cgi.escape(sdate)
else:
ddate = ""
elif death:
ddate = cgi.escape(gen.datehandler.get_date(death))
ddate = cgi.escape(get_date(death))
else:
ddate = ""

View File

@ -24,7 +24,7 @@ from gen.plug import Gramplet
from gui.widgets import Photo
from gen.display.name import displayer as name_displayer
from gen.ggettext import gettext as _
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.file import media_path_full
from gi.repository import Gtk
from gi.repository import Pango
@ -204,7 +204,7 @@ class PersonDetails(Gramplet):
"""
Format the event for display.
"""
date = gen.datehandler.get_date(event)
date = get_date(event)
handle = event.get_place_handle()
if handle:
place = self.dbstate.db.get_place_from_handle(handle).get_title()

View File

@ -24,7 +24,7 @@ from gui.editors import EditEvent
from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet
from gen.ggettext import gettext as _
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.errors import WindowActiveError
from gi.repository import Gtk
@ -101,7 +101,7 @@ class PersonResidence(Gramplet):
"""
Add a residence event to the model.
"""
date = gen.datehandler.get_date(event)
date = get_date(event)
place = ''
handle = event.get_place_handle()
if handle:

View File

@ -33,7 +33,7 @@ import posixpath
from gen.plug import Gramplet
from gen.ggettext import sgettext as _
from gen.utils.file import media_path_full
import gen.datehandler
from gramps.gen.datehandler import get_date
import gen
#------------------------------------------------------------------------
@ -121,7 +121,7 @@ class StatsGramplet(Gramplet):
birth_ref = person.get_birth_ref()
if birth_ref:
birth = database.get_event_from_handle(birth_ref.ref)
if not gen.datehandler.get_date(birth):
if not get_date(birth):
missing_bday += 1
else:
missing_bday += 1

View File

@ -45,7 +45,7 @@ from gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
@ -175,13 +175,13 @@ class HourGlassReport(Report):
birth_evt = get_birth_or_fallback(self.__db, person)
if birth_evt:
birth = gen.datehandler.get_date(birth_evt)
birth = get_date(birth_evt)
else:
birth = ""
death_evt = get_death_or_fallback(self.__db, person)
if death_evt:
death = gen.datehandler.get_date(death_evt)
death = get_date(death_evt)
else:
death = ""
@ -198,7 +198,7 @@ class HourGlassReport(Report):
label = ""
marriage = ReportUtils.find_marriage(self.__db, family)
if marriage:
label = gen.datehandler.get_date(marriage)
label = get_date(marriage)
color = ""
fill = ""
style = "solid"

View File

@ -53,7 +53,7 @@ from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import get_date
import gen.lib
from gen.utils.file import media_path_full, find_file
from gui.thumbnails import get_thumbnail_path
@ -442,7 +442,7 @@ class RelGraphReport(Report):
if self.just_years:
return '%i' % event.get_date_object().get_year()
else:
return gen.datehandler.get_date(event)
return get_date(event)
elif self.use_place:
place_handle = event.get_place_handle()
place = self.database.get_place_from_handle(place_handle)

View File

@ -51,7 +51,7 @@ from gen.errors import GrampsImportError
from gen.utils.id import create_id
from gen.utils.db import family_name
from gen.utils.unknown import make_unknown, create_explanation_note
import gen.datehandler
from gramps.gen.datehandler import parser, set_date
from gen.display.name import displayer as name_displayer
from gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY, EVENT_KEY,
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, NOTE_KEY,
@ -464,7 +464,7 @@ class GrampsParser(UpdateCallback):
self.gid2nid = {}
self.childref_map = {}
self.change = change
self.dp = gen.datehandler.parser
self.dp = parser
self.info = ImportInfo()
self.all_abs = True
self.db = database
@ -2589,9 +2589,9 @@ class GrampsParser(UpdateCallback):
def stop_date(self, tag):
if tag:
if self.address:
gen.datehandler.set_date(self.address, tag)
set_date(self.address, tag)
else:
gen.datehandler.set_date(self.event, tag)
set_date(self.event, tag)
def stop_first(self, tag):
self.name.set_first_name(tag)

View File

@ -40,7 +40,7 @@ from gen.ggettext import gettext as _
from gen.utils.place import conv_lat_lon
from fractions import Fraction
import gen.lib
import gen.datehandler
from gramps.gen.datehandler import displayer
import datetime
import pyexiv2
@ -60,7 +60,7 @@ def format_datetime(exif_dt):
return _('Invalid format')
date_part = gen.lib.Date()
date_part.set_yr_mon_day(exif_dt.year, exif_dt.month, exif_dt.day)
date_str = gen.datehandler.displayer.display(date_part)
date_str = displayer.display(date_part)
time_str = _('%(hr)02d:%(min)02d:%(sec)02d') % {'hr': exif_dt.hour,
'min': exif_dt.minute,
'sec': exif_dt.second}

View File

@ -38,7 +38,7 @@ Mary Smith was born on 3/28/1923.
#
#------------------------------------------------------------------------
from gen.display.name import displayer as name_displayer
import gen.datehandler
from gramps.gen.datehandler import displayer
import gen.lib
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
@ -191,7 +191,7 @@ class DateFormat(GenericFormat):
return None
def _default_format(self, date):
return gen.datehandler.displayer.display(date)
return displayer.display(date)
def __count_chars(self, char, max_amount):
""" count the year/month/day codes """
@ -248,9 +248,9 @@ class DateFormat(GenericFormat):
tmp = "0" + month
return tmp[-2:]
elif count == 3: #found 'mmm'
return gen.datehandler.displayer.short_months[int(month)]
return displayer.short_months[int(month)]
else: #found 'mmmm'
return gen.datehandler.displayer.long_months[int(month)]
return displayer.long_months[int(month)]
def month_up():
return month("M").upper()

View File

@ -38,7 +38,7 @@ _ = gettext.gettext
#
#------------------------------------------------------------------------
from gen.utils.trans import get_localedomain
import gen.datehandler
from gramps.gen.datehandler import displayer, LANG_TO_DISPLAY
from gen.config import config
from gen.lib.grampstype import GrampsType
@ -139,7 +139,7 @@ class Translator:
"""
if lang == Translator.DEFAULT_TRANSLATION_STR:
self.__trans = None
self.__dd = gen.datehandler.displayer
self.__dd = displayer
else:
# fallback=True will cause the translator to use English if
# lang = "en" or if something goes wrong.
@ -147,10 +147,10 @@ class Translator:
languages=[lang],
fallback=True)
val = config.get('preferences.date-format')
if lang in gen.datehandler.LANG_TO_DISPLAY:
self.__dd = gen.datehandler.LANG_TO_DISPLAY[lang](val)
if lang in LANG_TO_DISPLAY:
self.__dd = LANG_TO_DISPLAY[lang](val)
else:
self.__dd = gen.datehandler.displayer
self.__dd = displayer
def gettext(self, message):
"""

View File

@ -31,7 +31,7 @@ from gen.simple import SimpleAccess, SimpleDoc
from gui.plug.quick import QuickTable
from gen.utils.alive import probably_alive
from gen.ggettext import gettext as _
import gen.datehandler
from gramps.gen.datehandler import displayer
import gen.lib
from gen.config import config
@ -49,10 +49,10 @@ def run(database, document, date):
# display the title
if date.get_day_valid():
sdoc.title(_("People probably alive and their ages the %s") %
gen.datehandler.displayer.display(date))
displayer.display(date))
else:
sdoc.title(_("People probably alive and their ages on %s") %
gen.datehandler.displayer.display(date))
displayer.display(date))
stab.columns(_("Person"), _("Age")) # Actual Date makes column unicode
matches = 0
for person in sdb.all_people():

View File

@ -32,7 +32,7 @@ from gui.plug.quick import QuickTable
from gen.utils.file import media_path_full
from gui.plug.quick import run_quick_report_by_name_direct
from gen.lib import Person
import gen.datehandler
from gramps.gen.datehandler import get_date
import posixpath
from collections import defaultdict
@ -304,7 +304,7 @@ def run(database, document, filter_name, *args, **kwargs):
birth_ref = person.get_birth_ref()
if birth_ref:
birth = database.get_event_from_handle(birth_ref.ref)
if not gen.datehandler.get_date(birth):
if not get_date(birth):
stab.row(person, _("birth event but no date"))
matches += 1
else:

View File

@ -51,7 +51,7 @@ from gen.errors import ReportError
from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.sort import Sort
from gen.utils.db import (get_birth_or_fallback, get_death_or_fallback,
get_marriage_or_fallback, get_divorce_or_fallback)
@ -157,7 +157,7 @@ class Printinfo():
def __date_place(self,event):
if event:
date = gen.datehandler.get_date(event)
date = get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(

View File

@ -45,7 +45,7 @@ from gen.plug.menu import (PersonOption, EnumeratedListOption)
from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gramps.gen.datehandler import get_date
#------------------------------------------------------------------------
#
@ -190,13 +190,13 @@ class EndOfLineReport(Report):
birth_ref = person.get_birth_ref()
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
birth_date = gen.datehandler.get_date( event )
birth_date = get_date( event )
death_date = ""
death_ref = person.get_death_ref()
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
death_date = gen.datehandler.get_date( event )
death_date = get_date( event )
dates = _(" (%(birth_date)s - %(death_date)s)") % {
'birth_date' : birth_date,
'death_date' : death_date }

View File

@ -45,7 +45,7 @@ from gen.plug.report import MenuReportOptions
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle,
TableCellStyle, FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.ggettext import sgettext as _
from gen.display.name import displayer as global_name_display
@ -111,7 +111,7 @@ class FamilyGroup(Report):
date = ""
descr = ""
if event:
date = gen.datehandler.get_date(event)
date = get_date(event)
place_handle = event.get_place_handle()
place = ReportUtils.place_name(self.database,place_handle)
descr = event.get_description()
@ -175,12 +175,12 @@ class FamilyGroup(Report):
birth = " "
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
birth = gen.datehandler.get_date( event )
birth = get_date( event )
death_ref = father.get_death_ref()
death = " "
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
death = gen.datehandler.get_date( event )
death = get_date( event )
if birth_ref or death_ref:
father_name = "%s (%s - %s)" % (father_name,birth,death)
mother_handle = family.get_mother_handle()
@ -192,12 +192,12 @@ class FamilyGroup(Report):
birth = " "
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
birth = gen.datehandler.get_date( event )
birth = get_date( event )
death_ref = mother.get_death_ref()
death = " "
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
death = gen.datehandler.get_date( event )
death = get_date( event )
if birth_ref or death_ref:
mother_name = "%s (%s - %s)" % (mother_name,birth,death)
@ -316,7 +316,7 @@ class FamilyGroup(Report):
addrlist = person.get_address_list()[:]
for addr in addrlist:
location = ReportUtils.get_address_str(addr)
date = gen.datehandler.get_date( addr )
date = get_date( addr )
self.doc.start_row()
self.doc.start_cell("FGR-TextContents")
@ -393,7 +393,7 @@ class FamilyGroup(Report):
date = ""
place = ""
if event:
date = gen.datehandler.get_date(event)
date = get_date(event)
place_handle = event.get_place_handle()
if place_handle:
place = self.database.get_place_from_handle(place_handle).get_title()
@ -529,12 +529,12 @@ class FamilyGroup(Report):
birth_ref = spouse.get_birth_ref()
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
birth = gen.datehandler.get_date(event)
birth = get_date(event)
death = " "
death_ref = spouse.get_death_ref()
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
death = gen.datehandler.get_date(event)
death = get_date(event)
if birth_ref or death_ref:
spouse_name = "%s (%s - %s)" % (spouse_name,birth,death)
mark = ReportUtils.get_person_mark(self.database,spouse)

View File

@ -44,7 +44,7 @@ from gen.lib import EventRoleType, EventType, Person, NoteType
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle,
TableCellStyle, FONT_SANS_SERIF, INDEX_TYPE_TOC,
PARA_ALIGN_CENTER)
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.plug.menu import (BooleanOption, FilterOption, PersonOption,
BooleanListOption, EnumeratedListOption)
from gen.plug.report import Report
@ -199,7 +199,7 @@ class IndivCompleteReport(Report):
role = event_ref.get_role()
description = event.get_description()
date = gen.datehandler.get_date(event)
date = get_date(event)
place = ''
place_handle = event.get_place_handle()
if place_handle:
@ -385,7 +385,7 @@ class IndivCompleteReport(Report):
for addr in alist:
text = ReportUtils.get_address_str(addr)
date = gen.datehandler.get_date(addr)
date = get_date(addr)
endnotes = ""
if self.use_srcs:
endnotes = Endnotes.cite_source(self.bibli, self.database, addr)

View File

@ -48,7 +48,7 @@ from gen.plug.menu import (NumberOption, BooleanOption, PersonOption,
from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
@ -302,12 +302,12 @@ class KinshipReport(Report):
birth_date = ""
birth = get_birth_or_fallback(self.database, person)
if birth:
birth_date = gen.datehandler.get_date(birth)
birth_date = get_date(birth)
death_date = ""
death = get_death_or_fallback(self.database, person)
if death:
death_date = gen.datehandler.get_date(death)
death_date = get_date(death)
dates = _(" (%(birth_date)s - %(death_date)s)") % {
'birth_date' : birth_date,
'death_date' : death_date }

View File

@ -44,7 +44,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, TableStyle,
TableCellStyle, FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gen.proxy import PrivateProxyDb
import gen.datehandler
from gramps.gen.datehandler import get_date
from gen.sort import Sort
from gen.display.name import displayer as _nd
@ -193,7 +193,7 @@ class PlaceReport(Report):
for evt_handle in event_handles:
event = self.database.get_event_from_handle(evt_handle)
if event:
date = gen.datehandler.get_date(event)
date = get_date(event)
descr = event.get_description()
event_type = str(event.get_type())
@ -315,7 +315,7 @@ class PlaceReport(Report):
for evt_handle in person_dict[entry]:
event = self.database.get_event_from_handle(evt_handle)
if event:
date = gen.datehandler.get_date(event)
date = get_date(event)
descr = event.get_description()
event_type = str(event.get_type())
event_details = [people, event_type, descr, date]

View File

@ -46,7 +46,7 @@ from gen.plug.report import MenuReportOptions
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
FONT_SANS_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gen.utils.file import media_path_full
import gen.datehandler
from gramps.gen.datehandler import get_date
#------------------------------------------------------------------------
@ -133,7 +133,7 @@ class SummaryReport(Report):
birth_ref = person.get_birth_ref()
if birth_ref:
birth = self.__db.get_event_from_handle(birth_ref.ref)
if not gen.datehandler.get_date(birth):
if not get_date(birth):
missing_bday += 1
else:
missing_bday += 1

View File

@ -48,7 +48,7 @@ from gen.lib import NoteType
from gen.filters import GenericFilterFactory, rules
from gen.display.name import displayer as name_displayer
from gen.errors import ReportError
import gen.datehandler
from gramps.gen.datehandler import get_date
#------------------------------------------------------------------------
#
@ -163,7 +163,7 @@ class TagReport(Report):
birth_ref = person.get_birth_ref()
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
self.doc.write_text(gen.datehandler.get_date( event ))
self.doc.write_text(get_date( event ))
self.doc.end_paragraph()
self.doc.end_cell()
@ -172,7 +172,7 @@ class TagReport(Report):
death_ref = person.get_death_ref()
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
self.doc.write_text(gen.datehandler.get_date( event ))
self.doc.write_text(get_date( event ))
self.doc.end_paragraph()
self.doc.end_cell()
@ -329,7 +329,7 @@ class TagReport(Report):
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
date = gen.datehandler.get_date(event)
date = get_date(event)
if date:
self.doc.write_text(date)
self.doc.end_paragraph()
@ -499,7 +499,7 @@ class TagReport(Report):
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
date = gen.datehandler.get_date(media)
date = get_date(media)
if date:
self.doc.write_text(date)
self.doc.end_paragraph()

View File

@ -52,7 +52,7 @@ from gui.utils import ProgressMeter
from gen.utils.docgen import ODSTab
from gen.const import CUSTOM_FILTERS, URL_MANUAL_PAGE
from gen.errors import WindowActiveError
import gen.datehandler
from gramps.gen.datehandler import get_date
from gui.dialog import WarningDialog
from gui.plug import tool
from gen.plug.report import utils as ReportUtils
@ -333,7 +333,7 @@ class DisplayChart(ManagedWindow):
if event_handle:
event = self.db.get_event_from_handle(event_handle)
date = gen.datehandler.get_date(event)
date = get_date(event)
sortdate = "%09d" % (
event.get_date_object().get_sort_value()
)

View File

@ -51,7 +51,7 @@ from gui.utils import ProgressMeter
from gui.plug import tool
from gui.dialog import OkDialog
from gui.display import display_help
import gen.datehandler
from gramps.gen.datehandler import get_date
from gui.managedwindow import ManagedWindow
from gen.ggettext import sgettext as _
from gen.ggettext import ngettext
@ -197,7 +197,7 @@ class MergeCitations(tool.BatchTool,ManagedWindow):
citation = db.get_citation_from_handle(citation_handle)
key = citation.get_page()
if fields <> IGNORE_DATE and fields <> IGNORE_BOTH:
key += "\n" + gen.datehandler.get_date(citation)
key += "\n" + get_date(citation)
if fields <> IGNORE_CONFIDENCE and fields <> IGNORE_BOTH:
key += "\n" + \
confidence[citation.get_confidence_level()]

View File

@ -50,7 +50,7 @@ _LOG = logging.getLogger("GeoGraphy.geoclose")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.navigationview import NavigationView
@ -442,7 +442,7 @@ class GeoClose(GeoGraphyView):
message = ""
evt = self.dbstate.db.get_event_from_gramps_id(plce[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
if date == "":
date = _("Unknown")
if ( plce[11] == gen.lib.EventRoleType.PRIMARY ):

View File

@ -56,7 +56,7 @@ _LOG = logging.getLogger("GeoGraphy.geoevents")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.pageview import PageView
@ -334,7 +334,7 @@ class GeoEvents(GeoGraphyView):
oldplace = mark[0]
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
message = "(%s) %s : %s" % (date, gen.lib.EventType( mark[7] ), mark[5] )
prevmark = mark
add_item = Gtk.MenuItem(label=message)

View File

@ -50,7 +50,7 @@ _LOG = logging.getLogger("GeoGraphy.geofamilyclose")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.navigationview import NavigationView
@ -631,7 +631,7 @@ class GeoFamClose(GeoGraphyView):
message = ""
evt = self.dbstate.db.get_event_from_gramps_id(plce[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
if date == "":
date = _("Unknown")
if ( plce[11] == gen.lib.EventRoleType.PRIMARY ):

View File

@ -56,7 +56,7 @@ _LOG = logging.getLogger("GeoGraphy.geofamily")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.pageview import PageView
@ -425,7 +425,7 @@ class GeoFamily(GeoGraphyView):
oldplace = mark[0]
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
if date == "":
date = _("Unknown")
if ( mark[5] == gen.lib.EventRoleType.PRIMARY ):

View File

@ -54,7 +54,7 @@ _LOG = logging.getLogger("GeoGraphy.geomoves")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.navigationview import NavigationView
@ -570,7 +570,7 @@ class GeoMoves(GeoGraphyView):
message = ""
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
if date == "":
date = _("Unknown")
if ( mark[11] == gen.lib.EventRoleType.PRIMARY ):

View File

@ -57,7 +57,7 @@ _LOG = logging.getLogger("GeoGraphy.geoperson")
#-------------------------------------------------------------------------
import gen.lib
from gen.config import config
import gen.datehandler
from gramps.gen.datehandler import displayer
from gen.display.name import displayer as _nd
from gen.utils.place import conv_lat_lon
from gui.views.pageview import PageView
@ -450,7 +450,7 @@ class GeoPerson(GeoGraphyView):
message = ""
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
# format the date as described in preferences.
date = gen.datehandler.displayer.display(evt.get_date_object())
date = displayer.display(evt.get_date_object())
if date == "":
date = _("Unknown")
if ( mark[11] == gen.lib.EventRoleType.PRIMARY ):

View File

@ -64,7 +64,7 @@ from gen.display.name import displayer as name_displayer
from gen.utils.file import media_path_full
from gen.utils.alive import probably_alive
from gui.utils import open_file_with_default_application
import gen.datehandler
from gramps.gen.datehandler import displayer, get_date
from gui.thumbnails import get_thumbnail_image
from gen.config import config
from gui import widgets
@ -721,7 +721,7 @@ class RelationshipView(NavigationView):
pname = None
value = {
'date' : gen.datehandler.displayer.display(dobj),
'date' : displayer.display(dobj),
'place' : pname,
}
else:
@ -749,7 +749,7 @@ class RelationshipView(NavigationView):
pname = None
value = {
'date' : gen.datehandler.displayer.display(dobj),
'date' : displayer.display(dobj),
'place' : pname,
}
else:
@ -1169,25 +1169,25 @@ class RelationshipView(NavigationView):
birth = get_birth_or_fallback(self.dbstate.db, person)
if birth and birth.get_type() != gen.lib.EventType.BIRTH:
sdate = gen.datehandler.get_date(birth)
sdate = get_date(birth)
if sdate:
bdate = "<i>%s</i>" % cgi.escape(sdate)
else:
bdate = ""
elif birth:
bdate = cgi.escape(gen.datehandler.get_date(birth))
bdate = cgi.escape(get_date(birth))
else:
bdate = ""
death = get_death_or_fallback(self.dbstate.db, person)
if death and death.get_type() != gen.lib.EventType.DEATH:
sdate = gen.datehandler.get_date(death)
sdate = get_date(death)
if sdate:
ddate = "<i>%s</i>" % cgi.escape(sdate)
else:
ddate = ""
elif death:
ddate = cgi.escape(gen.datehandler.get_date(death))
ddate = cgi.escape(get_date(death))
else:
ddate = ""
@ -1292,7 +1292,7 @@ class RelationshipView(NavigationView):
pname = None
value = {
'date' : gen.datehandler.displayer.display(dobj),
'date' : displayer.display(dobj),
'place' : pname,
'event_type' : ename,
}