1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
|