aboutsummaryrefslogtreecommitdiffstats
path: root/database/base_database.py
diff options
context:
space:
mode:
Diffstat (limited to 'database/base_database.py')
-rw-r--r--database/base_database.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/database/base_database.py b/database/base_database.py
new file mode 100644
index 0000000..6b03755
--- /dev/null
+++ b/database/base_database.py
@@ -0,0 +1,40 @@
+from abc import ABC, abstractmethod
+
+class BaseDatabase(ABC):
+
+ @abstractmethod
+ def close(self):
+ pass
+
+ @abstractmethod
+ def add_new_wac_entry(self, key: str, is_news: bool, post_type: str):
+ pass
+
+ @abstractmethod
+ def add_new_translation(self, key: str, source_lang: str,
+ target_lang: str, source_txt: str, result_txt: str):
+ pass
+
+ @abstractmethod
+ def add_new_summary(self, key: str, headline: str, content: str):
+ pass
+
+ @abstractmethod
+ def add_news_entry(self, key: str, news_entry: dict):
+ pass
+
+ @abstractmethod
+ def get_summary(self, key: str):
+ pass
+
+ @abstractmethod
+ def get_translation(self, key: str):
+ pass
+
+ @abstractmethod
+ def get_wac_entry(self, key: str):
+ pass
+
+ @abstractmethod
+ def check_news_id_exists(self, key: str) -> bool:
+ pass
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage