def get_next_step(self, logger: Logger, dt: datetime, channel: "Channel") -> Step: if self == channel.station_at: return Step.none() return Step(start=int(dt.timestamp()), end=int(dt.timestamp()), broadcast=Broadcast.empty(self))
def get_next_step(self, logger: Logger, dt: datetime, channel: "Channel") -> Step: if self == channel.station_at(dt): return Step.none() return Step(start=int(dt.timestamp()), end=int(dt.timestamp()), broadcast=Broadcast(title="La Playlist Pycolore", type=BroadcastType.PROGRAMME, station=self.station_info, thumbnail_src=self.station_thumbnail))
def test_update_info_unpacking(): should_notify, step = UpdateInfo(should_notify_update=True, step=Step.none()) assert (should_notify, step) == (True, Step.none())
def __init__(self): super().__init__() self._current_show_data = {"show_end": datetime.now().timestamp()} self.current_step = Step.none()
def _post_get_hook_step(self, data: dict): try: return Step(**data) except (TypeError, ValidationError) as err: return Step.none()