Rename loader to load_plugin
This commit is contained in:
parent
a8a1fc470b
commit
0cd95f8a39
@ -35,7 +35,7 @@ INTERNAL_TYPES = ("none", "remote_user", "http_x_remote_user", "htpasswd")
|
||||
|
||||
def load(configuration):
|
||||
"""Load the authentication module chosen in configuration."""
|
||||
return utils.loader(INTERNAL_TYPES, "auth", "Auth", configuration)
|
||||
return utils.load_plugin(INTERNAL_TYPES, "auth", "Auth", configuration)
|
||||
|
||||
|
||||
class BaseAuth:
|
||||
|
@ -37,7 +37,7 @@ INTERNAL_TYPES = ("authenticated", "owner_write", "owner_only", "from_file")
|
||||
|
||||
def load(configuration):
|
||||
"""Load the rights module chosen in configuration."""
|
||||
return utils.loader(INTERNAL_TYPES, "rights", "Rights", configuration)
|
||||
return utils.load_plugin(INTERNAL_TYPES, "rights", "Rights", configuration)
|
||||
|
||||
|
||||
def intersect_permissions(a, b="RrWw"):
|
||||
|
@ -42,7 +42,8 @@ CACHE_VERSION = (";".join(pkg_resources.get_distribution(pkg).version
|
||||
|
||||
def load(configuration):
|
||||
"""Load the storage module chosen in configuration."""
|
||||
return utils.loader(INTERNAL_TYPES, "storage", "Storage", configuration)
|
||||
return utils.load_plugin(
|
||||
INTERNAL_TYPES, "storage", "Storage", configuration)
|
||||
|
||||
|
||||
class ComponentExistsError(ValueError):
|
||||
|
@ -21,7 +21,7 @@ from importlib import import_module
|
||||
from radicale.log import logger
|
||||
|
||||
|
||||
def loader(internal_types, module_name, class_name, configuration):
|
||||
def load_plugin(internal_types, module_name, class_name, configuration):
|
||||
type_ = configuration.get(module_name, "type")
|
||||
if type_ in internal_types:
|
||||
module = "radicale.%s.%s" % (module_name, type_)
|
||||
|
@ -28,7 +28,7 @@ INTERNAL_TYPES = ("none", "internal")
|
||||
|
||||
def load(configuration):
|
||||
"""Load the web module chosen in configuration."""
|
||||
return utils.loader(INTERNAL_TYPES, "web", "Web", configuration)
|
||||
return utils.load_plugin(INTERNAL_TYPES, "web", "Web", configuration)
|
||||
|
||||
|
||||
class BaseWeb:
|
||||
|
Loading…
Reference in New Issue
Block a user