Event.py 624 B

12345678910111213141516171819202122232425
  1. class Event(object):
  2. """
  3. This Class is representing an Event which is raised by when the System at some defined time.
  4. .. note:: Events are based on the system crontab
  5. """
  6. def __init__(self, period):
  7. self.period = period
  8. def __str__(self):
  9. return "%s: period: %s" % (self.__class__.__name__,
  10. self.period)
  11. def serialize(self):
  12. """
  13. This method allows to serialize in a proper way this object
  14. :return: A dict of name / period
  15. :rtype: Dict
  16. """
  17. return {
  18. 'event': self.period
  19. }