[Commits] (bkirsch) Added more detailed invalid email address display

commits at osafoundation.org commits at osafoundation.org
Wed Aug 25 15:34:03 PDT 2004


Commit by: bkirsch
Modified files:
chandler/application/dialogs/PublishCollection.py 1.2 1.3

Log message:
Added more detailed invalid email address display

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/application/dialogs/PublishCollection.py.diff?r1=text&tr1=1.2&r2=text&tr2=1.3

Index: chandler/application/dialogs/PublishCollection.py
diff -u chandler/application/dialogs/PublishCollection.py:1.2 chandler/application/dialogs/PublishCollection.py:1.3
--- chandler/application/dialogs/PublishCollection.py:1.2	Wed Aug 25 13:30:54 2004
+++ chandler/application/dialogs/PublishCollection.py	Wed Aug 25 15:34:02 2004
@@ -42,20 +42,26 @@
         invitees = self.inviteesText.GetValue()
         if invitees:
             invitees = invitees.split(",")
+            bad_addrs = []
+
             for invitee in invitees:
                 if not osaf.mail.message.isValidEmailAddress(invitee):
-                    self.waitLabel.SetLabel("Invalid address: %s" % invitee)
-                    return
+                    bad_addrs.append(invitee)
+
+            size = len(bad_addrs)
 
-        url = self.urlText.GetValue()
-        self.waitLabel.SetLabel("Publishing, Please Wait...")
+            if size > 0:
+                a = size > 1 and "addresses" or "address"
+                self.waitLabel.SetLabel("Invalid %s: %s" % (a, ', '.join(bad_addrs)))
+                return
 
-        osaf.framework.webdav.Dav.DAV(url).put(self.collection)
+            url = self.urlText.GetValue()
+            self.waitLabel.SetLabel("Publishing, Please Wait...")
 
-        if invitees:
+            osaf.framework.webdav.Dav.DAV(url).put(self.collection)
             osaf.mail.sharing.sendInvitation(url, invitees)
 
-        self.EndModal(True)
+            self.EndModal(True)
 
     def OnCancel(self, evt):
         self.EndModal(False)



More information about the Commits mailing list