no more used
This commit is contained in:
parent
5fea1e358a
commit
b0867f0e44
1 changed files with 0 additions and 22 deletions
|
@ -1,22 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
# -*- coding: UTF-8 -*-
|
|
||||||
|
|
||||||
from tinydb import TinyDB
|
|
||||||
from tinydb.storages import MemoryStorage
|
|
||||||
|
|
||||||
from stacosys.conf import config
|
|
||||||
|
|
||||||
|
|
||||||
class Persistence:
|
|
||||||
def __init__(self):
|
|
||||||
db_file = config.get(config.DB_FILE)
|
|
||||||
if db_file:
|
|
||||||
self.db = TinyDB(db_file, sort_keys=True, indent=4, separators=(",", ": "))
|
|
||||||
else:
|
|
||||||
self.db = TinyDB(storage=MemoryStorage)
|
|
||||||
|
|
||||||
def get_db(self):
|
|
||||||
return self.db
|
|
||||||
|
|
||||||
def get_table_comments(self):
|
|
||||||
return self.db.table("comments")
|
|
Loading…
Add table
Reference in a new issue