[Python-checkins] python/dist/src/Lib/email Parser.py,1.21,1.22 (original) (raw)

bwarsaw at users.sourceforge.net bwarsaw at users.sourceforge.net
Sat May 8 23:46:44 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13873

Modified Files: Parser.py Log Message: Update to Python 2.3, getting rid of backward compatiblity crud.

This Parser is now just a backward compatible front-end to the FeedParser.

Index: Parser.py

! """A subclass of Parser, this one only meaningfully parses message headers. ! ! This class can be used if all you're interested in is the headers of a ! message. While it consumes the message body, it does not parse it, but ! simply makes it available as a string payload.

! Parsing with this subclass can be considerably faster if all you're ! interested in is the message headers. ! """ ! def _parsemessage(self, container, fp): ! # Consume but do not parse, the body ! text = fp.read() ! container.set_payload(text) ! return None --- 67,76 ---- return self.parse(StringIO(text), headersonly=headersonly)

class HeaderParser(Parser): ! def parse(self, fp, headersonly=True): ! return Parser.parse(self, fp, True)

! def parsestr(self, text, headersonly=True): ! return Parser.parsestr(self, text, True)



More information about the Python-checkins mailing list