コード例 #1
0
ファイル: scope.py プロジェクト: rekall-innovations/efilter
    def getmembers_static(cls):
        """Gets members (vars) from all scopes using ONLY static information.

        You most likely want to use ScopeStack.getmembers instead.

        Returns:
            Set of available vars.

        Raises:
            NotImplementedError if any scope fails to implement 'getmembers'.
        """
        names = set()
        for scope in cls.scopes:
            names.update(structured.getmembers_static(scope))

        return names
コード例 #2
0
ファイル: scope.py プロジェクト: Onager/dotty
    def getmembers_static(cls):
        """Gets members (vars) from all scopes using ONLY static information.

        You most likely want to use ScopeStack.getmembers instead.

        Returns:
            Set of available vars.

        Raises:
            NotImplementedError if any scope fails to implement 'getmembers'.
        """
        names = set()
        for scope in cls.scopes:
            names.update(structured.getmembers_static(scope))

        return names
コード例 #3
0
ファイル: scope.py プロジェクト: rekall-innovations/efilter
    def getmembers(self):
        """Gets members (vars) from all scopes, using both runtime and static.

        This method will attempt both static and runtime getmembers. This is the
        recommended way of getting available members.

        Returns:
            Set of available vars.

        Raises:
            NotImplementedError if any scope fails to implement 'getmembers'.
        """
        names = set()
        for scope in self.scopes:
            if isinstance(scope, type):
                names.update(structured.getmembers_static(scope))
            else:
                names.update(structured.getmembers_runtime(scope))

        return names
コード例 #4
0
ファイル: scope.py プロジェクト: Onager/dotty
    def getmembers(self):
        """Gets members (vars) from all scopes, using both runtime and static.

        This method will attempt both static and runtime getmembers. This is the
        recommended way of getting available members.

        Returns:
            Set of available vars.

        Raises:
            NotImplementedError if any scope fails to implement 'getmembers'.
        """
        names = set()
        for scope in self.scopes:
            if isinstance(scope, type):
                names.update(structured.getmembers_static(scope))
            else:
                names.update(structured.getmembers_runtime(scope))

        return names