Update ptyDriver.py

This commit is contained in:
chrys87 2018-05-30 13:23:45 +02:00 committed by GitHub
parent 00a9d2beda
commit b87dccbd49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,11 +75,9 @@ class driver(screenDriver):
self.env['screen']['autoIgnoreScreens'] = []
self.env['general']['prevUser'] = getpass.getuser()
self.env['general']['currUser'] = getpass.getuser()
def readAll(self,fd, timeout = 9999999, interruptFd = None):
def readAll(self,fd, timeout = 9999999, interruptFd = None, len = 4096):
bytes = b''
starttime = time.time()
bytes = os.read(fd, 4096)
if bytes == b'':
raise EOFError
# respect timeout but wait a little bit of time to see if something more is here
fdList = [fd]
if interruptFd:
@ -94,7 +92,7 @@ class driver(screenDriver):
break
if (time.time() - starttime) >= timeout:
break
data = os.read(fd, 4096)
data = os.read(fd, len)
if data == b'':
raise EOFError
bytes += data