From: Guido van Rossum Date: Thu, 15 May 1997 14:33:09 +0000 (+0000) Subject: Added BabylMailbox class by Fred Lundh (untested). X-Git-Tag: v1.5a3~547 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fdf58fe59a94b66ad9951bb64eedd90521ba72eb;p=thirdparty%2FPython%2Fcpython.git Added BabylMailbox class by Fred Lundh (untested). --- diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 2d0254ea5a6f..4c4eebe33214 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -134,6 +134,26 @@ class MHMailbox: return rfc822.Message(fp) +class BabylMailbox(_Mailbox): + def _search_start(self): + while 1: + line = self.fp.readline() + if not line: + raise EOFError + if line == '*** EOOH ***\n': + return + + def _search_end(self): + while 1: + pos = self.fp.tell() + line = self.fp.readline() + if not line: + return + if line == '\037\014\n': + self.fp.seek(pos) + return + + def _test(): import time import sys