添加插件框架

This commit is contained in:
John Smith
2023-11-04 16:52:07 +08:00
parent 5d98bb5d14
commit f886506c39
10 changed files with 388 additions and 6 deletions

15
main.py
View File

@@ -15,10 +15,12 @@ import tornado.web
import api.chat
import api.main
import api.open_live
import api.plugin
import config
import models.database
import services.avatar
import services.chat
import services.plugin
import services.translate
import update
import utils.request
@@ -29,6 +31,7 @@ ROUTES = [
*api.main.ROUTES,
*api.chat.ROUTES,
*api.open_live.ROUTES,
*api.plugin.ROUTES,
*api.main.LAST_ROUTES,
]
@@ -63,10 +66,14 @@ def init():
services.translate.init()
services.chat.init()
update.check_update()
init_server(args.host, args.port, args.debug)
return server is not None
if server is None:
return False
services.plugin.init()
update.check_update()
return True
def init_signal_handlers():
@@ -152,6 +159,8 @@ async def run():
async def shut_down():
services.plugin.shut_down()
logger.info('Closing server')
server.stop()
await server.close_all_connections()