'Get the scene exceptions for all or a given show'

def run(self):

    cache_db_con = db.DBConnection(u'cache.db', row_type=u'dict')
    if (self.indexerid is None):
        sql_results = cache_db_con.select(u"SELECT    show_name,    indexer_id    AS    'indexerid'    FROM    scene_exceptions")
        scene_exceptions = {}
        for row in sql_results:
            indexerid = row['indexerid']
            if (indexerid not in scene_exceptions):
                scene_exceptions[indexerid] = []
            scene_exceptions[indexerid].append(row['show_name'])
    else:
        show_obj = Show.find(sickbeard.showList, int(self.indexerid))
        if (not show_obj):
            return _responds(RESULT_FAILURE, msg=u'Show    not    found')
        sql_results = cache_db_con.select(u"SELECT    show_name,    indexer_id    AS    'indexerid'    FROM    scene_exceptions    WHERE    indexer_id    =    ?", [self.indexerid])
        scene_exceptions = []
        for row in sql_results:
            scene_exceptions.append(row['show_name'])
    return _responds(RESULT_SUCCESS, scene_exceptions)
