'Setup plugin from config options'

def setup(self):

    if self.config['auto']:
        self.import_stages = [self.imported]
    self._genre_cache = {}
    self.whitelist = set()
    wl_filename = self.config['whitelist'].get()
    if (wl_filename in (True, '')):
        wl_filename = WHITELIST
    if wl_filename:
        wl_filename = normpath(wl_filename)
        with open(wl_filename, 'rb') as f:
            for line in f:
                line = line.decode('utf-8').strip().lower()
                if (line and (not line.startswith(u'#'))):
                    self.whitelist.add(line)
    self.c14n_branches = []
    c14n_filename = self.config['canonical'].get()
    if (c14n_filename in (True, '')):
        c14n_filename = C14N_TREE
    if c14n_filename:
        c14n_filename = normpath(c14n_filename)
        with codecs.open(c14n_filename, 'r', encoding='utf-8') as f:
            genres_tree = yaml.load(f)
        flatten_tree(genres_tree, [], self.c14n_branches)
