send eof to all parsers, recursively.
(self)
| 149 | self._buffer.feed_data(data) |
| 150 | |
| 151 | def feed_eof(self): |
| 152 | """send eof to all parsers, recursively.""" |
| 153 | if self._parser: |
| 154 | try: |
| 155 | if self._buffer: |
| 156 | self._parser.send(b'') |
| 157 | self._parser.throw(EofStream()) |
| 158 | except StopIteration: |
| 159 | self._output.feed_eof() |
| 160 | except EofStream: |
| 161 | self._output.set_exception(self._eof_exc_class()) |
| 162 | except Exception as exc: |
| 163 | self._output.set_exception(exc) |
| 164 | |
| 165 | self._parser = None |
| 166 | self._output = None |
| 167 | |
| 168 | self._eof = True |
| 169 | |
| 170 | def set_parser(self, parser, output=None): |
| 171 | """set parser to stream. return parser's DataQueue.""" |