From fdf58fe59a94b66ad9951bb64eedd90521ba72eb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 15 May 1997 14:33:09 +0000 Subject: Added BabylMailbox class by Fred Lundh (untested). --- Lib/mailbox.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 2d0254e..4c4eebe 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 -- cgit v0.12