base.py 430 B

1234567891011121314151617181920
  1. from abc import ABC, abstractmethod
  2. class EventProcessorBase(ABC):
  3. @abstractmethod
  4. def should_run(self) -> bool:
  5. return False
  6. @abstractmethod
  7. def transform(self):
  8. return self.data
  9. def __init__(self, project, release, data):
  10. self.project = project
  11. self.release = release
  12. self.data = data
  13. def run(self):
  14. if self.should_run():
  15. self.transform()