[Commits] (morgen) Protects against stale items in __str__

commits at osafoundation.org commits at osafoundation.org
Tue Oct 5 16:06:15 PDT 2004


Commit by: morgen
Modified files:
chandler/parcels/osaf/contentmodel/mail/Mail.py 1.35 1.36

Log message:
Protects against stale items in __str__


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/contentmodel/mail/Mail.py.diff?r1=text&tr1=1.35&r2=text&tr2=1.36

Index: chandler/parcels/osaf/contentmodel/mail/Mail.py
diff -u chandler/parcels/osaf/contentmodel/mail/Mail.py:1.35 chandler/parcels/osaf/contentmodel/mail/Mail.py:1.36
--- chandler/parcels/osaf/contentmodel/mail/Mail.py:1.35	Mon Oct  4 23:26:16 2004
+++ chandler/parcels/osaf/contentmodel/mail/Mail.py	Tue Oct  5 16:06:13 2004
@@ -1,8 +1,8 @@
 """ Classes used for Mail parcel kinds
 """
 
-__revision__  = "$Revision: 1.35 $"
-__date__      = "$Date: 2004/10/05 06:26:16 $"
+__revision__  = "$Revision: 1.36 $"
+__date__      = "$Date: 2004/10/05 23:06:13 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -255,6 +255,10 @@
         super (MailDeliveryError, self).__init__(name, parent, kind)
 
     def __str__(self):
+        if self.isStale():
+            return super(MailDeliveryError, self).__str__()
+            # Stale items shouldn't go through the code below
+
         return "| %d | %s | %s |" % (self.errorCode, self.errorString, self.errorDate.strftime())
 
 
@@ -550,6 +554,10 @@
         """
           User readable string version of this address
         """
+        if self.isStale():
+            return super(EmailAddress, self).__str__()
+            # Stale items shouldn't go through the code below
+
         if self.emailAddress == self._getTheMeAddress():
             fullName = 'me'
         else:



More information about the Commits mailing list