def sort_reference_time(event): if not isinstance(event, eva.event.ProductstatusResourceEvent): return eva.epoch_with_timezone() self.instantiate_productstatus_data(event) if event.data._collection._resource_name != 'datainstance': return eva.epoch_with_timezone() return event.data.data.productinstance.reference_time
def __init__(self, host, port): self.server = HTTPServer((host, port), HTTPRequestHandler) self.server.ok = True self.skip_heartbeat = False self.heartbeat_interval = 0 self.heartbeat_timeout = 0 self.heartbeat_timestamp = eva.epoch_with_timezone()
def reference_time_threshold(self): """! @brief Return a DateTime object which represent the oldest reference time that will be processed. """ if self.reference_time_threshold_delta is not None: return eva.now_with_timezone() - self.reference_time_threshold_delta return eva.epoch_with_timezone()
def test_epoch_with_timezone(self): dt = eva.epoch_with_timezone() self.assertEqual(dt.tzinfo.tzname(None), 'UTC') self.assertEqual(dt.timestamp(), 0)