コード例 #1
0
ファイル: index.py プロジェクト: jean/grokcore.catalog
 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
コード例 #2
0
ファイル: index.py プロジェクト: gyst/grokcore.catalog
 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
コード例 #3
0
ファイル: index.py プロジェクト: jean/grokcore.catalog
 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
コード例 #4
0
ファイル: index.py プロジェクト: gyst/grokcore.catalog
 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
コード例 #5
0
 def check(self, frame):
     return util.frame_is_class(frame) or util.frame_is_module(frame)
コード例 #6
0
 def check(self, frame):
     return util.frame_is_class(frame) and not is_fake_module(frame)