Update ptyDriver.py
This commit is contained in:
parent
a7a0ab0d86
commit
a8603c89d7
@ -103,7 +103,7 @@ class driver(screenDriver):
|
|||||||
self.env['general']['prevUser'] = getpass.getuser()
|
self.env['general']['prevUser'] = getpass.getuser()
|
||||||
self.env['general']['currUser'] = getpass.getuser()
|
self.env['general']['currUser'] = getpass.getuser()
|
||||||
def readAll(self, fd, timeout = 1, interruptFd = None, len = 65536):
|
def readAll(self, fd, timeout = 1, interruptFd = None, len = 65536):
|
||||||
valueBytes = b''
|
msgBytes = b''
|
||||||
fdList = []
|
fdList = []
|
||||||
fdList += [fd]
|
fdList += [fd]
|
||||||
if interruptFd:
|
if interruptFd:
|
||||||
@ -117,14 +117,14 @@ class driver(screenDriver):
|
|||||||
data = os.read(fd, len)
|
data = os.read(fd, len)
|
||||||
if data == b'':
|
if data == b'':
|
||||||
raise EOFError
|
raise EOFError
|
||||||
valueBytes += data
|
msgBytes += data
|
||||||
# exit on interrupt available
|
# exit on interrupt available
|
||||||
if interruptFd in r:
|
if interruptFd in r:
|
||||||
break
|
break
|
||||||
# respect timeout but wait a little bit of time to see if something more is here
|
# respect timeout but wait a little bit of time to see if something more is here
|
||||||
if (time.time() - starttime) >= timeout:
|
if (time.time() - starttime) >= timeout:
|
||||||
break
|
break
|
||||||
return valueBytes
|
return msgBytes
|
||||||
def openTerminal(self, columns, lines, command):
|
def openTerminal(self, columns, lines, command):
|
||||||
p_pid, master_fd = pty.fork()
|
p_pid, master_fd = pty.fork()
|
||||||
if p_pid == 0: # Child.
|
if p_pid == 0: # Child.
|
||||||
|
Loading…
Reference in New Issue
Block a user