Skip to content

Commit

Permalink
added doctstrings to sandbox_sync pty
Browse files Browse the repository at this point in the history
  • Loading branch information
0div committed Sep 24, 2024
1 parent 9d1d075 commit 14ae860
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/python-sdk/e2b/sandbox_sync/pty/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def kill(
pid: int,
request_timeout: Optional[float] = None,
) -> bool:
"""Kill process by PID"""
try:
self._rpc.send_signal(
process_pb2.SendSignalRequest(
Expand All @@ -57,6 +58,7 @@ def send_stdin(
data: bytes,
request_timeout: Optional[float] = None,
) -> None:
"""Send data to process stdin"""
try:
self._rpc.send_input(
process_pb2.SendInputRequest(
Expand All @@ -81,6 +83,7 @@ def create(
timeout: Optional[float] = 60,
request_timeout: Optional[float] = None,
) -> ProcessHandle:
"""Create new PTY process"""
envs = envs or {}
envs["TERM"] = "xterm-256color"
events = self._rpc.start(
Expand Down Expand Up @@ -121,6 +124,7 @@ def create(
def resize(
self, pid: int, size: PtySize, request_timeout: Optional[float] = None
) -> None:
"""Resize PTY"""
self._rpc.update(
process_pb2.UpdateRequest(
process=process_pb2.ProcessSelector(pid=pid),
Expand Down

0 comments on commit 14ae860

Please sign in to comment.