parent
7b010266bd
commit
919f949d17
|
@ -68,24 +68,30 @@ from ._version import __version__
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
CURRENT_MODULE = sys.modules[__name__]
|
||||
|
||||
current_module = sys.modules[__name__]
|
||||
|
||||
def load_backend(name: str) -> object | None:
|
||||
try:
|
||||
imported_module = importlib.import_module(f'{__name__}.{name}')
|
||||
current_module.setmember(name, imported_module)
|
||||
CURRENT_MODULE.setmember(name, imported_module)
|
||||
except Exception:
|
||||
logger.exception(
|
||||
'Backend %s could not be imported? Are all module dependencies installed?',
|
||||
'Backend "%s" could not be imported. Are all module dependencies installed?',
|
||||
name,
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
# Import modules
|
||||
|
||||
backend_modules = ['defi_kraken', 'defi_kucoin', 'investbank_nordnet', 'defi_partisia_blockchain']
|
||||
backend_modules = [
|
||||
'defi_kraken',
|
||||
'defi_kucoin',
|
||||
'investbank_nordnet',
|
||||
'defi_partisia_blockchain',
|
||||
]
|
||||
for m in backend_modules:
|
||||
load_backend(m)
|
||||
del m
|
||||
del backend_modules, current_module
|
||||
del backend_modules, CURRENT_MODULE
|
||||
|
|
Loading…
Reference in New Issue
Block a user