]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added BabylMailbox class by Fred Lundh (untested).
authorGuido van Rossum <guido@python.org>
Thu, 15 May 1997 14:33:09 +0000 (14:33 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 15 May 1997 14:33:09 +0000 (14:33 +0000)
Lib/mailbox.py

index 2d0254ea5a6f95e7b971e319cedc9e0aa066c341..4c4eebe3321442c098f82967918349b1ec27948f 100755 (executable)
@@ -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