Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
def test_update_info_unpacking():
    should_notify, step = UpdateInfo(should_notify_update=True, step=Step.none())
    assert (should_notify, step) == (True, Step.none())
Exemplo n.º 4
0
 def __init__(self):
     super().__init__()
     self._current_show_data = {"show_end": datetime.now().timestamp()}
     self.current_step = Step.none()
Exemplo n.º 5
0
 def _post_get_hook_step(self, data: dict):
     try:
         return Step(**data)
     except (TypeError, ValidationError) as err:
         return Step.none()