project/analysis/analyzers/render/__init__.py

18 lines
393 B
Python

from typing import List
from .. import Result
class Render:
result_types = []
def render(self, results: List[Result], name=None) -> [str]:
raise NotImplementedError()
def filter(self, results: List[Result]):
if len(self.result_types) == 0:
return results
return filter(self.__filter__, results)
def __filter__(self, obj: Result):
return obj.analysis() in self.result_types