Bug 3011: fix problem with new-style class and special method names
svn: r12569
This commit is contained in:
parent
eb4ac772d9
commit
35326c7b47
@ -164,14 +164,17 @@ class IdFinder(object):
|
|||||||
class IdMapper(object):
|
class IdMapper(object):
|
||||||
|
|
||||||
def __init__(self, trans, find_next, translate):
|
def __init__(self, trans, find_next, translate):
|
||||||
if translate:
|
self.translate = translate
|
||||||
self.__getitem__ = self.get_translate
|
|
||||||
else:
|
|
||||||
self.__getitem__ = self.no_translate
|
|
||||||
self.trans = trans
|
self.trans = trans
|
||||||
self.find_next = find_next
|
self.find_next = find_next
|
||||||
self.swap = {}
|
self.swap = {}
|
||||||
|
|
||||||
|
def __getitem__(self, gid):
|
||||||
|
if self.translate:
|
||||||
|
return self.get_translate(gid)
|
||||||
|
else:
|
||||||
|
return self.no_translate(gid)
|
||||||
|
|
||||||
def clean(self, gid):
|
def clean(self, gid):
|
||||||
temp = gid.strip()
|
temp = gid.strip()
|
||||||
if len(temp) > 1 and temp[0] == '@' and temp[-1] == '@':
|
if len(temp) > 1 and temp[0] == '@' and temp[-1] == '@':
|
||||||
|
Loading…
Reference in New Issue
Block a user