Skip to content

Commit

Permalink
added remote input function
Browse files Browse the repository at this point in the history
  • Loading branch information
IgdaliasCabamba committed Jan 15, 2023
1 parent 9b2841a commit b0442c4
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

terminal_api = uterm.TerminalCoreApi(rows=50, cols=50)

class PtyInterface:

def input_(data:dict) -> None:
terminal_api.write(data["input"].encode())


class XtermRoutes:

Expand Down Expand Up @@ -70,16 +75,28 @@ async def on_startup(app):

async def eval_payload(prompt: str, aio: bool) -> str:
if aio:
return await eval(prompt)
try:
return await eval(prompt)
except:
return None

return eval(prompt)
try:
return eval(prompt)
except:
return None


async def exec_payload(prompt: str, aio: bool) -> None:
if aio:
await exec(prompt)

exec(prompt)
try:
await exec(prompt)
except:
pass

try:
exec(prompt)
except:
pass


async def evalRPC(request) -> web.Response:
Expand Down

0 comments on commit b0442c4

Please sign in to comment.