-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanage_db.py
53 lines (40 loc) · 1.04 KB
/
manage_db.py
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
41
42
43
44
45
46
47
48
49
50
51
52
import couchdb
from mongoengine import *
from utils import *
class ManageConnection():
def __init__(self):
self.db_name = DB_NAME
def connection(self,db_server):
if db_server=='mongodb':
connect(self.db_name)
elif db_server=='couchdb':
server = couchdb.Server()
if server[self.db_name]:
return server[self.db_name]
else:
server.create(self.db_name)
return server[self.db_name]
class DbInterface():
def __init__(self):
pass
def check_article_url(self):
pass
def _set_article(self, article):
pass
def save_article(self, article):
pass
def update_article(self):
pass
@staticmethod
def sw_exist():
pass
def set_stopwords(self,sw_path):
pass
@staticmethod
def get_all_stopwords():
pass
def set_dataclusters(self,cluster_id,keywords,title):
pass
@staticmethod
def remove_cluster_content():
pass