Sort that out too
This commit is contained in:
parent
afc5ce8339
commit
6038e09670
1 changed files with 12 additions and 6 deletions
|
@ -48,6 +48,12 @@ class MBoxReaderBuffer():
|
|||
else:
|
||||
return False
|
||||
|
||||
def is_end(self):
|
||||
return self.lines[0] is not None \
|
||||
and self.is_empty_line(1) \
|
||||
and self.is_empty_line(2) \
|
||||
and self.is_from_line(3)
|
||||
|
||||
class MBoxReader():
|
||||
__slots__ = 'path', 'fh', 'line', 'buf', 'message',
|
||||
|
||||
|
@ -98,7 +104,7 @@ class MBoxReader():
|
|||
# ...Prepare a new message object.
|
||||
#
|
||||
self.message = Message()
|
||||
|
||||
elif not self.buf.is_end():
|
||||
if self.message is not None:
|
||||
#
|
||||
# Buffer the line into the current message.
|
||||
|
|
Loading…
Add table
Reference in a new issue