vregistry.py
changeset 2820 66b31686d92b
parent 2788 8d3dbe577d3a
child 2821 526f44213b70
equal deleted inserted replaced
2819:b864288fd316 2820:66b31686d92b
    76         assert oid
    76         assert oid
    77         if clear:
    77         if clear:
    78             appobjects = self[oid] =  []
    78             appobjects = self[oid] =  []
    79         else:
    79         else:
    80             appobjects = self.setdefault(oid, [])
    80             appobjects = self.setdefault(oid, [])
    81         # registered() is technically a classmethod but is not declared
    81         appobject = obj.__registered__(self)
    82         # as such because we need to compose registered in some cases
       
    83         appobject = obj.registered.im_func(obj, self)
       
    84         assert not appobject in appobjects, \
    82         assert not appobject in appobjects, \
    85                'object %s is already registered' % appobject
    83                'object %s is already registered' % appobject
    86         assert callable(appobject.__select__), appobject
    84         assert callable(appobject.__select__), appobject
    87         appobjects.append(appobject)
    85         appobjects.append(appobject)
    88 
    86