Expose pty reference from TerminadoMiniServer

This commit is contained in:
Kristóf Tóth 2018-03-02 17:05:01 +01:00
parent cc2c6009dd
commit b7f9acd3b0

View File

@ -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