Commit ebfa84a5 authored by Xavier Thompson's avatar Xavier Thompson

WIP

parent 3f1b59c1
......@@ -123,19 +123,37 @@ class SlapPopen(subprocess.Popen):
if debug:
self.wait()
self.output = '(output not captured in debug mode)'
self.error = '(error not captured in debug mode)'
return
self.stdin.flush()
self.stdin.close()
self.stdin = None
output_lines = []
for line in self.stdout:
if type(line) is not str:
line = line.decode(errors='replace')
output_lines.append(line)
logger.info(line.rstrip('\n'))
capture_stdout = (self.stdout == subprocess.PIPE)
capture_stderr = (self.stderr == subprocess.PIPE)
stdout_lines = []
stderr_lines = []
if capture_stdout and capture_stderr:
while True:
pass
elif capture_stdout:
for line in self.stdout:
if type(line) is not str:
line = line.decode(errors='replace')
stdout_lines.append(line)
logger.info(line.rstrip('\n'))
elif capture_stderr:
for line in self.stderr:
if type(line) is not str:
line = line.decode(errors='replace')
stderr_lines.append(line)
logger.info(line.rstrip('\n'))
self.wait(timeout=timeout)
self.output = ''.join(output_lines)
self.output = ''.join(stdout_lines)
self.error = ''.join(stderr_lines)
def md5digest(url):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment