From ac95f805ace3780386f683f16cf89e7d172e65a4 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 17 Nov 2009 23:28:04 +0000 Subject: [PATCH] Workaround to avoid importing all of ReportUtils and gtk svn: r13613 --- src/Simple/_SimpleAccess.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Simple/_SimpleAccess.py b/src/Simple/_SimpleAccess.py index 47b544ebf..ba9de8a9b 100644 --- a/src/Simple/_SimpleAccess.py +++ b/src/Simple/_SimpleAccess.py @@ -29,10 +29,23 @@ import DateHandler import Utils from BasicUtils import name_displayer -from ReportBase import ReportUtils from gen.lib import EventType import config +#------------------------------------------------------------------------- +# +# Local functions +# +#------------------------------------------------------------------------- +# FIXME: this is copied from ReportBase._ReportUtils to avoid the gtk +# imports. +def place_name(db, place_handle): + if place_handle: + place = db.get_place_from_handle(place_handle).get_title() + else: + place = "" + return unicode(place) + class SimpleAccess(object): """ Provide a simplified database access system. This system has been designed to @@ -298,7 +311,7 @@ class SimpleAccess(object): if event_handle: event = self.dbase.get_event_from_handle(event_handle) place_handle = event.get_place_handle() - return ReportUtils.place_name(self.dbase, place_handle) + return place_name(self.dbase, place_handle) return u'' def spouse(self, person): @@ -380,7 +393,7 @@ class SimpleAccess(object): if event.type == EventType.MARRIAGE ] if events: place_handle = events[0].get_place_handle() - return ReportUtils.place_name(self.dbase, place_handle) + return place_name(self.dbase, place_handle) return u'' def marriage_date(self, person): @@ -567,7 +580,7 @@ class SimpleAccess(object): if event: place_handle = event.get_place_handle() - return ReportUtils.place_name(self.dbase, place_handle) + return place_name(self.dbase, place_handle) else: return u''