From b87dccbd4925165259dae4eb5e4b7880751345c8 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Wed, 30 May 2018 13:23:45 +0200 Subject: [PATCH] Update ptyDriver.py --- src/fenrirscreenreader/screenDriver/ptyDriver.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/screenDriver/ptyDriver.py b/src/fenrirscreenreader/screenDriver/ptyDriver.py index 2cba01b4..5091aa1e 100644 --- a/src/fenrirscreenreader/screenDriver/ptyDriver.py +++ b/src/fenrirscreenreader/screenDriver/ptyDriver.py @@ -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