Lines Matching +full:close +full:- +full:range
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
4 # Logic to spawn a sub-process and interact with its stdio.
14 """An exception sub-class that indicates that a timeout occurred."""
18 """Represents the stdio of a freshly created sub-process. Commands may be
26 """Spawn (fork/exec) the sub-process.
44 # http://stackoverflow.com/questions/7857352/python-regex-to-match-vt100-escape-sequences
46 # version of Python in Ubuntu 14.04), hence the inclusion of a-z inside
48 self.re_vt100 = re.compile('(\x1b\[|\x9b)[^@-_a-z]*[@-_a-z]|\x1b[@-_a-z]')
55 # background (non-interactive) system?
71 self.close()
107 """Send data to the sub-process's stdin.
119 """Wait for the sub-process to emit specific data.
126 see in the sub-process' stdout.
137 for pi in range(len(patterns)):
146 for pi in range(len(patterns)):
165 tdelta_ms = (tnow_s - tstart_s) * 1000
166 poll_maxwait = self.timeout - tdelta_ms
188 def close(self): member in Spawn
189 """Close the stdio connection to the sub-process.
191 This also waits a reasonable time for the sub-process to stop running.
200 os.close(self.fd)
201 for i in range(100):