from snek.app import Application
from IPython import start_ipython

class Shell:
    def __init__(self,db_path):
        self.app = Application(db_path=f"sqlite:///{db_path}")
   
    async def maintenance(self):
        await self.app.services.container.maintenance()
        await self.app.services.channel_message.maintenance()



    def run(self):
        ns = {
            "app": self.app,
            "maintenance": self.maintenance
        }
        start_ipython(argv=[], user_ns=ns)
