def __init__(self, *args, **kw): frame = sys._getframe(1) if not frame_is_class(frame): raise GrokImportError( "%r can only be instantiated on class level." % self.__class__) # Store any extra parameters to pass to index later. self._args = args self._kw = kw
def __init__(self, *args, **kw): frame = sys._getframe(1) if not frame_is_class(frame): raise GrokImportError( "%r can only be instantiated on class level." % self.__class__) if not IAttributeIndex.implementedBy(self.index_class): raise GrokImportError( "%r does not implement IAttributeIndex." % self.__class__) # Store any extra parameters to pass to index later. self._args = args self._attribute = kw.pop('attribute', None) self._kw = kw
def check(self, frame): return util.frame_is_class(frame) or util.frame_is_module(frame)
def check(self, frame): return util.frame_is_class(frame) and not is_fake_module(frame)