From 7adb71efe5ba674e5efbd3a0f2739e4ba9c4b10c Mon Sep 17 00:00:00 2001
From: retoor <retoor@molodetz.nl>
Date: Tue, 10 Jun 2025 19:15:31 +0200
Subject: [PATCH] Update.
---
src/snek/view/rpc.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/snek/view/rpc.py b/src/snek/view/rpc.py
index 5cf9204..8290065 100644
--- a/src/snek/view/rpc.py
+++ b/src/snek/view/rpc.py
@@ -202,7 +202,20 @@ class RPCView(BaseView):
}
)
return channels
-
+
+ async def write_container(self, channel_uid, content):
+ self._require_login()
+ channel_member = await self.services.channel_member.get(
+ channel_uid=channel_uid, user_uid=self.user_uid
+ )
+ if not channel_member:
+ raise Exception("Not allowed")
+
+ container_name = await self.services.container.get_container_name(channel_uid)
+ await self.services.container.write_stdin(channel_uid, content.encode())
+
+ return "Written to terminal, response of terminal is not implemented yet."
+
async def get_container(self, channel_uid):
self._require_login()
channel_member = await self.services.channel_member.get(