'Perform one-time plugin setup.'

def __init__(self, name=None):

    self.name = (name or self.__module__.split('.')[(-1)])
    self.config = beets.config[self.name]
    if (not self.template_funcs):
        self.template_funcs = {}
    if (not self.template_fields):
        self.template_fields = {}
    if (not self.album_template_fields):
        self.album_template_fields = {}
    self.import_stages = []
    self._log = log.getChild(self.name)
    self._log.setLevel(logging.NOTSET)
    if (not any((isinstance(f, PluginLogFilter) for f in self._log.filters))):
        self._log.addFilter(PluginLogFilter(self))
