def reader(self, stream, context):
progress = self.progress<EOL>verbose = self.verbose<EOL>while True:<EOL><INDENT>s = stream.readline()<EOL>if not s:<EOL><INDENT>break<EOL><DEDENT>if progress is not None:<EOL><INDENT>progress(s, context)<EOL><DEDENT>else:<EOL><INDENT>if not verbose:<EOL><INDENT>sys.stderr.write('<STR_LIT:.>')<EOL><DEDENT>else:<EOL><INDENT>sys.stderr.write(s.decode('<STR_LIT:utf-8>'))<EOL><DEDENT>sys.stderr.flush()<EOL><DEDENT><DEDENT>stream.close()<EOL>
Read lines from a subprocess' output stream and either pass to a progress
callable (if specified) or write progress information to sys.stderr.