Returns any unprocessed data (without processing it) and resets the parser. Should be used after all the data has been handled using feed and then collected with push. This returns any trailing data that can't be processed. If you are processing everything in one go you can
(self)
| 43 | return data |
| 44 | |
| 45 | def close(self): |
| 46 | """Returns any unprocessed data (without processing it) and resets the parser. |
| 47 | Should be used after all the data has been handled using feed and then collected with push. |
| 48 | This returns any trailing data that can't be processed. |
| 49 | |
| 50 | If you are processing everything in one go you can safely use this method to return everything. |
| 51 | """ |
| 52 | data = self.push() + self.buffer |
| 53 | self.buffer = '' |
| 54 | return data |
| 55 | |
| 56 | def feed(self, data): |
| 57 | """Pass more data into the parser. |