diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index f3e89ed1e..ea43fb619 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -212,6 +212,7 @@ src/gen/utils/__init__.py
src/gen/utils/callback.py
src/gen/utils/callman.py
src/gen/utils/cast.py
+src/gen/utils/db.py
src/gen/utils/file.py
src/gen/utils/id.py
src/gen/utils/image.py
diff --git a/src/Utils.py b/src/Utils.py
index 7a64d24c3..3dfc1e8bd 100644
--- a/src/Utils.py
+++ b/src/Utils.py
@@ -41,12 +41,9 @@ LOG = logging.getLogger(".")
#
#-------------------------------------------------------------------------
import gen.lib
-from gen.display.name import displayer as name_displayer
from gen.datehandler import codeset
from gen.config import config
from gen.constfunc import mac, win
-from gen.ggettext import sgettext as _
-from gen.utils.name import family_name
#-------------------------------------------------------------------------
#
@@ -224,139 +221,3 @@ def get_researcher():
owner.set_email(email)
return owner
-
-#-------------------------------------------------------------------------
-#
-# Function to return the name of the main participant of an event
-#
-#-------------------------------------------------------------------------
-def get_participant_from_event(db, event_handle, all_=False):
- """
- Obtain the first primary or family participant to an event we find in the
- database. Note that an event can have more than one primary or
- family participant, only one is returned, adding ellipses if there are
- more. If the all_ parameter is true a comma-space separated string with
- the names of all primary participants is returned and no ellipses is used.
- """
- participant = ""
- ellipses = False
- result_list = list(db.find_backlink_handles(event_handle,
- include_classes=['Person', 'Family']))
- #obtain handles without duplicates
- people = set([x[1] for x in result_list if x[0] == 'Person'])
- families = set([x[1] for x in result_list if x[0] == 'Family'])
- for personhandle in people:
- person = db.get_person_from_handle(personhandle)
- if not person:
- continue
- for event_ref in person.get_event_ref_list():
- if event_handle == event_ref.ref and \
- event_ref.get_role().is_primary():
- if participant:
- if all_:
- participant += ', %s' % name_displayer.display(person)
- else:
- ellipses = True
- else:
- participant = name_displayer.display(person)
- break
- if ellipses:
- break
- if ellipses:
- return _('%s, ...') % participant
-
- for familyhandle in families:
- family = db.get_family_from_handle(familyhandle)
- for event_ref in family.get_event_ref_list():
- if event_handle == event_ref.ref and \
- event_ref.get_role().is_family():
- if participant:
- if all_:
- participant += ', %s' % family_name(family, db)
- else:
- ellipses = True
- else:
- participant = family_name(family, db)
- break
- if ellipses:
- break
-
- if ellipses:
- return _('%s, ...') % participant
- else:
- return participant
-
-#-------------------------------------------------------------------------
-#
-# Function to return a label to display the active object in the status bar
-# and to describe bookmarked objects.
-#
-#-------------------------------------------------------------------------
-def navigation_label(db, nav_type, handle):
-
- label = None
- obj = None
- if nav_type == 'Person':
- obj = db.get_person_from_handle(handle)
- if obj:
- label = name_displayer.display(obj)
- elif nav_type == 'Family':
- obj = db.get_family_from_handle(handle)
- if obj:
- label = family_name(obj, db)
- elif nav_type == 'Event':
- obj = db.get_event_from_handle(handle)
- if obj:
- try:
- who = get_participant_from_event(db, handle)
- except:
- # get_participants_from_event fails when called during a magic
- # batch transaction because find_backlink_handles tries to
- # access the reference_map_referenced_map which doesn't exist
- # under those circumstances. Since setting the navigation_label
- # is inessential, just accept this and go on.
- who = ''
- desc = obj.get_description()
- label = obj.get_type()
- if desc:
- label = '%s - %s' % (label, desc)
- if who:
- label = '%s - %s' % (label, who)
- elif nav_type == 'Place':
- obj = db.get_place_from_handle(handle)
- if obj:
- label = obj.get_title()
- elif nav_type == 'Source':
- obj = db.get_source_from_handle(handle)
- if obj:
- label = obj.get_title()
- elif nav_type == 'Citation':
- obj = db.get_citation_from_handle(handle)
- if obj:
- label = obj.get_page()
- src = db.get_source_from_handle(obj.get_reference_handle())
- if src:
- label = src.get_title() + " " + label
- elif nav_type == 'Repository':
- obj = db.get_repository_from_handle(handle)
- if obj:
- label = obj.get_name()
- elif nav_type == 'Media' or nav_type == 'MediaObject':
- obj = db.get_object_from_handle(handle)
- if obj:
- label = obj.get_description()
- elif nav_type == 'Note':
- obj = db.get_note_from_handle(handle)
- if obj:
- label = obj.get()
- # When strings are cut, make sure they are unicode
- #otherwise you may end of with cutting within an utf-8 sequence
- label = unicode(label)
- label = " ".join(label.split())
- if len(label) > 40:
- label = label[:40] + "..."
-
- if label and obj:
- label = '[%s] %s' % (obj.get_gramps_id(), label)
-
- return (label, obj)
diff --git a/src/gen/config.py b/src/gen/config.py
index a2abebd13..e1e5c54a2 100644
--- a/src/gen/config.py
+++ b/src/gen/config.py
@@ -42,7 +42,7 @@ from gen.ggettext import gettext as _
#
#---------------------------------------------------------------
import const
-from gen.utils import ConfigManager
+from gen.utils.configmanager import ConfigManager
#---------------------------------------------------------------
#
diff --git a/src/gen/dbstate.py b/src/gen/dbstate.py
index c3fb4f0f1..a8d04b8bf 100644
--- a/src/gen/dbstate.py
+++ b/src/gen/dbstate.py
@@ -27,7 +27,7 @@ Provide the database state class
from gen.db import DbBsddbRead
from gen.proxy.proxybase import ProxyDbBase
-from gen.utils import Callback
+from gen.utils.callback import Callback
from gen.config import config
class DbState(Callback):
diff --git a/src/gen/filters/rules/_haseventbase.py b/src/gen/filters/rules/_haseventbase.py
index 3c8974951..a6414a7e1 100644
--- a/src/gen/filters/rules/_haseventbase.py
+++ b/src/gen/filters/rules/_haseventbase.py
@@ -35,7 +35,7 @@ from gen.ggettext import gettext as _
import gen.datehandler
from gen.lib import EventType
from gen.filters.rules import Rule
-from Utils import get_participant_from_event
+from gen.utils.db import get_participant_from_event
#-------------------------------------------------------------------------
#
diff --git a/src/gen/plug/_manager.py b/src/gen/plug/_manager.py
index 5138ae4c3..82a3296e3 100644
--- a/src/gen/plug/_manager.py
+++ b/src/gen/plug/_manager.py
@@ -46,7 +46,6 @@ from gen.ggettext import gettext as _
#
#-------------------------------------------------------------------------
from gen.config import config
-import gen.utils
from gen.plug import PluginRegister
#-------------------------------------------------------------------------
diff --git a/src/gen/plug/menu/_option.py b/src/gen/plug/menu/_option.py
index 74aa3e995..978e86cf6 100644
--- a/src/gen/plug/menu/_option.py
+++ b/src/gen/plug/menu/_option.py
@@ -29,14 +29,14 @@ The base option class for all other option classes.
# gramps modules
#
#-------------------------------------------------------------------------
-import gen.utils
+from gen.utils.callback import Callback
#-------------------------------------------------------------------------
#
# Option class
#
#-------------------------------------------------------------------------
-class Option(gen.utils.Callback):
+class Option(Callback):
"""
This class serves as a base class for all options. All Options must
minimally provide the services provided by this class. Options are allowed
@@ -56,7 +56,7 @@ class Option(gen.utils.Callback):
@type value: The type will depend on the type of option.
@return: nothing
"""
- gen.utils.Callback.__init__(self)
+ Callback.__init__(self)
self.__value = value
self.__label = label
self.__help_str = ""
diff --git a/src/gen/simple/_simpleaccess.py b/src/gen/simple/_simpleaccess.py
index a74078280..aa136e24c 100644
--- a/src/gen/simple/_simpleaccess.py
+++ b/src/gen/simple/_simpleaccess.py
@@ -31,7 +31,7 @@ from types import NoneType
import gen.lib
import gen.datehandler
from gen.utils.string import gender as gender_map
-import gen.utils
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gen.plug.report.utils import place_name
from gen.display.name import displayer as name_displayer
@@ -524,8 +524,7 @@ class SimpleAccess(object):
"""
if type(person) in [str, unicode]:
person = self.dbase.get_person_from_handle(person)
- event = gen.utils.get_birth_or_fallback(self.dbase,
- person, "%s")
+ event = get_birth_or_fallback(self.dbase, person, "%s")
if get_event:
return event
elif event:
@@ -583,8 +582,7 @@ class SimpleAccess(object):
"""
if type(person) in [str, unicode]:
person = self.dbase.get_person_from_handle(person)
- event = gen.utils.get_death_or_fallback(self.dbase,
- person, "%s")
+ event = get_death_or_fallback(self.dbase, person, "%s")
if get_event:
return event
elif event:
diff --git a/src/gen/sort.py b/src/gen/sort.py
index af850b969..bdaf60a23 100644
--- a/src/gen/sort.py
+++ b/src/gen/sort.py
@@ -40,7 +40,7 @@ import locale
#
#-------------------------------------------------------------------------
from gen.lib import Date
-from gen.utils import get_birth_or_fallback
+from gen.utils.db import get_birth_or_fallback
from gen.display.name import displayer as _nd
#-------------------------------------------------------------------------
diff --git a/src/gen/utils/Makefile.am b/src/gen/utils/Makefile.am
index e4c6cc41e..e5eab21df 100644
--- a/src/gen/utils/Makefile.am
+++ b/src/gen/utils/Makefile.am
@@ -15,7 +15,7 @@ pkgpython_PYTHON = \
callman.py \
cast.py \
configmanager.py \
- fallback.py \
+ db.py \
file.py \
id.py \
image.py \
diff --git a/src/gen/utils/__init__.py b/src/gen/utils/__init__.py
index eb403b655..5273a36d4 100644
--- a/src/gen/utils/__init__.py
+++ b/src/gen/utils/__init__.py
@@ -24,7 +24,3 @@
"""
Generic utilities useful for users of the gen package
"""
-
-from callback import Callback
-from configmanager import ConfigManager
-from fallback import *
diff --git a/src/gen/utils/db.py b/src/gen/utils/db.py
new file mode 100644
index 000000000..ce77da626
--- /dev/null
+++ b/src/gen/utils/db.py
@@ -0,0 +1,293 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2000-2007 Donald N. Allingham
+#
+# 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# $Id$
+
+"""
+Utilities for getting information from the database.
+"""
+#-------------------------------------------------------------------------
+#
+# Gramps modules
+#
+#-------------------------------------------------------------------------
+from gen.display.name import displayer as name_displayer
+from gen.utils.name import family_name
+from gen.ggettext import sgettext as _
+
+#-------------------------------------------------------------------------
+#
+# Fallback functions
+#
+#-------------------------------------------------------------------------
+def get_birth_or_fallback(db, person, format=None):
+ """
+ Get BIRTH event from a person, or fallback to an event around
+ the time of birth.
+ """
+ birth_ref = person.get_birth_ref()
+ if birth_ref: # regular birth found
+ event = db.get_event_from_handle(birth_ref.ref)
+ if event:
+ return event
+ # now search the event list for fallbacks
+ for event_ref in person.get_primary_event_ref_list():
+ if event_ref:
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event
+ and event.type.is_birth_fallback()
+ and event_ref.role.is_primary()):
+ if format:
+ event.date.format = format
+ return event
+ return None
+
+def get_death_or_fallback(db, person, format=None):
+ """
+ Get a DEATH event from a person, or fallback to an
+ event around the time of death.
+ """
+ death_ref = person.get_death_ref()
+ if death_ref: # regular death found
+ event = db.get_event_from_handle(death_ref.ref)
+ if event:
+ return event
+ # now search the event list for fallbacks
+ for event_ref in person.get_primary_event_ref_list():
+ if event_ref:
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event
+ and event.type.is_death_fallback()
+ and event_ref.role.is_primary()):
+ if format:
+ event.date.format = format
+ return event
+ return None
+
+def get_event_ref(db, family, event_type):
+ """
+ Return a reference to a primary family event of the given event type.
+ """
+ from gen.lib import EventRoleType
+ for event_ref in family.get_event_ref_list():
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event and event.get_type() == event_type and
+ (event_ref.get_role() == EventRoleType.FAMILY or
+ event_ref.get_role() == EventRoleType.PRIMARY)):
+ return event_ref
+ return None
+
+def get_primary_event_ref_list(db, family):
+ """
+ Return a reference to the primary events of the family.
+ """
+ from gen.lib import EventRoleType
+ retval = []
+ for event_ref in family.get_event_ref_list():
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event and
+ (event_ref.get_role() == EventRoleType.FAMILY or
+ event_ref.get_role() == EventRoleType.PRIMARY)):
+ retval.append(event_ref)
+ return retval
+
+def get_marriage_or_fallback(db, family, format=None):
+ """
+ Get a MARRIAGE event from a family, or fallback to an
+ alternative event type.
+ """
+ from gen.lib import EventType, EventRoleType
+ marriage_ref = get_event_ref(db, family, EventType.MARRIAGE)
+ if marriage_ref: # regular marriage found
+ event = db.get_event_from_handle(marriage_ref.ref)
+ if event:
+ return event
+ # now search the event list for fallbacks
+ for event_ref in get_primary_event_ref_list(db, family):
+ if event_ref:
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event
+ and event.type.is_marriage_fallback()
+ and (event_ref.role == EventRoleType.FAMILY or
+ event_ref.role == EventRoleType.PRIMARY)):
+ if format:
+ event.date.format = format
+ return event
+ return None
+
+def get_divorce_or_fallback(db, family, format=None):
+ """
+ Get a DIVORCE event from a family, or fallback to an
+ alternative event type.
+ """
+ from gen.lib import EventType, EventRoleType
+ divorce_ref = get_event_ref(db, family, EventType.DIVORCE)
+ if divorce_ref: # regular marriage found
+ event = db.get_event_from_handle(divorce_ref.ref)
+ if event:
+ return event
+ # now search the event list for fallbacks
+ for event_ref in get_primary_event_ref_list(db, family):
+ if event_ref:
+ event = db.get_event_from_handle(event_ref.ref)
+ if (event
+ and event.type.is_divorce_fallback()
+ and (event_ref.role == EventRoleType.FAMILY or
+ event_ref.role == EventRoleType.PRIMARY)):
+ if format:
+ event.date.format = format
+ return event
+ return None
+
+#-------------------------------------------------------------------------
+#
+# Function to return the name of the main participant of an event
+#
+#-------------------------------------------------------------------------
+def get_participant_from_event(db, event_handle, all_=False):
+ """
+ Obtain the first primary or family participant to an event we find in the
+ database. Note that an event can have more than one primary or
+ family participant, only one is returned, adding ellipses if there are
+ more. If the all_ parameter is true a comma-space separated string with
+ the names of all primary participants is returned and no ellipses is used.
+ """
+ participant = ""
+ ellipses = False
+ result_list = list(db.find_backlink_handles(event_handle,
+ include_classes=['Person', 'Family']))
+ #obtain handles without duplicates
+ people = set([x[1] for x in result_list if x[0] == 'Person'])
+ families = set([x[1] for x in result_list if x[0] == 'Family'])
+ for personhandle in people:
+ person = db.get_person_from_handle(personhandle)
+ if not person:
+ continue
+ for event_ref in person.get_event_ref_list():
+ if event_handle == event_ref.ref and \
+ event_ref.get_role().is_primary():
+ if participant:
+ if all_:
+ participant += ', %s' % name_displayer.display(person)
+ else:
+ ellipses = True
+ else:
+ participant = name_displayer.display(person)
+ break
+ if ellipses:
+ break
+ if ellipses:
+ return _('%s, ...') % participant
+
+ for familyhandle in families:
+ family = db.get_family_from_handle(familyhandle)
+ for event_ref in family.get_event_ref_list():
+ if event_handle == event_ref.ref and \
+ event_ref.get_role().is_family():
+ if participant:
+ if all_:
+ participant += ', %s' % family_name(family, db)
+ else:
+ ellipses = True
+ else:
+ participant = family_name(family, db)
+ break
+ if ellipses:
+ break
+
+ if ellipses:
+ return _('%s, ...') % participant
+ else:
+ return participant
+
+#-------------------------------------------------------------------------
+#
+# Function to return a label to display the active object in the status bar
+# and to describe bookmarked objects.
+#
+#-------------------------------------------------------------------------
+def navigation_label(db, nav_type, handle):
+
+ label = None
+ obj = None
+ if nav_type == 'Person':
+ obj = db.get_person_from_handle(handle)
+ if obj:
+ label = name_displayer.display(obj)
+ elif nav_type == 'Family':
+ obj = db.get_family_from_handle(handle)
+ if obj:
+ label = family_name(obj, db)
+ elif nav_type == 'Event':
+ obj = db.get_event_from_handle(handle)
+ if obj:
+ try:
+ who = get_participant_from_event(db, handle)
+ except:
+ # get_participants_from_event fails when called during a magic
+ # batch transaction because find_backlink_handles tries to
+ # access the reference_map_referenced_map which doesn't exist
+ # under those circumstances. Since setting the navigation_label
+ # is inessential, just accept this and go on.
+ who = ''
+ desc = obj.get_description()
+ label = obj.get_type()
+ if desc:
+ label = '%s - %s' % (label, desc)
+ if who:
+ label = '%s - %s' % (label, who)
+ elif nav_type == 'Place':
+ obj = db.get_place_from_handle(handle)
+ if obj:
+ label = obj.get_title()
+ elif nav_type == 'Source':
+ obj = db.get_source_from_handle(handle)
+ if obj:
+ label = obj.get_title()
+ elif nav_type == 'Citation':
+ obj = db.get_citation_from_handle(handle)
+ if obj:
+ label = obj.get_page()
+ src = db.get_source_from_handle(obj.get_reference_handle())
+ if src:
+ label = src.get_title() + " " + label
+ elif nav_type == 'Repository':
+ obj = db.get_repository_from_handle(handle)
+ if obj:
+ label = obj.get_name()
+ elif nav_type == 'Media' or nav_type == 'MediaObject':
+ obj = db.get_object_from_handle(handle)
+ if obj:
+ label = obj.get_description()
+ elif nav_type == 'Note':
+ obj = db.get_note_from_handle(handle)
+ if obj:
+ label = obj.get()
+ # When strings are cut, make sure they are unicode
+ #otherwise you may end of with cutting within an utf-8 sequence
+ label = unicode(label)
+ label = " ".join(label.split())
+ if len(label) > 40:
+ label = label[:40] + "..."
+
+ if label and obj:
+ label = '[%s] %s' % (obj.get_gramps_id(), label)
+
+ return (label, obj)
diff --git a/src/gen/utils/fallback.py b/src/gen/utils/fallback.py
deleted file mode 100644
index f4967e6ad..000000000
--- a/src/gen/utils/fallback.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Gramps - a GTK+/GNOME based genealogy program
-#
-# Copyright (C) 2000-2007 Donald N. Allingham
-#
-# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-# $Id$
-
-"""
-Functional database interface for getting events, or fallback events.
-"""
-
-def get_birth_or_fallback(db, person, format=None):
- """
- Get BIRTH event from a person, or fallback to an event around
- the time of birth.
- """
- birth_ref = person.get_birth_ref()
- if birth_ref: # regular birth found
- event = db.get_event_from_handle(birth_ref.ref)
- if event:
- return event
- # now search the event list for fallbacks
- for event_ref in person.get_primary_event_ref_list():
- if event_ref:
- event = db.get_event_from_handle(event_ref.ref)
- if (event
- and event.type.is_birth_fallback()
- and event_ref.role.is_primary()):
- if format:
- event.date.format = format
- return event
- return None
-
-def get_death_or_fallback(db, person, format=None):
- """
- Get a DEATH event from a person, or fallback to an
- event around the time of death.
- """
- death_ref = person.get_death_ref()
- if death_ref: # regular death found
- event = db.get_event_from_handle(death_ref.ref)
- if event:
- return event
- # now search the event list for fallbacks
- for event_ref in person.get_primary_event_ref_list():
- if event_ref:
- event = db.get_event_from_handle(event_ref.ref)
- if (event
- and event.type.is_death_fallback()
- and event_ref.role.is_primary()):
- if format:
- event.date.format = format
- return event
- return None
-
-def get_event_ref(db, family, event_type):
- """
- Return a reference to a primary family event of the given event type.
- """
- from gen.lib import EventRoleType
- for event_ref in family.get_event_ref_list():
- event = db.get_event_from_handle(event_ref.ref)
- if (event and event.get_type() == event_type and
- (event_ref.get_role() == EventRoleType.FAMILY or
- event_ref.get_role() == EventRoleType.PRIMARY)):
- return event_ref
- return None
-
-def get_primary_event_ref_list(db, family):
- """
- Return a reference to the primary events of the family.
- """
- from gen.lib import EventRoleType
- retval = []
- for event_ref in family.get_event_ref_list():
- event = db.get_event_from_handle(event_ref.ref)
- if (event and
- (event_ref.get_role() == EventRoleType.FAMILY or
- event_ref.get_role() == EventRoleType.PRIMARY)):
- retval.append(event_ref)
- return retval
-
-def get_marriage_or_fallback(db, family, format=None):
- """
- Get a MARRIAGE event from a family, or fallback to an
- alternative event type.
- """
- from gen.lib import EventType, EventRoleType
- marriage_ref = get_event_ref(db, family, EventType.MARRIAGE)
- if marriage_ref: # regular marriage found
- event = db.get_event_from_handle(marriage_ref.ref)
- if event:
- return event
- # now search the event list for fallbacks
- for event_ref in get_primary_event_ref_list(db, family):
- if event_ref:
- event = db.get_event_from_handle(event_ref.ref)
- if (event
- and event.type.is_marriage_fallback()
- and (event_ref.role == EventRoleType.FAMILY or
- event_ref.role == EventRoleType.PRIMARY)):
- if format:
- event.date.format = format
- return event
- return None
-
-def get_divorce_or_fallback(db, family, format=None):
- """
- Get a DIVORCE event from a family, or fallback to an
- alternative event type.
- """
- from gen.lib import EventType, EventRoleType
- divorce_ref = get_event_ref(db, family, EventType.DIVORCE)
- if divorce_ref: # regular marriage found
- event = db.get_event_from_handle(divorce_ref.ref)
- if event:
- return event
- # now search the event list for fallbacks
- for event_ref in get_primary_event_ref_list(db, family):
- if event_ref:
- event = db.get_event_from_handle(event_ref.ref)
- if (event
- and event.type.is_divorce_fallback()
- and (event_ref.role == EventRoleType.FAMILY or
- event_ref.role == EventRoleType.PRIMARY)):
- if format:
- event.date.format = format
- return event
- return None
diff --git a/src/gen/utils/test/callback_test.py b/src/gen/utils/test/callback_test.py
index dae33623c..bd442fac8 100644
--- a/src/gen/utils/test/callback_test.py
+++ b/src/gen/utils/test/callback_test.py
@@ -26,7 +26,7 @@ import unittest
from test import test_util as tu
tu.path_append_parent()
-from gen.utils import Callback
+from gen.utils.callback import Callback
try:
log
diff --git a/src/gui/displaystate.py b/src/gui/displaystate.py
index 5d7da1e4d..40f05daf3 100644
--- a/src/gui/displaystate.py
+++ b/src/gui/displaystate.py
@@ -53,7 +53,7 @@ import gobject
# GRAMPS modules
#
#-------------------------------------------------------------------------
-import gen.utils
+from gen.utils.callback import Callback
from gui.utils import process_pending_events
from gui.views.navigationview import NavigationView
from gen.config import config
@@ -61,7 +61,7 @@ from gen.display.name import displayer as name_displayer
from gui.managedwindow import GrampsWindowManager
from gen.relationship import get_relationship_calculator
from gui.glade import Glade
-from Utils import navigation_label
+from gen.utils.db import navigation_label
DISABLED = -1
@@ -70,7 +70,7 @@ DISABLED = -1
# History manager
#
#-------------------------------------------------------------------------
-class History(gen.utils.Callback):
+class History(Callback):
""" History manages the objects of a certain type that have been viewed,
with ability to go back, or forward.
When accessing an object, it should be pushed on the History.
@@ -82,7 +82,7 @@ class History(gen.utils.Callback):
}
def __init__(self, dbstate, nav_type):
- gen.utils.Callback.__init__(self)
+ Callback.__init__(self)
self.dbstate = dbstate
self.nav_type = nav_type
self.clear()
@@ -351,7 +351,7 @@ class WarnHandler(RotateHandler):
top.run()
top.destroy()
-class DisplayState(gen.utils.Callback):
+class DisplayState(Callback):
__signals__ = {
'filters-changed' : (str, ),
@@ -380,7 +380,7 @@ class DisplayState(gen.utils.Callback):
self.uimanager = uimanager
self.progress_monitor = progress_monitor
self.window = window
- gen.utils.Callback.__init__(self)
+ Callback.__init__(self)
self.status = status
self.status_id = status.get_context_id('GRAMPS')
self.progress = progress
diff --git a/src/gui/editors/displaytabs/backrefmodel.py b/src/gui/editors/displaytabs/backrefmodel.py
index d544a14af..7d2451807 100644
--- a/src/gui/editors/displaytabs/backrefmodel.py
+++ b/src/gui/editors/displaytabs/backrefmodel.py
@@ -38,7 +38,7 @@ from gen.ggettext import gettext as _
#-------------------------------------------------------------------------
from gen.display.name import displayer as name_displayer
from gen.utils.name import family_name
-import Utils
+from gen.utils.db import get_participant_from_event
#-------------------------------------------------------------------------
#
@@ -112,7 +112,7 @@ class BackRefModel(gtk.ListStore):
'part2': name}
else:
name = str(p.get_type())
- part = Utils.get_participant_from_event(self.db, ref[1])
+ part = get_participant_from_event(self.db, ref[1])
if part :
name = self.dispstr % {'part1': name,
'part2': part}
diff --git a/src/gui/editors/displaytabs/childmodel.py b/src/gui/editors/displaytabs/childmodel.py
index 55acf9636..8fa79ce41 100644
--- a/src/gui/editors/displaytabs/childmodel.py
+++ b/src/gui/editors/displaytabs/childmodel.py
@@ -37,7 +37,7 @@ import gen.datehandler
from gen.display.name import displayer as name_displayer
from gen.utils.string import gender as gender_map
import gen.lib
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#-------------------------------------------------------------------------
#
diff --git a/src/gui/editors/editevent.py b/src/gui/editors/editevent.py
index 7522e98a3..f72828a03 100644
--- a/src/gui/editors/editevent.py
+++ b/src/gui/editors/editevent.py
@@ -53,7 +53,7 @@ from displaytabs import (CitationEmbedList, NoteTab, GalleryTab,
EventBackRefList, AttrEmbedList)
from gui.widgets import (MonitoredEntry, PrivacyButton,
MonitoredDataType, MonitoredDate)
-from Utils import get_participant_from_event
+from gen.utils.db import get_participant_from_event
#-------------------------------------------------------------------------
#
diff --git a/src/gui/editors/editfamily.py b/src/gui/editors/editfamily.py
index f6498672e..e9799ab66 100644
--- a/src/gui/editors/editfamily.py
+++ b/src/gui/editors/editfamily.py
@@ -62,7 +62,7 @@ import gobject
#-------------------------------------------------------------------------
from gen.config import config
from gen.display.name import displayer as name_displayer
-from gen.utils import get_marriage_or_fallback
+from gen.utils.db import get_marriage_or_fallback
import gen.lib
from gen.db import DbTxn
from gen.errors import WindowActiveError
@@ -80,7 +80,7 @@ from gui.widgets import (PrivacyButton, MonitoredEntry, MonitoredDataType,
from gen.plug import CATEGORY_QR_FAMILY
from gui.dialog import (ErrorDialog, RunDatabaseRepair, WarningDialog,
MessageHideDialog)
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gui.selectors import SelectorFactory
from gen.utils.id import create_id
from gen.utils.name import preset_name, family_name
diff --git a/src/gui/editors/editperson.py b/src/gui/editors/editperson.py
index bc16ac950..d0a540520 100644
--- a/src/gui/editors/editperson.py
+++ b/src/gui/editors/editperson.py
@@ -52,7 +52,7 @@ import pango
from gen.utils.file import media_path_full
from gui.thumbnails import get_thumbnail_image
import gui.utils
-from gen.utils import get_birth_or_fallback
+from gen.utils.db import get_birth_or_fallback
import gen.lib
from gen.db import DbTxn
from gui import widgets
diff --git a/src/gui/merge/mergeevent.py b/src/gui/merge/mergeevent.py
index 1d6b676e3..7341d34da 100644
--- a/src/gui/merge/mergeevent.py
+++ b/src/gui/merge/mergeevent.py
@@ -34,7 +34,7 @@ import const
from gui.display import display_help
from gui.managedwindow import ManagedWindow
import gen.datehandler
-import Utils
+from gen.utils.db import get_participant_from_event
from gen.merge import MergeEventQuery
#-------------------------------------------------------------------------
@@ -121,8 +121,8 @@ class MergeEvent(ManagedWindow):
self.get_widget(widget_name).set_sensitive(False)
# Main window widgets that determine which handle survives
- ppant1 = Utils.get_participant_from_event(database, handle1)
- ppant2 = Utils.get_participant_from_event(database, handle2)
+ ppant1 = get_participant_from_event(database, handle1)
+ ppant2 = get_participant_from_event(database, handle2)
rbutton1 = self.get_widget("handle_btn1")
rbutton_label1 = self.get_widget("label_handle_btn1")
rbutton_label2 = self.get_widget("label_handle_btn2")
diff --git a/src/gui/pluginmanager.py b/src/gui/pluginmanager.py
index 8ddff1354..575a145ac 100644
--- a/src/gui/pluginmanager.py
+++ b/src/gui/pluginmanager.py
@@ -42,7 +42,7 @@ import gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
-import gen.utils
+from gen.utils.callback import Callback
from gen.plug import BasePluginManager, PluginRegister
from gen.constfunc import win
from gen.config import config
@@ -118,7 +118,7 @@ def base_reg_stock_icons(iconpaths, extraiconsize, items):
# GuiPluginManager
#
#-------------------------------------------------------------------------
-class GuiPluginManager(gen.utils.Callback):
+class GuiPluginManager(Callback):
""" PluginManager is a Singleton which manages plugins.
It is the gui implementation using a unique BasePluginmanager.
This class adds the possibility to hide plugins in the GUI via a config
@@ -141,7 +141,7 @@ class GuiPluginManager(gen.utils.Callback):
raise Exception("This class is a singleton. "
"Use the get_instance() method")
- gen.utils.Callback.__init__(self)
+ Callback.__init__(self)
self.basemgr = BasePluginManager.get_instance()
self.__hidden_plugins = set(config.get('plugin.hiddenplugins'))
self.__hidden_changed()
diff --git a/src/gui/views/bookmarks.py b/src/gui/views/bookmarks.py
index 2d08d3267..19a048145 100644
--- a/src/gui/views/bookmarks.py
+++ b/src/gui/views/bookmarks.py
@@ -53,7 +53,7 @@ import gtk
#-------------------------------------------------------------------------
from gui.display import display_help
from gui.listmodel import ListModel
-import Utils
+from gen.utils.db import navigation_label
import const
from gen.ggettext import sgettext as _
@@ -322,7 +322,7 @@ class PersonBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Person', handle)
+ return navigation_label(self.dbstate.db, 'Person', handle)
def connect_signals(self):
self.dbstate.db.connect('person-delete', self.remove_handles)
@@ -335,7 +335,7 @@ class FamilyBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Family', handle)
+ return navigation_label(self.dbstate.db, 'Family', handle)
def connect_signals(self):
self.dbstate.db.connect('family-delete', self.remove_handles)
@@ -348,7 +348,7 @@ class EventBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Event', handle)
+ return navigation_label(self.dbstate.db, 'Event', handle)
def connect_signals(self):
self.dbstate.db.connect('event-delete', self.remove_handles)
@@ -360,7 +360,7 @@ class SourceBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Source', handle)
+ return navigation_label(self.dbstate.db, 'Source', handle)
def connect_signals(self):
self.dbstate.db.connect('source-delete', self.remove_handles)
@@ -372,7 +372,7 @@ class CitationBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Citation', handle)
+ return navigation_label(self.dbstate.db, 'Citation', handle)
def connect_signals(self):
self.dbstate.db.connect('citation-delete', self.remove_handles)
@@ -385,7 +385,7 @@ class MediaBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Media', handle)
+ return navigation_label(self.dbstate.db, 'Media', handle)
def connect_signals(self):
self.dbstate.db.connect('media-delete', self.remove_handles)
@@ -398,7 +398,7 @@ class RepoBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Repository', handle)
+ return navigation_label(self.dbstate.db, 'Repository', handle)
def connect_signals(self):
self.dbstate.db.connect('repository-delete', self.remove_handles)
@@ -411,7 +411,7 @@ class PlaceBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Place', handle)
+ return navigation_label(self.dbstate.db, 'Place', handle)
def connect_signals(self):
self.dbstate.db.connect('place-delete', self.remove_handles)
@@ -424,7 +424,7 @@ class NoteBookmarks(ListBookmarks) :
goto_handle)
def make_label(self, handle):
- return Utils.navigation_label(self.dbstate.db, 'Note', handle)
+ return navigation_label(self.dbstate.db, 'Note', handle)
def connect_signals(self):
self.dbstate.db.connect('note-delete', self.remove_handles)
diff --git a/src/gui/views/navigationview.py b/src/gui/views/navigationview.py
index 66051319f..e315ba8d6 100644
--- a/src/gui/views/navigationview.py
+++ b/src/gui/views/navigationview.py
@@ -48,7 +48,7 @@ import gtk
#----------------------------------------------------------------
from gui.views.pageview import PageView
from gen.ggettext import sgettext as _
-from Utils import navigation_label
+from gen.utils.db import navigation_label
from gen.constfunc import mod_key
DISABLED = -1
diff --git a/src/gui/views/treemodels/eventmodel.py b/src/gui/views/treemodels/eventmodel.py
index 72822cbf0..db2ca8598 100644
--- a/src/gui/views/treemodels/eventmodel.py
+++ b/src/gui/views/treemodels/eventmodel.py
@@ -42,7 +42,7 @@ import gtk
#-------------------------------------------------------------------------
import gen.datehandler
import gen.lib
-import Utils
+from gen.utils.db import get_participant_from_event
from gen.config import config
from gui.views.treemodels.flatbasemodel import FlatBaseModel
@@ -116,7 +116,7 @@ class EventModel(FlatBaseModel):
return data[COLUMN_DESCRIPTION]
def column_participant(self,data):
- return Utils.get_participant_from_event(self.db, data[COLUMN_HANDLE])
+ return get_participant_from_event(self.db, data[COLUMN_HANDLE])
def column_place(self,data):
if data[COLUMN_PLACE]:
diff --git a/src/gui/views/treemodels/familymodel.py b/src/gui/views/treemodels/familymodel.py
index 7b2da3590..0b239746e 100644
--- a/src/gui/views/treemodels/familymodel.py
+++ b/src/gui/views/treemodels/familymodel.py
@@ -143,7 +143,7 @@ class FamilyModel(FlatBaseModel):
return unicode(gen.lib.FamilyRelType(data[5]))
def column_marriage(self, data):
- from gen.utils import get_marriage_or_fallback
+ from gen.utils.db import get_marriage_or_fallback
family = self.db.get_family_from_handle(data[0])
event = get_marriage_or_fallback(self.db, family, "%s")
if event:
@@ -157,7 +157,7 @@ class FamilyModel(FlatBaseModel):
return u''
def sort_marriage(self, data):
- from gen.utils import get_marriage_or_fallback
+ from gen.utils.db import get_marriage_or_fallback
family = self.db.get_family_from_handle(data[0])
event = get_marriage_or_fallback(self.db, family)
if event:
diff --git a/src/plugins/drawreport/timeline.py b/src/plugins/drawreport/timeline.py
index 48472e076..e164703ed 100644
--- a/src/plugins/drawreport/timeline.py
+++ b/src/plugins/drawreport/timeline.py
@@ -48,7 +48,7 @@ from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
from gen.sort import Sort
from gen.display.name import displayer as name_displayer
from gen.config import config
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/gramplet/backlinks.py b/src/plugins/gramplet/backlinks.py
index d235e4872..8c9ef5b55 100644
--- a/src/plugins/gramplet/backlinks.py
+++ b/src/plugins/gramplet/backlinks.py
@@ -21,7 +21,7 @@
#
from gui.listmodel import ListModel, NOSORT
-from Utils import navigation_label
+from gen.utils.db import navigation_label
from gen.plug import Gramplet
from gen.ggettext import gettext as _
import gtk
diff --git a/src/plugins/gramplet/children.py b/src/plugins/gramplet/children.py
index 2ffd36c61..24d695171 100644
--- a/src/plugins/gramplet/children.py
+++ b/src/plugins/gramplet/children.py
@@ -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
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
import gen.datehandler
from gen.errors import WindowActiveError
import gtk
diff --git a/src/plugins/gramplet/descendgramplet.py b/src/plugins/gramplet/descendgramplet.py
index 57f222a18..591c07246 100644
--- a/src/plugins/gramplet/descendgramplet.py
+++ b/src/plugins/gramplet/descendgramplet.py
@@ -41,7 +41,7 @@ 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 gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
class DescendantGramplet(Gramplet):
def init(self):
diff --git a/src/plugins/gramplet/events.py b/src/plugins/gramplet/events.py
index 459547d95..4cf1626ba 100644
--- a/src/plugins/gramplet/events.py
+++ b/src/plugins/gramplet/events.py
@@ -25,7 +25,7 @@ from gen.plug import Gramplet
from gen.ggettext import gettext as _
from gen.display.name import displayer as name_displayer
import gen.datehandler
-from gen.utils import get_birth_or_fallback, get_marriage_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_marriage_or_fallback
from gen.errors import WindowActiveError
import gtk
from gen.config import config
diff --git a/src/plugins/gramplet/pedigreegramplet.py b/src/plugins/gramplet/pedigreegramplet.py
index 45431a39b..b0b8113bc 100644
--- a/src/plugins/gramplet/pedigreegramplet.py
+++ b/src/plugins/gramplet/pedigreegramplet.py
@@ -38,7 +38,7 @@ from gen.ggettext import ngettext
from gen.display.name import displayer as name_displayer
import gen.datehandler
import gen
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/graph/gvfamilylines.py b/src/plugins/graph/gvfamilylines.py
index 8ca2524f0..5316b695a 100644
--- a/src/plugins/graph/gvfamilylines.py
+++ b/src/plugins/graph/gvfamilylines.py
@@ -60,7 +60,7 @@ from gen.plug.report import MenuReportOptions
from gen.plug.menu import (NumberOption, ColorOption, BooleanOption,
EnumeratedListOption, PersonListOption,
SurnameColorOption)
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gen.display.name import displayer as name_displayer
#------------------------------------------------------------------------
diff --git a/src/plugins/graph/gvhourglass.py b/src/plugins/graph/gvhourglass.py
index ff964911b..cb72abdd5 100644
--- a/src/plugins/graph/gvhourglass.py
+++ b/src/plugins/graph/gvhourglass.py
@@ -46,7 +46,7 @@ from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/graph/gvrelgraph.py b/src/plugins/graph/gvrelgraph.py
index b09042375..3435ae266 100644
--- a/src/plugins/graph/gvrelgraph.py
+++ b/src/plugins/graph/gvrelgraph.py
@@ -57,7 +57,7 @@ import gen.datehandler
import gen.lib
from gen.utils.file import media_path_full, find_file
from gui.thumbnails import get_thumbnail_path
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/lib/libformatting.py b/src/plugins/lib/libformatting.py
index b02f8c258..0534b726c 100644
--- a/src/plugins/lib/libformatting.py
+++ b/src/plugins/lib/libformatting.py
@@ -40,7 +40,7 @@ from cgi import escape
import gen.lib
import gen.datehandler
from gen.display.name import displayer as name_displayer
-from gen.utils import get_birth_or_fallback, get_death_or_fallback, get_marriage_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback, get_marriage_or_fallback
#-------------------------------------------------------------------------
#
diff --git a/src/plugins/lib/libsubstkeyword.py b/src/plugins/lib/libsubstkeyword.py
index 38ef0fb14..5266ad667 100644
--- a/src/plugins/lib/libsubstkeyword.py
+++ b/src/plugins/lib/libsubstkeyword.py
@@ -40,7 +40,7 @@ Mary Smith was born on 3/28/1923.
from gen.display.name import displayer as name_displayer
import gen.datehandler
import gen.lib
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/textreport/descendreport.py b/src/plugins/textreport/descendreport.py
index 8314038db..66ba86d66 100644
--- a/src/plugins/textreport/descendreport.py
+++ b/src/plugins/textreport/descendreport.py
@@ -53,7 +53,7 @@ from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
from gen.sort import Sort
-from gen.utils import (get_birth_or_fallback, get_death_or_fallback,
+from gen.utils.db import (get_birth_or_fallback, get_death_or_fallback,
get_marriage_or_fallback, get_divorce_or_fallback)
diff --git a/src/plugins/textreport/kinshipreport.py b/src/plugins/textreport/kinshipreport.py
index 1bdbc88c4..8e49b8b1c 100644
--- a/src/plugins/textreport/kinshipreport.py
+++ b/src/plugins/textreport/kinshipreport.py
@@ -49,7 +49,7 @@ from gen.plug.report import Report
from gen.plug.report import utils as ReportUtils
from gen.plug.report import MenuReportOptions
import gen.datehandler
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
#------------------------------------------------------------------------
#
diff --git a/src/plugins/view/geoevents.py b/src/plugins/view/geoevents.py
index b23917362..c8078b0ac 100644
--- a/src/plugins/view/geoevents.py
+++ b/src/plugins/view/geoevents.py
@@ -65,7 +65,6 @@ from gui.selectors.selectplace import SelectPlace
from gui.filters.sidebar import EventSidebarFilter
from gui.views.navigationview import NavigationView
from gui.views.bookmarks import EventBookmarks
-from Utils import navigation_label
from maps.geography import GeoGraphyView
#-------------------------------------------------------------------------
diff --git a/src/plugins/view/geofamily.py b/src/plugins/view/geofamily.py
index 69e464879..9bc89c8aa 100644
--- a/src/plugins/view/geofamily.py
+++ b/src/plugins/view/geofamily.py
@@ -65,7 +65,6 @@ from gui.selectors.selectplace import SelectPlace
from gui.filters.sidebar import FamilySidebarFilter
from gui.views.navigationview import NavigationView
from gui.views.bookmarks import FamilyBookmarks
-from Utils import navigation_label
from maps.geography import GeoGraphyView
#-------------------------------------------------------------------------
diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py
index 1a7a48ddf..bcdc1a94c 100644
--- a/src/plugins/view/geoperson.py
+++ b/src/plugins/view/geoperson.py
@@ -67,7 +67,6 @@ from gui.filters.sidebar import PersonSidebarFilter
from gui.views.navigationview import NavigationView
from gui.views.bookmarks import PersonBookmarks
import constants
-from Utils import navigation_label
from maps.geography import GeoGraphyView
#-------------------------------------------------------------------------
diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py
index 8204f6421..11e4654d2 100644
--- a/src/plugins/view/geoplaces.py
+++ b/src/plugins/view/geoplaces.py
@@ -65,7 +65,6 @@ from gui.selectors.selectplace import SelectPlace
from gui.filters.sidebar import PlaceSidebarFilter
from gui.views.navigationview import NavigationView
from gui.views.bookmarks import PlaceBookmarks
-from Utils import navigation_label
from maps.geography import GeoGraphyView
#-------------------------------------------------------------------------
diff --git a/src/plugins/view/relview.py b/src/plugins/view/relview.py
index 17e7a0105..334b0eaca 100644
--- a/src/plugins/view/relview.py
+++ b/src/plugins/view/relview.py
@@ -64,7 +64,7 @@ from gen.errors import WindowActiveError
from gui.views.bookmarks import PersonBookmarks
import const
from gen.utils.name import preset_name
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gui.listmodel import ListModel
from gui.managedwindow import ManagedWindow
from gui.glade import Glade
diff --git a/src/webapp/utils.py b/src/webapp/utils.py
index c2cbda0ca..abe3111a9 100644
--- a/src/webapp/utils.py
+++ b/src/webapp/utils.py
@@ -62,7 +62,7 @@ from gen.dbstate import DbState
from gen.datehandler import displayer, parser
from gen.lib.date import Date as GDate, Today
import gen.lib
-from gen.utils import get_birth_or_fallback, get_death_or_fallback
+from gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gen.plug import BasePluginManager
from cli.grampscli import CLIManager