22 lines
601 B
Python
22 lines
601 B
Python
import json
|
|
from .databaseController import DatabaseController
|
|
from .endpoints.query import Archive_Query
|
|
|
|
class Database:
|
|
db : DatabaseController = None
|
|
processed_friends = {}
|
|
item_stages = {}
|
|
|
|
def __init__(self, api) -> None:
|
|
app = api.app
|
|
if "Archive" in app.databases:
|
|
del app.databases["Archive"]
|
|
|
|
self.reload_data()
|
|
|
|
app.databases["Archive"] = self
|
|
|
|
api.add_resource(Archive_Query, "/Archive/Query/<query>")
|
|
|
|
def reload_data(self):
|
|
self.db = DatabaseController("/home/pi/python/Katbots/JapariArchive/database.db") |