def check_json_blackout(listing): blackout_dmas = list() for blackout in listing['blackouts']: if blackout['type'] == 'dma': for dma in blackout['detail']: blackout_dmas.append(dma) user_dma = player_config.get_dma() for blackout_dma in blackout_dmas: if blackout_dma == user_dma: return True return False
def check_blackout(self, item): blackouts = item.findall('.//blackouts/blackoutsItem/detail/detailItem') blackout_type = item.find('.//blackouts/blackoutsItem/type') if blackout_type is not None and not blackout_type.text == 'dma': return False user_dma = player_config.get_dma() if blackouts is not None: for blackout in blackouts: if blackout.text == user_dma: return True return False
def check_blackout(self, item): xbmc.log(TAG + 'check blackout %s' % ET.tostring(item), xbmc.LOGDEBUG) blackouts = item.findall('.//blackouts/blackoutsItem/detail/detailItem') xbmc.log(TAG + '%s' % blackouts, xbmc.LOGDEBUG) blackout_type = item.find('.//blackouts/blackoutsItem/type') if blackout_type is not None and not blackout_type.text == 'dma': return False user_dma = player_config.get_dma() if blackouts is not None: for blackout in blackouts: if blackout.text == user_dma: return True return False