-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added groupme integration and refactored other integrations
- Loading branch information
1 parent
b4cc276
commit 1cbf148
Showing
8 changed files
with
448 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from abc import ABC, abstractmethod | ||
from pathlib import Path | ||
from typing import Any | ||
|
||
from utilities.logger import get_logger | ||
|
||
logger = get_logger(__name__, propagate=False) | ||
|
||
|
||
class BaseIntegration(ABC): | ||
|
||
def __init__(self, integration_type: str): | ||
self.integration_type_str: str = integration_type.replace(" ", "_").lower() | ||
self.integration_type_title: str = integration_type.replace("_", " ").title() | ||
|
||
logger.debug(f"Initializing {self.integration_type_title} integration.") | ||
|
||
self.client: Any = None | ||
|
||
logger.debug(f"Authenticating with {self.integration_type_title}...") | ||
self._authenticate() | ||
logger.debug(f"...{self.integration_type_title} authenticated.") | ||
|
||
@abstractmethod | ||
def _authenticate(self) -> None: | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def upload_file(self, file_path: Path) -> Any: | ||
raise NotImplementedError |
Oops, something went wrong.