Refactor Core class to find and include external notifiers and providers

The Core class in core.py has been refactored to include a new method find_external_notifiers() which is currently returning an empty list, and find_external_providers() which is also returning an empty list. Both methods are placeholders for future implementation using entry points. The find_notifiers() and find_providers() methods have been updated to include the results of the new methods.
This commit is contained in:
Kumi 2023-09-06 13:47:21 +02:00
parent 28f1374233
commit 81dbed9ca2
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -70,8 +70,12 @@ class Core:
return notifiers
def find_external_notifiers(self):
# TODO: Implement external notifiers using entry points
return []
def find_notifiers(self):
return self.find_core_notifiers()
return self.find_core_notifiers() + self.find_external_notifiers()
def find_core_providers(self):
logging.debug("Finding core tracking providers")
@ -113,8 +117,12 @@ class Core:
return providers
def find_external_providers(self):
# TODO: Implement external providers using entry points
return []
def find_providers(self):
return self.find_core_providers()
return self.find_core_providers() + self.find_external_providers()
def query_provider(self, tracking_number: str, carrier: str) -> list:
logging.debug(f"Querying provider for {tracking_number} with carrier {carrier}")