Semantic improvements in MBoxReaderBuffer
This commit is contained in:
parent
00b0347fe2
commit
a6a6d32e79
1 changed files with 9 additions and 4 deletions
|
@ -44,15 +44,20 @@ class MBoxReaderBuffer():
|
|||
|
||||
def is_start(self):
|
||||
if self.lines[0] is None or self.lines[1] is None:
|
||||
return
|
||||
return False
|
||||
|
||||
if self.is_from_line(0) and self.is_header_line(1):
|
||||
pass
|
||||
if self.is_from_line(0) \
|
||||
and self.is_header_line(1) \
|
||||
and self.lines[2] is None \
|
||||
and self.lines[3] is None:
|
||||
return True
|
||||
elif self.is_empty_line(0) \
|
||||
and self.is_empty_line(1) \
|
||||
and self.is_from_line(2) \
|
||||
and self.is_header_line(3):
|
||||
return 3
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
class MBoxReader():
|
||||
__slots__ = 'path', 'fh', 'line', 'buf', 'message',
|
||||
|
|
Loading…
Add table
Reference in a new issue