Source code for caspia.homeserver.services.base
import asyncio
import tinydb
[docs]class Service:
def __init__(self, *, loop, db, config):
self.loop: asyncio.AbstractEventLoop = loop
self.db: tinydb.TinyDB = db
self.config: dict = config
if hasattr(self, 'table_name'):
self.table: tinydb.TinyDB = self.db.table(getattr(self, 'table_name'))
self.on_init()