[Python-checkins] python/dist/src/Lib mailbox.py,1.39,1.40

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 11 Sep 2002 22:08:02 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv6597

Modified Files:
	mailbox.py 
Log Message:
Undocumented feature: MHMailbox sets the msg object's _mh_msgno
attribute to the (stringized) message number (if this attribute is
settable).  This is useful so users of this class can report the
correct message number (e.g. when classifying spam).

Also added a blank line before the first method of each class.


Index: mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** mailbox.py	26 Aug 2002 16:44:56 -0000	1.39
--- mailbox.py	12 Sep 2002 05:08:00 -0000	1.40
***************
*** 11,14 ****
--- 11,15 ----
  
  class _Mailbox:
+ 
      def __init__(self, fp, factory=rfc822.Message):
          self.fp = fp
***************
*** 36,39 ****
--- 37,41 ----
  
  class _Subfile:
+ 
      def __init__(self, fp, start, stop):
          self.fp = fp
***************
*** 95,98 ****
--- 97,101 ----
  # Recommended to use PortableUnixMailbox instead!
  class UnixMailbox(_Mailbox):
+ 
      def _search_start(self):
          while 1:
***************
*** 162,165 ****
--- 165,169 ----
  
  class MmdfMailbox(_Mailbox):
+ 
      def _search_start(self):
          while 1:
***************
*** 182,185 ****
--- 186,190 ----
  
  class MHMailbox:
+ 
      def __init__(self, dirname, factory=rfc822.Message):
          import re
***************
*** 205,209 ****
          fn = self.boxes.pop(0)
          fp = open(os.path.join(self.dirname, fn))
!         return self.factory(fp)
  
  
--- 210,219 ----
          fn = self.boxes.pop(0)
          fp = open(os.path.join(self.dirname, fn))
!         msg = self.factory(fp)
!         try:
!             msg._mh_msgno = fn
!         except (AttributeError, TypeError):
!             pass
!         return msg
  
  
***************
*** 239,242 ****
--- 249,253 ----
  
  class BabylMailbox(_Mailbox):
+ 
      def _search_start(self):
          while 1: