'Get excluded_tags from opts.exclusion_rules.
Parse opts.exclusion_rules for tags to be excluded, return list.
Log books that will be excluded by excluded_tags.
Inputs:
opts.excluded_tags (tuples): exclusion rules
Return:
excluded_tags (list): excluded tags'

def get_excluded_tags(self):

    excluded_tags = []
    for rule in self.opts.exclusion_rules:
        if (rule[1] == _('Tags')):
            excluded_tags.extend(rule[2].split(','))
    excluded_tags = list(set(excluded_tags))
    if excluded_tags:
        self.opts.log.info('    Books    excluded    by    tag:')
        data = self.db.get_data_as_dict(ids=self.opts.ids)
        for record in data:
            matched = list((set(record['tags']) & set(excluded_tags)))
            if matched:
                for rule in self.opts.exclusion_rules:
                    if ((rule[1] == _('Tags')) and (rule[2] == str(matched[0]))):
                        self.opts.log.info(("        -    '%s'    by    %s    (Exclusion    rule    '%s')" % (record['title'], record['authors'][0], rule[0])))
    return excluded_tags
