Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
 def check(self, frame):
     return util.frame_is_class(frame) or util.frame_is_module(frame)
Esempio n. 6
0
 def check(self, frame):
     return util.frame_is_class(frame) and not is_fake_module(frame)