original_docstring: Load channel data into channel property.
  
          This method fetches the channel list from ``/as/services`` endpoint and
          loads the fetched channels into this ``EPG`` object. It then
          concurrently fetches each channel's detail info from
          ``/as/services/details/<sid>`` and adds that to the channels.
  
          Returns:
              None
  
          
docstring: Load channel data into channel property.
docstring_tokens: Load channel data into channel property .
code: async def load_skyq_channel_data(self) -> None:
          """Load channel data into channel property.
  
          This method fetches the channel list from ``/as/services`` endpoint and
          loads the fetched channels into this ``EPG`` object. It then
          concurrently fetches each channel's detail info from
          ``/as/services/details/<sid>`` and adds that to the channels.
  
          Returns:
              None
  
          """
          async def _load_chan_detail(detail_url: str, channel: Channel) -> None:
              """Async function to fetch the details of each channel."""
              LOGGER.debug(f'Fetching channel details from {detail_url}')
              detail_payload_json = await sess.get(detail_url)
              LOGGER.debug(f'Got channel details from {detail_url}')
              detail_payload = detail_payload_json.json()
              LOGGER.debug(f'Parsed JSON from {detail_url}')
              channel.load_skyq_detail_data(detail_payload)
              LOGGER.debug(f'Merged {detail_url} into {channel}...')
              self._channels.append(channel)
              LOGGER.debug(f'Added {channel} to EPG')
  
          url = f'http://{self.host}:{self.rest_port}{REST_SERVICES_URL}'
          LOGGER.debug(f'Fetching channel list from {url}')
          sess = asks.Session(connections=50)
          LOGGER.debug(f'About to fetch channel list from sky box.')
          chan_payload_json = await sess.get(url)
          LOGGER.debug(f'Got channel list from sky box.')
          chan_payload = chan_payload_json.json()
          LOGGER.debug(f'Parsed channel list JSON payload.')
  
          with trio.move_on_after(90): # 90 sec timeout  #TODO parametrise this.
              async with trio.open_nursery() as nursery:
                  LOGGER.debug('Started nursery to collect channel details.')
                  for single_channel_payload in chan_payload['services']:
                      LOGGER.debug(f'Processing {single_channel_payload}')
                      channel = channel_from_skyq_service(single_channel_payload)
                      sid = channel.sid
                      detail_url = f'http://{self.host}:{self.rest_port}' + \
                          f'{REST_SERVICE_DETAIL_URL_PREFIX}{sid}'
                      nursery.start_soon(_load_chan_detail, detail_url, channel)
code_tokens: async def load_skyq_channel_data ( self ) -> None : async def _load_chan_detail ( detail_url : str , channel : Channel ) -> None : """Async function to fetch the details of each channel.""" LOGGER . debug ( f'Fetching channel details from {detail_url}' ) detail_payload_json = await sess . get ( detail_url ) LOGGER . debug ( f'Got channel details from {detail_url}' ) detail_payload = detail_payload_json . json ( ) LOGGER . debug ( f'Parsed JSON from {detail_url}' ) channel . load_skyq_detail_data ( detail_payload ) LOGGER . debug ( f'Merged {detail_url} into {channel}...' ) self . _channels . append ( channel ) LOGGER . debug ( f'Added {channel} to EPG' ) url = f'http://{self.host}:{self.rest_port}{REST_SERVICES_URL}' LOGGER . debug ( f'Fetching channel list from {url}' ) sess = asks . Session ( connections = 50 ) LOGGER . debug ( f'About to fetch channel list from sky box.' ) chan_payload_json = await sess . get ( url ) LOGGER . debug ( f'Got channel list from sky box.' ) chan_payload = chan_payload_json . json ( ) LOGGER . debug ( f'Parsed channel list JSON payload.' ) with trio . move_on_after ( 90 ) : async with trio . open_nursery ( ) as nursery : LOGGER . debug ( 'Started nursery to collect channel details.' ) for single_channel_payload in chan_payload [ 'services' ] : LOGGER . debug ( f'Processing {single_channel_payload}' ) channel = channel_from_skyq_service ( single_channel_payload ) sid = channel . sid detail_url = f'http://{self.host}:{self.rest_port}' + f'{REST_SERVICE_DETAIL_URL_PREFIX}{sid}' nursery . start_soon ( _load_chan_detail , detail_url , channel )
short_docstring: Load channel data into channel property.
short_docstring_tokens: Load channel data into channel property .
comment: """Load channel data into channel property.
  
          This method fetches the channel list from ``/as/services`` endpoint and
          loads the fetched channels into this ``EPG`` object. It then
          concurrently fetches each channel's detail info from
          ``/as/services/details/<sid>`` and adds that to the channels.
  
          Returns:
              None
  
          """$SEP$"""Async function to fetch the details of each channel."""$SEP$# 90 sec timeout  #TODO parametrise this.