From 9151ab3ba601822a8b24ac684694b3038468af13 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 10 Apr 2022 13:53:28 +0100 Subject: [PATCH] Create settings options for different sinks --- handler/sinks/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/handler/sinks/__init__.py b/handler/sinks/__init__.py index 6efa00d..0f8b0eb 100644 --- a/handler/sinks/__init__.py +++ b/handler/sinks/__init__.py @@ -3,7 +3,7 @@ # from json import dumps # Project imports -# from settings import settings +from settings import settings import sinks.fidor import sinks.nordigen import sinks.truelayer @@ -28,9 +28,12 @@ class Sinks(util.Base): We NEED the other libraries, and we initialise fast, so don't make any race conditions by relying on something that might not be there. """ - self.fidor = sinks.fidor.Fidor() - self.nordigen = sinks.nordigen.Nordigen(self) - self.truelayer = sinks.truelayer.TrueLayer(self) + if settings.Fidor.enabled == "1": + self.fidor = sinks.fidor.Fidor() + if settings.Nordigen.enabled == "1": + self.nordigen = sinks.nordigen.Nordigen(self) + if settings.TrueLayer.enabled == "1": + self.truelayer = sinks.truelayer.TrueLayer(self) # setattr(self.truelayer, "sinks", self) def got_transactions(self, subclass, account_id, transactions):