From 6b858a2385635e8a32f960c428deadae642fc88e Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Mon, 25 May 2009 19:19:51 +0000 Subject: [PATCH] Bug 3011: fix problem with new-style class and special method names svn: r12570 --- src/GrampsDbUtils/_GedcomUtils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/GrampsDbUtils/_GedcomUtils.py b/src/GrampsDbUtils/_GedcomUtils.py index dcc90578a..27e805cb5 100644 --- a/src/GrampsDbUtils/_GedcomUtils.py +++ b/src/GrampsDbUtils/_GedcomUtils.py @@ -164,14 +164,17 @@ class IdFinder(object): class IdMapper(object): def __init__(self, trans, find_next, translate): - if translate: - self.__getitem__ = self.get_translate - else: - self.__getitem__ = self.no_translate + self.translate = translate self.trans = trans self.find_next = find_next self.swap = {} + def __getitem__(self, gid): + if self.translate: + return self.get_translate(gid) + else: + return self.no_translate(gid) + def clean(self, gid): temp = gid.strip() if len(temp) > 1 and temp[0] == '@' and temp[-1] == '@':