tweak values
This commit is contained in:
parent
61a0e69dfa
commit
968ffd42a3
@ -103,7 +103,7 @@ class driver(screenDriver):
|
||||
self.env['screen']['autoIgnoreScreens'] = []
|
||||
self.env['general']['prevUser'] = 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):
|
||||
msgBytes = b''
|
||||
fdList = []
|
||||
fdList += [fd]
|
||||
@ -111,7 +111,7 @@ class driver(screenDriver):
|
||||
fdList += [interruptFd]
|
||||
starttime = time.time()
|
||||
while True:
|
||||
r = screen_utils.hasMoreWhat(fdList, 0.0001)
|
||||
r = screen_utils.hasMoreWhat(fdList)
|
||||
# nothing more to read
|
||||
if not fd in r:
|
||||
break
|
||||
@ -123,6 +123,7 @@ class driver(screenDriver):
|
||||
if interruptFd in r:
|
||||
break
|
||||
# respect timeout but wait a little bit of time to see if something more is here
|
||||
if timeout != -1:
|
||||
if (time.time() - starttime) >= timeout:
|
||||
break
|
||||
return msgBytes
|
||||
@ -177,7 +178,7 @@ class driver(screenDriver):
|
||||
# input
|
||||
if sys.stdin in r:
|
||||
try:
|
||||
msgBytes = self.readAll(sys.stdin.fileno())
|
||||
msgBytes = self.readAll(sys.stdin.fileno(), len=4096)
|
||||
except (EOFError, OSError):
|
||||
active.value = False
|
||||
break
|
||||
@ -193,7 +194,7 @@ class driver(screenDriver):
|
||||
# output
|
||||
if self.p_out in r:
|
||||
try:
|
||||
msgBytes = self.readAll(self.p_out.fileno(), interruptFd=sys.stdin.fileno())
|
||||
msgBytes = self.readAll(self.p_out.fileno(), interruptFd=sys.stdin.fileno(), timeout = 0.5)
|
||||
except (EOFError, OSError):
|
||||
active.value = False
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user