mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 21:11:32 +00:00
Expose pty reference from TerminadoMiniServer
This commit is contained in:
parent
cc2c6009dd
commit
b7f9acd3b0
@ -10,15 +10,20 @@ log = logging.getLogger(__name__)
|
|||||||
class TerminadoMiniServer:
|
class TerminadoMiniServer:
|
||||||
def __init__(self, url, port, workdir, shellcmd):
|
def __init__(self, url, port, workdir, shellcmd):
|
||||||
self.port = port
|
self.port = port
|
||||||
|
self.term_manager = UniqueTermManager(shell_command=shellcmd,
|
||||||
|
term_settings={'cwd': workdir})
|
||||||
self.application = Application(
|
self.application = Application(
|
||||||
[(
|
[(
|
||||||
url,
|
url,
|
||||||
TerminadoMiniServer.CORSTermSocket,
|
TerminadoMiniServer.CORSTermSocket,
|
||||||
{'term_manager': UniqueTermManager(shell_command=shellcmd,
|
{'term_manager': self.term_manager}
|
||||||
term_settings={'cwd': workdir})}
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def pty(self):
|
||||||
|
return self.term_manager.terminal.ptyproc
|
||||||
|
|
||||||
class CORSTermSocket(TermSocket):
|
class CORSTermSocket(TermSocket):
|
||||||
def check_origin(self, origin):
|
def check_origin(self, origin):
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user