black
This commit is contained in:
@@ -11,12 +11,14 @@ import trio
|
||||
import shortuuid
|
||||
from . import copilot_ext
|
||||
|
||||
|
||||
@copilot_ext.route("/")
|
||||
@validate_uuids(["usr"], required=True)
|
||||
@check_user_exists()
|
||||
async def index():
|
||||
return await render_template("copilot/index.html", user=g.user)
|
||||
|
||||
|
||||
@copilot_ext.route("/cp/")
|
||||
async def compose():
|
||||
return await render_template("copilot/compose.html")
|
||||
@@ -34,6 +36,7 @@ async def panel():
|
||||
|
||||
connected_websockets = defaultdict(set)
|
||||
|
||||
|
||||
@copilot_ext.websocket("/ws/<id>/")
|
||||
async def wss(id):
|
||||
copilot = await get_copilot(id)
|
||||
@@ -50,9 +53,10 @@ async def wss(id):
|
||||
finally:
|
||||
connected_websockets[id].remove(send_channel)
|
||||
|
||||
|
||||
async def updater(copilot_id, data, comment):
|
||||
copilot = await get_copilot(copilot_id)
|
||||
if not copilot:
|
||||
return
|
||||
for queue in connected_websockets[copilot_id]:
|
||||
await queue.send(f"{data + '-' + comment}")
|
||||
await queue.send(f"{data + '-' + comment}")
|
||||
|
||||
Reference in New Issue
Block a user