def _load_plugins(config): """Load the plugins specified in the configuration. """ paths = config['pluginpath'].get(confit.StrSeq(split=False)) paths = map(util.normpath, paths) import beetsplug beetsplug.__path__ = paths + beetsplug.__path__ # For backwards compatibility. sys.path += paths plugins.load_plugins(config['plugins'].as_str_seq()) plugins.send("pluginload") return plugins
def _load_plugins(config): """Load the plugins specified in the configuration. """ paths = config['pluginpath'].get(confit.StrSeq(split=False)) paths = [util.normpath(p) for p in paths] log.debug(u'plugin paths: {0}', util.displayable_path(paths)) # On Python 3, the search paths need to be unicode. paths = [util.py3_path(p) for p in paths] # Extend the `beetsplug` package to include the plugin paths. import beetsplug beetsplug.__path__ = paths + beetsplug.__path__ # For backwards compatibility, also support plugin paths that # *contain* a `beetsplug` package. sys.path += paths plugins.load_plugins(config['plugins'].as_str_seq()) plugins.send("pluginload") return plugins