base.py 439 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_id, data):
  10. self.project = project
  11. self.release_id = release_id
  12. self.data = data
  13. def run(self):
  14. if self.should_run():
  15. self.transform()