mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 9 #118
This commit is contained in:
+5
-5
@@ -39,7 +39,7 @@ if ALLOW_SPOTTING:
|
||||
def get_spot_provider_from_config(config_providers_entry):
|
||||
"""Utility method to get a spot provider based on the class specified in its config entry."""
|
||||
|
||||
module = importlib.import_module('spotproviders.' + config_providers_entry["class"].lower())
|
||||
module = importlib.import_module('providers.spot.' + config_providers_entry["class"].lower())
|
||||
provider_class = getattr(module, config_providers_entry["class"])
|
||||
return provider_class(config_providers_entry)
|
||||
|
||||
@@ -47,7 +47,7 @@ def get_spot_provider_from_config(config_providers_entry):
|
||||
def get_alert_provider_from_config(config_providers_entry):
|
||||
"""Utility method to get an alert provider based on the class specified in its config entry."""
|
||||
|
||||
module = importlib.import_module('alertproviders.' + config_providers_entry["class"].lower())
|
||||
module = importlib.import_module('providers.alert.' + config_providers_entry["class"].lower())
|
||||
provider_class = getattr(module, config_providers_entry["class"])
|
||||
return provider_class(config_providers_entry)
|
||||
|
||||
@@ -55,7 +55,7 @@ def get_alert_provider_from_config(config_providers_entry):
|
||||
def get_solar_conditions_provider_from_config(config_providers_entry):
|
||||
"""Utility method to get a solar conditions provider based on the class specified in its config entry."""
|
||||
|
||||
module = importlib.import_module('solarconditionsproviders.' + config_providers_entry["class"].lower())
|
||||
module = importlib.import_module('providers.solarconditions.' + config_providers_entry["class"].lower())
|
||||
provider_class = getattr(module, config_providers_entry["class"])
|
||||
return provider_class(config_providers_entry)
|
||||
|
||||
@@ -63,7 +63,7 @@ def get_solar_conditions_provider_from_config(config_providers_entry):
|
||||
def get_static_data_provider_from_config(config_providers_entry):
|
||||
"""Utility method to get a static reference data provider based on the class specified in its config entry."""
|
||||
|
||||
module = importlib.import_module('staticdataproviders.' + config_providers_entry["class"].lower())
|
||||
module = importlib.import_module('providers.staticdata.' + config_providers_entry["class"].lower())
|
||||
provider_class = getattr(module, config_providers_entry["class"])
|
||||
return provider_class(config_providers_entry)
|
||||
|
||||
@@ -71,6 +71,6 @@ def get_static_data_provider_from_config(config_providers_entry):
|
||||
def get_sig_ref_data_provider_from_config(config_providers_entry):
|
||||
"""Utility method to get a SIG reference data provider based on the class specified in its config entry."""
|
||||
|
||||
module = importlib.import_module('sigrefdataproviders.' + config_providers_entry["class"].lower())
|
||||
module = importlib.import_module('providers.sigrefdata.' + config_providers_entry["class"].lower())
|
||||
provider_class = getattr(module, config_providers_entry["class"])
|
||||
return provider_class(config_providers_entry)
|
||||
|
||||
Reference in New Issue
Block a user