mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Added BabylMailbox class by Fred Lundh (untested).
This commit is contained in:
parent
71606f8dd9
commit
fdf58fe59a
1 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue