Load built-in plugins by default
This commit is contained in:
parent
2192b5d29b
commit
3475dc7228
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
import datetime
|
import datetime
|
||||||
import logging.config
|
import logging.config
|
||||||
import sys
|
import sys
|
||||||
|
@ -91,11 +92,21 @@ FUNKWHALE_PLUGINS_PATH = env(
|
||||||
Path to a directory containing Funkwhale plugins. These will be imported at runtime.
|
Path to a directory containing Funkwhale plugins. These will be imported at runtime.
|
||||||
"""
|
"""
|
||||||
sys.path.append(FUNKWHALE_PLUGINS_PATH)
|
sys.path.append(FUNKWHALE_PLUGINS_PATH)
|
||||||
|
CORE_PLUGINS = [
|
||||||
|
"funkwhale_api.contrib.scrobbler",
|
||||||
|
]
|
||||||
|
|
||||||
|
LOAD_CORE_PLUGINS = env.bool("FUNKWHALE_LOAD_CORE_PLUGINS", default=True)
|
||||||
PLUGINS = [p for p in env.list("FUNKWHALE_PLUGINS", default=[]) if p]
|
PLUGINS = [p for p in env.list("FUNKWHALE_PLUGINS", default=[]) if p]
|
||||||
"""
|
"""
|
||||||
List of Funkwhale plugins to load.
|
List of Funkwhale plugins to load.
|
||||||
"""
|
"""
|
||||||
|
if LOAD_CORE_PLUGINS:
|
||||||
|
PLUGINS = CORE_PLUGINS + PLUGINS
|
||||||
|
|
||||||
|
# Remove duplicates
|
||||||
|
PLUGINS = list(OrderedDict.fromkeys(PLUGINS))
|
||||||
|
|
||||||
if PLUGINS:
|
if PLUGINS:
|
||||||
logger.info("Running with the following plugins enabled: %s", ", ".join(PLUGINS))
|
logger.info("Running with the following plugins enabled: %s", ", ".join(PLUGINS))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue